gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase|0x0|UINT32|0xd\r
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase|0x0|UINT32|0xe\r
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress|0x0|UINT32|0xf\r
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|0x0|UINT32|0x11\r
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize|0x0|UINT32|0x12\r
\r
[PcdsDynamic, PcdsDynamicEx]\r
gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent|0|UINT64|2\r
SetCr3ForPageTables64:\r
\r
;\r
- ; For OVMF, build some initial page tables at 0x80000. This is just\r
- ; after the early stack/temp RAM.\r
+ ; For OVMF, build some initial page tables at 0x800000-0x806000.\r
+ ;\r
+ ; This range should match with PcdOvmfSecPageTablesBase and\r
+ ; PcdOvmfSecPageTablesSize which are declared in the FDF files.\r
;\r
; At the end of PEI, the pages tables will be rebuilt into a\r
; more permanent location by DxeIpl.\r
mov ecx, 6 * 0x1000 / 4\r
xor eax, eax\r
clearPageTablesMemoryLoop:\r
- mov dword[ecx * 4 + 0x80000 - 4], eax\r
+ mov dword[ecx * 4 + 0x800000 - 4], eax\r
loop clearPageTablesMemoryLoop\r
\r
;\r
; Top level Page Directory Pointers (1 * 512GB entry)\r
;\r
- mov dword[0x80000], 0x81000 + PAGE_PDP_ATTR\r
+ mov dword[0x800000], 0x801000 + PAGE_PDP_ATTR\r
\r
;\r
; Next level Page Directory Pointers (4 * 1GB entries => 4GB)\r
;\r
- mov dword[0x81000], 0x82000 + PAGE_PDP_ATTR\r
- mov dword[0x81008], 0x83000 + PAGE_PDP_ATTR\r
- mov dword[0x81010], 0x84000 + PAGE_PDP_ATTR\r
- mov dword[0x81018], 0x85000 + PAGE_PDP_ATTR\r
+ mov dword[0x801000], 0x802000 + PAGE_PDP_ATTR\r
+ mov dword[0x801008], 0x803000 + PAGE_PDP_ATTR\r
+ mov dword[0x801010], 0x804000 + PAGE_PDP_ATTR\r
+ mov dword[0x801018], 0x805000 + PAGE_PDP_ATTR\r
\r
;\r
; Page Table Entries (2048 * 2MB entries => 4GB)\r
dec eax\r
shl eax, 21\r
add eax, PAGE_2M_PDE_ATTR\r
- mov [ecx * 8 + 0x82000 - 8], eax\r
+ mov [ecx * 8 + 0x802000 - 8], eax\r
loop pageTableEntriesLoop\r
\r
;\r
; Set CR3 now that the paging structures are available\r
;\r
- mov eax, 0x80000\r
+ mov eax, 0x800000\r
mov cr3, eax\r
\r
OneTimeCallRet SetCr3ForPageTables64\r