summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/ResetVector
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2014-01-21 19:38:34 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2014-01-21 19:38:34 +0000
commitb382ede3864e17e8827dbc90c7d4f1540b94ff3f (patch)
treea11992942fe9601482f02f0bbd1e8c1d2f31a70f /OvmfPkg/ResetVector
parentbb4aa855f3615352d1cbe733b1a329f6d94c7264 (diff)
downloadedk2-b382ede3864e17e8827dbc90c7d4f1540b94ff3f.tar.gz
edk2-b382ede3864e17e8827dbc90c7d4f1540b94ff3f.tar.bz2
edk2-b382ede3864e17e8827dbc90c7d4f1540b94ff3f.zip
OvmfPkg X64 ResetVector: Move page tables from 512KB to 8MB
To help consolidate OVMF fixed memory uses, we declare this range in MEMFD and thereby move it to 8MB. We also now declare the table range in the FDF to set PCDs. This allows us to ASSERT that CR3 is set as expected in OVMF SEC. OvmfPkgIa32.fdf and OvmfPkgIa32X64.fdf are updated simply for consistency. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15146 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/ResetVector')
-rw-r--r--OvmfPkg/ResetVector/Bin/ResetVector.x64.rawbin628 -> 628 bytes
-rw-r--r--OvmfPkg/ResetVector/Ia32/PageTables64.asm22
2 files changed, 12 insertions, 10 deletions
diff --git a/OvmfPkg/ResetVector/Bin/ResetVector.x64.raw b/OvmfPkg/ResetVector/Bin/ResetVector.x64.raw
index 237d08a293..a3fc97c93e 100644
--- a/OvmfPkg/ResetVector/Bin/ResetVector.x64.raw
+++ b/OvmfPkg/ResetVector/Bin/ResetVector.x64.raw
Binary files differ
diff --git a/OvmfPkg/ResetVector/Ia32/PageTables64.asm b/OvmfPkg/ResetVector/Ia32/PageTables64.asm
index 8280e8f140..b5a4cf8d71 100644
--- a/OvmfPkg/ResetVector/Ia32/PageTables64.asm
+++ b/OvmfPkg/ResetVector/Ia32/PageTables64.asm
@@ -44,8 +44,10 @@ BITS 32
SetCr3ForPageTables64:
;
- ; For OVMF, build some initial page tables at 0x80000. This is just
- ; after the early stack/temp RAM.
+ ; For OVMF, build some initial page tables at 0x800000-0x806000.
+ ;
+ ; This range should match with PcdOvmfSecPageTablesBase and
+ ; PcdOvmfSecPageTablesSize which are declared in the FDF files.
;
; At the end of PEI, the pages tables will be rebuilt into a
; more permanent location by DxeIpl.
@@ -54,21 +56,21 @@ SetCr3ForPageTables64:
mov ecx, 6 * 0x1000 / 4
xor eax, eax
clearPageTablesMemoryLoop:
- mov dword[ecx * 4 + 0x80000 - 4], eax
+ mov dword[ecx * 4 + 0x800000 - 4], eax
loop clearPageTablesMemoryLoop
;
; Top level Page Directory Pointers (1 * 512GB entry)
;
- mov dword[0x80000], 0x81000 + PAGE_PDP_ATTR
+ mov dword[0x800000], 0x801000 + PAGE_PDP_ATTR
;
; Next level Page Directory Pointers (4 * 1GB entries => 4GB)
;
- mov dword[0x81000], 0x82000 + PAGE_PDP_ATTR
- mov dword[0x81008], 0x83000 + PAGE_PDP_ATTR
- mov dword[0x81010], 0x84000 + PAGE_PDP_ATTR
- mov dword[0x81018], 0x85000 + PAGE_PDP_ATTR
+ mov dword[0x801000], 0x802000 + PAGE_PDP_ATTR
+ mov dword[0x801008], 0x803000 + PAGE_PDP_ATTR
+ mov dword[0x801010], 0x804000 + PAGE_PDP_ATTR
+ mov dword[0x801018], 0x805000 + PAGE_PDP_ATTR
;
; Page Table Entries (2048 * 2MB entries => 4GB)
@@ -79,13 +81,13 @@ pageTableEntriesLoop:
dec eax
shl eax, 21
add eax, PAGE_2M_PDE_ATTR
- mov [ecx * 8 + 0x82000 - 8], eax
+ mov [ecx * 8 + 0x802000 - 8], eax
loop pageTableEntriesLoop
;
; Set CR3 now that the paging structures are available
;
- mov eax, 0x80000
+ mov eax, 0x800000
mov cr3, eax
OneTimeCallRet SetCr3ForPageTables64