Merge branch 'stmpe' of github.com:EugeneDMyers/STM into stmpe

This commit is contained in:
Eugene D Myers 2020-08-06 15:41:29 -04:00
commit 9dd1f6f309
3 changed files with 12 additions and 10 deletions

View File

@ -238,7 +238,7 @@ void LaunchPeVm(UINT32 PeType, UINT32 CpuIndex)
AsmWbinvd ();
DEBUG((EFI_D_INFO,
"%ld LaunchPeVm - ***Debug*** VmPE ready for launch PeType %d registers-address: 0x%016llx\n",
"%ld LaunchPeVm - VmPE ready for launch PeType %d registers-address: 0x%016llx\n",
CpuIndex,
PeType,
&mGuestContextCommonSmm[PeType].GuestContextPerCpu[0].Register ));
@ -501,10 +501,12 @@ UINT32 PostPeVmProc(UINT32 rc, UINT32 CpuIndex, UINT32 mode)
{
// user wants perm vm released after crash
mode = RELEASE_VM;
DEBUG((EFI_D_INFO,
DEBUG ((EFI_D_INFO,
"%ld PostPeVmProc - Perm VM configured to run only once\n",
CpuIndex));
PeSmiControl.PeCpuIndex = -1; // indicate none functioning at this momemnet
// indicate none functioning at this momemnet
PeSmiControl.PeCpuIndex = -1;
}
else
{
@ -516,6 +518,7 @@ UINT32 PostPeVmProc(UINT32 rc, UINT32 CpuIndex, UINT32 mode)
"%ld PostPeVmProc - Perm VM being setup for Timer interrupt\n",
CpuIndex));
PeSmiControl.PeCpuIndex = CpuIndex;
//
PeSmiControl.PeWaitTimer = 1;
PeVmData[PeType].PeVmState = PE_VM_IDLE;
@ -540,8 +543,10 @@ UINT32 PostPeVmProc(UINT32 rc, UINT32 CpuIndex, UINT32 mode)
CpuIndex,
PeType));
// we will fake a return to the MLE - that will cause the pending SMI to fire allowing
// the smiEvent handler to process is and release all the processor threads
// we will fake a return to the MLE -
// that will cause the pending SMI to fire allowing
// the smiEvent handler to process it and release all
// he processor threads
// to handle the SMI
AsmVmPtrLoad(&mGuestContextCommonSmi.GuestContextPerCpu[CpuIndex].Vmcs);
@ -601,9 +606,6 @@ UINT32 PostPeVmProc(UINT32 rc, UINT32 CpuIndex, UINT32 mode)
// so that in production someone cannot take advantange of this case
PeVmData[PeType].PeVmState = PE_VM_AVAIL; // not there anymore
PeSmiControl.PeCpuIndex = -1; // indicate none functioning at this momemnet
//keep the old vmcs around - think about clearing...
//FreePages((UINTN *)mGuestContextCommonSmm[PeType].GuestContextPerCpu[0].Vmcs, 2);
//mGuestContextCommonSmm[PeType].GuestContextPerCpu[0].Vmcs = 0L; // not there any more
DEBUG((EFI_D_INFO,
"%ld PostPeVmProc - PE/VM Free (AVAIL) - PeType: %ld\n",
CpuIndex,

View File

@ -94,7 +94,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define PE_VM_SUSPEND 5 // PE VM is suspended because of SMI
#define PE_VM_OPT_OUT_PERM 6 // Perm PE VM Opt Out
#define PE_VM_OPT_OUT_TEMP 7 // Temp PE VM Opt Out
#define PE_VM_WAIT_START 8
#define PE_VM_WAIT_START 8 // PE VM is waiting to start
typedef unsigned char byte;
typedef unsigned short int word;

View File

@ -44,7 +44,7 @@ UINT32 PeSmiHandler(UINT32 CpuIndex)
UINT32 TimerSTS = 0;
InterlockedCompareExchange32(&PeSmiControl.PeSmiState, PESMINULL, PESMIHSMI);
//DEBUG((EFI_D_INFO, "%ld PeSmiHandler - CurrPeSmiState %ld\n", CpuIndex, PeSmiControl.PeSmiState));
//DEBUG((EFI_D_INFO, "%ld PeSmiHandler - CurrPeSmiState %ld\n", CpuIndex, PeSmiControl.PeSmiState));
if(PeSmiControl.PeCpuIndex == (INT32)CpuIndex ) // when the pe/vm comes in...
{