45 BOOLEAN InterruptState;
54 ASSERT (Msr.GhcbInfo.Function == 0);
66 if (SevEsData->VcCount > VMGEXIT_MAXIMUM_VC_COUNT) {
68 }
else if (SevEsData->VcCount > 1) {
74 GhcbBackupSize = (VMGEXIT_MAXIMUM_VC_COUNT - 1) *
sizeof (*Ghcb);
75 if (GhcbBackupSize >
FixedPcdGet32 (PcdOvmfSecGhcbBackupSize)) {
87 GhcbBackup = (GHCB *)
FixedPcdGet32 (PcdOvmfSecGhcbBackupBase);
88 GhcbBackup += (SevEsData->VcCount - 2);
90 CopyMem (GhcbBackup, Ghcb,
sizeof (*Ghcb));
95 if (GhcbBackup !=
NULL) {
99 CopyMem (Ghcb, GhcbBackup,
sizeof (*Ghcb));
102 SevEsData->VcCount--;
104 if (InterruptState) {
BOOLEAN EFIAPI GetInterruptState(VOID)
VOID EFIAPI EnableInterrupts(VOID)
VOID EFIAPI DisableInterrupts(VOID)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
#define ASSERT(Expression)
UINT64 EFIAPI AsmReadMsr64(IN UINT32 Index)
#define FixedPcdGet32(TokenName)
EFI_STATUS EFIAPI VmgExitHandleVc(IN OUT EFI_EXCEPTION_TYPE *ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
EFI_STATUS EFIAPI InternalVmgExitHandleVc(IN OUT GHCB *Ghcb, IN OUT EFI_EXCEPTION_TYPE *ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
VOID EFIAPI VmgExitIssueAssert(IN OUT SEV_ES_PER_CPU_DATA *SevEsData)