18#define IA32_PG_RW BIT1
19#define IA32_PG_PS BIT7
40 Pml4 = (UINT64 *)(
UINTN)PageTableBase;
41 PageTableBase += SIZE_4KB;
42 *Pml4 = PageTableBase | IA32_PG_RW |
IA32_PG_P;
44 Pde = (UINT64 *)(
UINTN)PageTableBase;
45 PageTableBase += SIZE_4KB;
46 Pte = (UINT64 *)(
UINTN)PageTableBase;
48 for (Index = 0; Index < 4; Index++) {
49 *Pde = PageTableBase | IA32_PG_RW |
IA32_PG_P;
51 PageTableBase += SIZE_4KB;
53 for (SubIndex = 0; SubIndex < SIZE_4KB /
sizeof (*Pte); SubIndex++) {
54 *Pte = (((Index << 9) + SubIndex) << 21) | IA32_PG_PS | IA32_PG_RW |
IA32_PG_P;
82 DEBUG ((DEBUG_ERROR,
"SmmStmExceptionHandler ...\n"));
86 Context.X64StackFrame->Rip += Context.X64StackFrame->VmcsExitInstructionLength;
VOID StmGen4GPageTable(IN UINTN PageTableBase)
UINT32 EFIAPI SmmStmExceptionHandler(IN OUT STM_PROTECTION_EXCEPTION_STACK_FRAME Context)
#define DEBUG(Expression)