Modify some DEBUG statments and remove DOS line endings

Signed-off-by: Eugene D. Myers <edmyers@tycho.nsa.gov>
This commit is contained in:
Eugene D. Myers 2020-10-15 12:40:37 -04:00 committed by Eugene D Myers
parent c11c39d9d2
commit 8273e51b56
2 changed files with 24 additions and 15 deletions

View File

@ -65,9 +65,6 @@ UnknownHandlerSmm (
UINT32 ExitReason;
AcquireSpinLock (&mHostContextCommon.DebugLock);
//DEBUG ((EFI_D_ERROR, "%ld !!!UnknownHandlerSmm\n", (UINTN)Index));
ExitReason = VmRead32 (VMCS_32_RO_EXIT_REASON_INDEX);
DEBUG((EFI_D_ERROR, "%ld UnknownHandlerSmm - VMExit Reason: 0x%08x\n", (UINTN) Index, ExitReason));
@ -127,7 +124,7 @@ StmHandlerSmm (
Register->Rsp = VmReadN (VMCS_N_GUEST_RSP_INDEX);
CopyMem (Reg, Register, sizeof(X86_REGISTER));
#if 0
DEBUG ((EFI_D_INFO, "%ld - !!!StmHandlerSmm X86_REG_Size %d\n", (UINTN)Index));
DEBUG ((EFI_D_INFO, "%ld - !!!StmHandlerSmm\n", (UINTN)Index));
#endif
//
// Dispatch
@ -142,9 +139,11 @@ StmHandlerSmm (
//
// Call dispatch handler
//
//DEBUG ((EFI_D_ERROR, "%ld - StmHandlerSmm - calling handler reason: %d\n", (UINTN)Index, InfoBasic.Bits.Reason));
#if 0
DEBUG ((EFI_D_ERROR, "%ld - StmHandlerSmm - calling handler reason: %d\n",
(UINTN)Index,
InfoBasic.Bits.Reason));
#endif
mStmHandlerSmm[InfoBasic.Bits.Reason] (Index);
VmWriteN (VMCS_N_GUEST_RSP_INDEX, Reg->Rsp); // sync RSP

View File

@ -41,7 +41,11 @@ SmmSetup (
AsmVmPtrStore (&mGuestContextCommonSmi.GuestContextPerCpu[Index].Vmcs);
Rflags = AsmVmPtrLoad (&mGuestContextCommonSmm[SMI_HANDLER].GuestContextPerCpu[Index].Vmcs);
if ((Rflags & (RFLAGS_CF | RFLAGS_ZF)) != 0) {
DEBUG ((EFI_D_ERROR, "%ld ERROR: AsmVmPtrLoad - %016lx : %08x\n", (UINTN)Index, mGuestContextCommonSmm[SMI_HANDLER].GuestContextPerCpu[Index].Vmcs, Rflags));
DEBUG ((EFI_D_ERROR,
"%ld ERROR: AsmVmPtrLoad - %016lx : %08x\n",
(UINTN)Index,
mGuestContextCommonSmm[SMI_HANDLER].GuestContextPerCpu[Index].Vmcs,
Rflags));
CpuDeadLoop ();
}
@ -61,20 +65,23 @@ SmmSetup (
STM_PERF_START (Index, 0, "BiosSmmHandler", "SmmSetup");
DEBUG ((EFI_D_INFO, "SmmStmSetupRip start (%d) ...\n", (UINTN)Index));
DEBUG ((EFI_D_INFO, "New HostStack (%d) - %08x\n", (UINTN)Index, VmReadN (VMCS_N_HOST_RSP_INDEX)));
DEBUG ((EFI_D_INFO, "%ld SmmStmSetupRip start ...\n", (UINTN)Index));
DEBUG ((EFI_D_INFO, "%ld New HostStack - %08x\n",
(UINTN)Index, VmReadN (VMCS_N_HOST_RSP_INDEX)));
mHostContextCommon.HostContextPerCpu[Index].JumpBufferValid = TRUE;
mGuestContextCommonSmm[SMI_HANDLER].GuestContextPerCpu[Index].Launched = TRUE;
Rflags = AsmVmLaunch (&mGuestContextCommonSmm[SMI_HANDLER].GuestContextPerCpu[Index].Register);
mGuestContextCommonSmm[SMI_HANDLER].GuestContextPerCpu[Index].Launched = FALSE;
AcquireSpinLock (&mHostContextCommon.DebugLock);
DEBUG ((EFI_D_ERROR, "!!!SmmSetup FAIL!!!\n"));
DEBUG ((EFI_D_ERROR, "Rflags: %08x\n", Rflags));
DEBUG ((EFI_D_ERROR, "VMCS_32_RO_VM_INSTRUCTION_ERROR: %08x\n", (UINTN)VmRead32 (VMCS_32_RO_VM_INSTRUCTION_ERROR_INDEX)));
DEBUG ((EFI_D_ERROR, "%ld !!!SmmSetup FAIL!!!\n", (UINTN) Index));
DEBUG ((EFI_D_ERROR, "%ld Rflags: %08x\n", (UINTN) Index, Rflags));
DEBUG ((EFI_D_ERROR, "%ld VMCS_32_RO_VM_INSTRUCTION_ERROR: %08x\n",
(UINTN) Index,
(UINTN)VmRead32 (VMCS_32_RO_VM_INSTRUCTION_ERROR_INDEX)));
ReleaseSpinLock (&mHostContextCommon.DebugLock);
CpuDeadLoop ();
}
DEBUG ((EFI_D_INFO, "SmmStmSetupRip end (%d)\n", (UINTN)Index));
DEBUG ((EFI_D_INFO, "%ld SmmStmSetupRip end\n", (UINTN)Index));
//
// Restore HOST_RSP
@ -85,7 +92,10 @@ SmmSetup (
Rflags = AsmVmPtrLoad (&mGuestContextCommonSmi.GuestContextPerCpu[Index].Vmcs);
if ((Rflags & (RFLAGS_CF | RFLAGS_ZF)) != 0) {
DEBUG ((EFI_D_ERROR, "ERROR: AsmVmPtrLoad(%d) - %016lx : %08x\n", (UINTN)Index, mGuestContextCommonSmi.GuestContextPerCpu[Index].Vmcs, Rflags));
DEBUG ((EFI_D_ERROR, "%ld ERROR: AsmVmPtrLoad - %016lx : %08x\n",
(UINTN)Index,
mGuestContextCommonSmi.GuestContextPerCpu[Index].Vmcs,
Rflags));
CpuDeadLoop ();
}
}