/* Notify the hypervisor using the VMGEXIT instruction that the SEV-ES guest wishes to be terminated. */
VOID SevEsProtocolFailure(IN UINT8 ReasonCode)
/* Notify the hypervisor using the VMGEXIT instruction that the SEV-ES guest wishes to be terminated. */
VOID SevEsProtocolFailure(IN UINT8 ReasonCode)
{
  MSR_SEV_ES_GHCB_REGISTER  Msr;
  Msr.GhcbPhysicalAddress         = 0;
  Msr.GhcbTerminate.Function      = GHCB_INFO_TERMINATE_REQUEST;
  Msr.GhcbTerminate.ReasonCodeSet = GHCB_TERMINATE_GHCB;
  Msr.GhcbTerminate.ReasonCode    = ReasonCode;
  AsmWriteMsr64 (MSR_SEV_ES_GHCB, Msr.GhcbPhysicalAddress);
  AsmVmgExit ();
  ASSERT (FALSE);
  CpuDeadLoop ();
}