mirror of https://review.coreboot.org/STM.git
Core/Init/StmInit.c - Clear possible VMCS cache residue
Make sure that cache VMCS residue is cleared from the processor. This can affect the STM VM's when the STM is torn down when the proessor is suspended. In this instance the processor may hold in it's VMCS cache the previous SMI and SMM VMCS's, which if not cleared can corrupt the new VMCS and cause unpredicatable actions to occur. Signed-off-by: Eugene Myers <edmyers@tycho.nsa.gov>
This commit is contained in:
parent
55106defc3
commit
449be74faf
|
@ -1159,8 +1159,18 @@ VmcsInit (
|
|||
if ((Rflags & (RFLAGS_CF | RFLAGS_ZF)) != 0) {
|
||||
DEBUG ((EFI_D_ERROR, "%d ERROR: AsmVmClear - %016lx : %08x\n", (UINTN)Index, CurrentVmcs, Rflags));
|
||||
CpuDeadLoop ();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* clear possible cache residue from previous incarnation of STM */
|
||||
Rflags = AsmVmClear ((VOID *)(UINTN) &mGuestContextCommonSmi.GuestContextPerCpu[Index].Vmcs);
|
||||
if ((Rflags & (RFLAGS_CF | RFLAGS_ZF)) != 0) {
|
||||
DEBUG ((EFI_D_ERROR, "%d : Warning AsmVmClear - %016lx : %08x\n", (UINTN)Index,
|
||||
(VOID *)(UINTN)mGuestContextCommonSmi.GuestContextPerCpu[Index].Vmcs,
|
||||
Rflags));
|
||||
}
|
||||
|
||||
AsmVmClear((VOID *) (UINTN) &mGuestContextCommonSmm[SMI_HANDLER].GuestContextPerCpu[Index].Vmcs);
|
||||
|
||||
CopyMem (
|
||||
(VOID *)(UINTN)mGuestContextCommonSmi.GuestContextPerCpu[Index].Vmcs,
|
||||
(VOID *)(UINTN)CurrentVmcs,
|
||||
|
|
Loading…
Reference in New Issue