37typedef PACKED
struct {
47} SEV_SNP_CPUID_FUNCTION;
52typedef PACKED
struct {
56 SEV_SNP_CPUID_FUNCTION function[0];
82 Status =
CcExitVmgExit (Ghcb, SVM_EXIT_UNSUPPORTED, Regs->ExceptionData, 0);
87 Event.Elements.Vector = GP_EXCEPTION;
88 Event.Elements.Type = GHCB_EVENT_INJECTION_TYPE_EXCEPTION;
89 Event.Elements.Valid = 1;
91 Status = Event.Uint64;
119 MEM_ENCRYPT_SEV_ADDRESS_RANGE_STATE State;
127 if (State == MemEncryptSevAddressRangeUnencrypted) {
136 "MMIO using encrypted memory: %lx\n",
137 (UINT64)MemoryAddress
140 GpEvent.Elements.Vector = GP_EXCEPTION;
141 GpEvent.Elements.Type = GHCB_EVENT_INJECTION_TYPE_EXCEPTION;
142 GpEvent.Elements.Valid = 1;
144 return GpEvent.Uint64;
169 UINT64 ExitInfo1, ExitInfo2, Status;
172 UINT8 OpCode, SignByte;
177 OpCode = *(InstructionData->OpCodes);
178 if (OpCode == TWO_BYTE_OPCODE_ESCAPE) {
179 OpCode = *(InstructionData->OpCodes + 1);
193 Bytes = ((Bytes != 0) ? Bytes :
194 (InstructionData->DataSize == Size16Bits) ? 2 :
195 (InstructionData->DataSize == Size32Bits) ? 4 :
196 (InstructionData->DataSize == Size64Bits) ? 8 :
199 if (InstructionData->Ext.ModRm.Mod == 3) {
211 ExitInfo1 = InstructionData->Ext.RmData;
213 CopyMem (Ghcb->SharedBuffer, &InstructionData->Ext.RegData, Bytes);
215 Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;
217 Status =
CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, ExitInfo2);
233 Bytes = ((Bytes != 0) ? Bytes :
234 (InstructionData->DataSize == Size16Bits) ? 2 :
235 (InstructionData->DataSize == Size32Bits) ? 4 :
236 (InstructionData->DataSize == Size64Bits) ? 8 :
239 InstructionData->ImmediateSize = (
UINTN)(1 << InstructionData->AddrSize);
240 InstructionData->End += InstructionData->ImmediateSize;
247 sizeof (
UINTN) ==
sizeof (UINT64),
248 "sizeof (UINTN) != sizeof (UINT64), this file must be built as X64"
254 InstructionData->Immediate,
255 InstructionData->ImmediateSize
265 CopyMem (Ghcb->SharedBuffer, &Regs->Rax, Bytes);
267 Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;
269 Status =
CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, ExitInfo2);
286 Bytes = ((Bytes != 0) ? Bytes :
287 (InstructionData->DataSize == Size16Bits) ? 2 :
288 (InstructionData->DataSize == Size32Bits) ? 4 :
291 InstructionData->ImmediateSize = Bytes;
292 InstructionData->End += Bytes;
299 ExitInfo1 = InstructionData->Ext.RmData;
301 CopyMem (Ghcb->SharedBuffer, InstructionData->Immediate, Bytes);
303 Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;
305 Status =
CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, ExitInfo2);
322 Bytes = ((Bytes != 0) ? Bytes :
323 (InstructionData->DataSize == Size16Bits) ? 2 :
324 (InstructionData->DataSize == Size32Bits) ? 4 :
325 (InstructionData->DataSize == Size64Bits) ? 8 :
327 if (InstructionData->Ext.ModRm.Mod == 3) {
339 ExitInfo1 = InstructionData->Ext.RmData;
342 Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;
344 Status =
CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2);
369 Bytes = ((Bytes != 0) ? Bytes :
370 (InstructionData->DataSize == Size16Bits) ? 2 :
371 (InstructionData->DataSize == Size32Bits) ? 4 :
372 (InstructionData->DataSize == Size64Bits) ? 8 :
375 InstructionData->ImmediateSize = (
UINTN)(1 << InstructionData->AddrSize);
376 InstructionData->End += InstructionData->ImmediateSize;
383 sizeof (
UINTN) ==
sizeof (UINT64),
384 "sizeof (UINTN) != sizeof (UINT64), this file must be built as X64"
390 InstructionData->Immediate,
391 InstructionData->ImmediateSize
402 Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;
404 Status =
CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2);
416 CopyMem (&Regs->Rax, Ghcb->SharedBuffer, Bytes);
429 Bytes = (Bytes != 0) ? Bytes : 2;
436 ExitInfo1 = InstructionData->Ext.RmData;
439 Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;
441 Status =
CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2);
461 Bytes = (Bytes != 0) ? Bytes : 2;
468 ExitInfo1 = InstructionData->Ext.RmData;
471 Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;
473 Status =
CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2);
481 Data = (UINT8 *)Ghcb->SharedBuffer;
482 SignByte = ((*Data & BIT7) != 0) ? 0xFF : 0x00;
486 Data = (UINT16 *)Ghcb->SharedBuffer;
487 SignByte = ((*Data & BIT15) != 0) ? 0xFF : 0x00;
496 DEBUG ((DEBUG_ERROR,
"Invalid MMIO opcode (%x)\n", OpCode));
497 Status = GP_EXCEPTION;
526 Ghcb->SaveArea.Rax = Regs->Rax;
528 Ghcb->SaveArea.Rcx = Regs->Rcx;
556 Ghcb->SaveArea.Rax = Regs->Rax;
558 Ghcb->SaveArea.Rcx = Regs->Rcx;
560 Ghcb->SaveArea.Rdx = Regs->Rdx;
629 Regs->Rax = Ghcb->SaveArea.Rax;
630 Regs->Rcx = Ghcb->SaveArea.Rcx;
631 Regs->Rdx = Ghcb->SaveArea.Rdx;
660 Ghcb->SaveArea.Rax = Regs->Rax;
662 Ghcb->SaveArea.Cpl = (UINT8)(Regs->Cs & 0x3);
674 Regs->Rax = Ghcb->SaveArea.Rax;
713 if (*(InstructionData->OpCodes + 1) == 0x30) {
718 Regs->Rax = Msr.Bits.Lower32Bits;
719 Regs->Rdx = Msr.Bits.Upper32Bits;
724 switch (*(InstructionData->OpCodes + 1)) {
727 Ghcb->SaveArea.Rax = Regs->Rax;
729 Ghcb->SaveArea.Rdx = Regs->Rdx;
735 Ghcb->SaveArea.Rcx = Regs->Rcx;
747 if (ExitInfo1 == 0) {
754 Regs->Rax = Ghcb->SaveArea.Rax;
755 Regs->Rdx = Ghcb->SaveArea.Rdx;
784 switch (*(InstructionData->OpCodes)) {
790 ExitInfo |= IOIO_TYPE_INS;
791 ExitInfo |= IOIO_SEG_ES;
792 ExitInfo |= ((Regs->Rdx & 0xffff) << 16);
800 ExitInfo |= IOIO_TYPE_OUTS;
801 ExitInfo |= IOIO_SEG_DS;
802 ExitInfo |= ((Regs->Rdx & 0xffff) << 16);
810 InstructionData->ImmediateSize = 1;
811 InstructionData->End++;
812 ExitInfo |= IOIO_TYPE_IN;
813 ExitInfo |= ((*(InstructionData->OpCodes + 1)) << 16);
821 InstructionData->ImmediateSize = 1;
822 InstructionData->End++;
823 ExitInfo |= IOIO_TYPE_OUT;
824 ExitInfo |= ((*(InstructionData->OpCodes + 1)) << 16) | IOIO_TYPE_OUT;
832 ExitInfo |= IOIO_TYPE_IN;
833 ExitInfo |= ((Regs->Rdx & 0xffff) << 16);
841 ExitInfo |= IOIO_TYPE_OUT;
842 ExitInfo |= ((Regs->Rdx & 0xffff) << 16);
849 switch (*(InstructionData->OpCodes)) {
859 ExitInfo |= IOIO_DATA_8;
866 ExitInfo |= (InstructionData->DataSize == Size16Bits) ? IOIO_DATA_16
870 switch (InstructionData->AddrSize) {
872 ExitInfo |= IOIO_ADDR_16;
876 ExitInfo |= IOIO_ADDR_32;
880 ExitInfo |= IOIO_ADDR_64;
887 if (InstructionData->RepMode != 0) {
888 ExitInfo |= IOIO_REP;
916 UINT64 ExitInfo1, ExitInfo2, Status;
920 if (ExitInfo1 == 0) {
924 IsString = ((ExitInfo1 & IOIO_TYPE_STR) != 0) ?
TRUE :
FALSE;
926 UINTN IoBytes, VmgExitBytes;
927 UINTN GhcbCount, OpCount;
931 IoBytes = IOIO_DATA_BYTES (ExitInfo1);
932 GhcbCount =
sizeof (Ghcb->SharedBuffer) / IoBytes;
934 OpCount = ((ExitInfo1 & IOIO_REP) != 0) ? Regs->Rcx : 1;
935 while (OpCount != 0) {
936 ExitInfo2 =
MIN (OpCount, GhcbCount);
937 VmgExitBytes = ExitInfo2 * IoBytes;
939 if ((ExitInfo1 & IOIO_TYPE_IN) == 0) {
940 CopyMem (Ghcb->SharedBuffer, (VOID *)Regs->Rsi, VmgExitBytes);
941 Regs->Rsi += VmgExitBytes;
944 Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;
946 Status =
CcExitVmgExit (Ghcb, SVM_EXIT_IOIO_PROT, ExitInfo1, ExitInfo2);
951 if ((ExitInfo1 & IOIO_TYPE_IN) != 0) {
952 CopyMem ((VOID *)Regs->Rdi, Ghcb->SharedBuffer, VmgExitBytes);
953 Regs->Rdi += VmgExitBytes;
956 if ((ExitInfo1 & IOIO_REP) != 0) {
957 Regs->Rcx -= ExitInfo2;
960 OpCount -= ExitInfo2;
963 if ((ExitInfo1 & IOIO_TYPE_IN) != 0) {
964 Ghcb->SaveArea.Rax = 0;
966 CopyMem (&Ghcb->SaveArea.Rax, &Regs->Rax, IOIO_DATA_BYTES (ExitInfo1));
971 Status =
CcExitVmgExit (Ghcb, SVM_EXIT_IOIO_PROT, ExitInfo1, 0);
976 if ((ExitInfo1 & IOIO_TYPE_IN) != 0) {
981 CopyMem (&Regs->Rax, &Ghcb->SaveArea.Rax, IOIO_DATA_BYTES (ExitInfo1));
1049 IN OUT UINT64 *Status,
1054 Ghcb->SaveArea.Rax = EaxIn;
1056 Ghcb->SaveArea.Rcx = EcxIn;
1059 Ghcb->SaveArea.XCr0 = XCr0;
1078 *Eax = (UINT32)(
UINTN)Ghcb->SaveArea.Rax;
1082 *Ebx = (UINT32)(
UINTN)Ghcb->SaveArea.Rbx;
1086 *Ecx = (UINT32)(
UINTN)Ghcb->SaveArea.Rcx;
1090 *Edx = (UINT32)(
UINTN)Ghcb->SaveArea.Rdx;
1113 return !!Msr.Bits.SevSnpBit;
1134 IN UINT64 XFeaturesEnabled,
1135 IN OUT UINT32 *XSaveSize,
1136 IN BOOLEAN Compacted
1139 SEV_SNP_CPUID_INFO *CpuidInfo;
1140 UINT64 XFeaturesFound = 0;
1147 CpuidInfo = (SEV_SNP_CPUID_INFO *)(UINT64)
PcdGet32 (PcdOvmfCpuidBase);
1149 for (Idx = 0; Idx < CpuidInfo->Count; Idx++) {
1150 SEV_SNP_CPUID_FUNCTION *CpuidFn = &CpuidInfo->function[Idx];
1152 if (!((CpuidFn->EaxIn == 0xD) && (CpuidFn->EcxIn > 1))) {
1156 if (XFeaturesFound & (1ULL << CpuidFn->EcxIn) ||
1157 !(XFeaturesEnabled & (1ULL << CpuidFn->EcxIn)))
1162 XFeaturesFound |= (1ULL << CpuidFn->EcxIn);
1164 *XSaveSize += CpuidFn->Eax;
1166 *XSaveSize =
MAX (*XSaveSize, CpuidFn->Eax + CpuidFn->Ebx);
1174 if (XFeaturesFound != (XFeaturesEnabled & ~3UL)) {
1250 IN OUT UINT64 *Status,
1251 IN OUT BOOLEAN *Unsupported
1254 SEV_SNP_CPUID_INFO *CpuidInfo;
1258 CpuidInfo = (SEV_SNP_CPUID_INFO *)(UINT64)
PcdGet32 (PcdOvmfCpuidBase);
1261 for (Idx = 0; Idx < CpuidInfo->Count; Idx++) {
1262 SEV_SNP_CPUID_FUNCTION *CpuidFn = &CpuidInfo->function[Idx];
1264 if (CpuidFn->EaxIn != EaxIn) {
1272 *Eax = CpuidFn->Eax;
1273 *Ebx = CpuidFn->Ebx;
1274 *Ecx = CpuidFn->Ecx;
1275 *Edx = CpuidFn->Edx;
1282 *Eax = *Ebx = *Ecx = *Edx = 0;
1308 *Ebx = (*Ebx & 0x00FFFFFF) | (Ebx2 & 0xFF000000);
1310 *Edx = (*Edx & ~BIT9) | (Edx2 & BIT9);
1313 *Ecx = (Cr4.Bits.OSXSAVE) ? (*Ecx & ~BIT27) | (*Ecx & BIT27)
1320 *Ecx = (Cr4.Bits.PKE) ? (*Ecx | BIT4) : (*Ecx & ~BIT4);
1351 if (!(*Eax & (BIT3 | BIT1))) {
1370 }
else if (EaxIn == 0x8000001E) {
1392 *Ebx = (*Ebx & 0xFFFFFF00) | (Ebx2 & 0x000000FF);
1394 *Ecx = (*Ecx & 0xFFFFFF00) | (Ecx2 & 0x000000FF);
1395 }
else if (EaxIn == 0x8000001F) {
1404 *Unsupported =
FALSE;
1430 BOOLEAN Unsupported;
1440 EaxIn = (UINT32)(
UINTN)Regs->Rax;
1441 EcxIn = (UINT32)(
UINTN)Regs->Rcx;
1447 Ghcb->SaveArea.XCr0 = (Cr4.Bits.OSXSAVE == 1) ? AsmXGetBv (0) : 1;
1448 XCr0 = (Cr4.Bits.OSXSAVE == 1) ? AsmXGetBv (0) : 1;
1524 Ghcb->SaveArea.Rcx = Regs->Rcx;
1538 Regs->Rax = Ghcb->SaveArea.Rax;
1539 Regs->Rdx = Ghcb->SaveArea.Rdx;
1579 Regs->Rax = Ghcb->SaveArea.Rax;
1580 Regs->Rdx = Ghcb->SaveArea.Rdx;
1616 Ext = &InstructionData->Ext;
1636 SevEsData->Dr7Cached = 1;
1670 Ext = &InstructionData->Ext;
1682 *
Register = (SevEsData->Dr7Cached == 1) ? SevEsData->Dr7 : 0x400;
1723 OpCode = *(InstructionData->OpCodes);
1724 if (OpCode == TWO_BYTE_OPCODE_ESCAPE) {
1725 OpCode = *(InstructionData->OpCodes + 1);
1729 case SVM_EXIT_IOIO_PROT:
1734 case SVM_EXIT_CPUID:
1735 if (OpCode == 0xa2) {
1742 if (OpCode == 0x08) {
1748 case SVM_EXIT_MONITOR:
1751 if ((OpCode == 0x01) &&
1752 ( (InstructionData->ModRm.Uint8 == 0xc8)
1753 || (InstructionData->ModRm.Uint8 == 0xfa)))
1760 case SVM_EXIT_MWAIT:
1763 if ((OpCode == 0x01) &&
1764 ( (InstructionData->ModRm.Uint8 == 0xc9)
1765 || (InstructionData->ModRm.Uint8 == 0xfb)))
1774 if ((OpCode == 0x32) ||
1783 case SVM_EXIT_RDPMC:
1784 if (OpCode == 0x33) {
1790 case SVM_EXIT_RDTSC:
1791 if (OpCode == 0x31) {
1797 case SVM_EXIT_RDTSCP:
1800 if ((OpCode == 0x01) && (InstructionData->ModRm.Uint8 == 0xf9)) {
1806 case SVM_EXIT_DR7_READ:
1809 if ((OpCode == 0x21) &&
1810 (InstructionData->Ext.ModRm.Reg == 7))
1817 case SVM_EXIT_VMMCALL:
1820 if ((OpCode == 0x01) && (InstructionData->ModRm.Uint8 == 0xd9)) {
1826 case SVM_EXIT_DR7_WRITE:
1829 if ((OpCode == 0x23) &&
1830 (InstructionData->Ext.ModRm.Reg == 7))
1837 case SVM_EXIT_WBINVD:
1838 if (OpCode == 0x9) {
1879 UINT64 ExitCode, Status;
1881 BOOLEAN InterruptState;
1885 Regs = SystemContext.SystemContextX64;
1889 ExitCode = Regs->ExceptionData;
1891 case SVM_EXIT_DR7_READ:
1895 case SVM_EXIT_DR7_WRITE:
1899 case SVM_EXIT_RDTSC:
1903 case SVM_EXIT_RDPMC:
1907 case SVM_EXIT_CPUID:
1915 case SVM_EXIT_IOIO_PROT:
1923 case SVM_EXIT_VMMCALL:
1927 case SVM_EXIT_RDTSCP:
1931 case SVM_EXIT_WBINVD:
1935 case SVM_EXIT_MONITOR:
1939 case SVM_EXIT_MWAIT:
1959 Status = NaeExit (Ghcb, Regs, &InstructionData);
1967 Event.Uint64 = Status;
1968 if (Event.Elements.ErrorCodeValid != 0) {
1969 Regs->ExceptionData = Event.Elements.ErrorCode;
1971 Regs->ExceptionData = 0;
1974 *ExceptionType = Event.Elements.Vector;
1976 VcRet = EFI_PROTOCOL_ERROR;
2000 SevEsData->VcCount = 0;
BOOLEAN EFIAPI AmdSvsmIsSvsmPresent(VOID)
UINT64 EFIAPI AmdSvsmSnpGetCaa(VOID)
VOID EFIAPI CpuDeadLoop(VOID)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
UINT64 EFIAPI CcExitVmgExit(IN OUT GHCB *Ghcb, IN UINT64 ExitCode, IN UINT64 ExitInfo1, IN UINT64 ExitInfo2)
BOOLEAN EFIAPI CcExitVmgIsOffsetValid(IN GHCB *Ghcb, IN GHCB_REGISTER Offset)
VOID EFIAPI CcExitVmgSetOffsetValid(IN OUT GHCB *Ghcb, IN GHCB_REGISTER Offset)
VOID EFIAPI CcExitVmgInit(IN OUT GHCB *Ghcb, IN OUT BOOLEAN *InterruptState)
VOID EFIAPI CcExitVmgDone(IN OUT GHCB *Ghcb, IN BOOLEAN InterruptState)
STATIC UINT64 ValidateMmioMemory(IN GHCB *Ghcb, IN UINTN MemoryAddress, IN UINTN MemoryLength)
STATIC UINT64 MmioExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN OUT CC_INSTRUCTION_DATA *InstructionData)
STATIC BOOLEAN SnpEnabled(VOID)
STATIC UINT64 VmmCallExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
STATIC BOOLEAN GetCpuidXSaveSize(IN UINT64 XFeaturesEnabled, IN OUT UINT32 *XSaveSize, IN BOOLEAN Compacted)
STATIC UINT64 Dr7ReadExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
STATIC UINT64 InvdExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
STATIC UINT64 Dr7WriteExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
STATIC BOOLEAN GetCpuidHyp(IN OUT GHCB *Ghcb, IN UINT32 EaxIn, IN UINT32 EcxIn, IN UINT64 XCr0, IN OUT UINT32 *Eax, IN OUT UINT32 *Ebx, IN OUT UINT32 *Ecx, IN OUT UINT32 *Edx, IN OUT UINT64 *Status, IN OUT BOOLEAN *UnsupportedExit)
STATIC UINT64 IoioExitInfo(IN EFI_SYSTEM_CONTEXT_X64 *Regs, IN OUT CC_INSTRUCTION_DATA *InstructionData)
EFI_STATUS EFIAPI InternalVmgExitHandleVc(IN OUT GHCB *Ghcb, IN OUT EFI_EXCEPTION_TYPE *ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
STATIC UINT64 VcCheckOpcodeBytes(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN OUT CC_INSTRUCTION_DATA *InstructionData, IN UINT64 ExitCode)
STATIC UINT64 IoioExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
STATIC UINT64 RdtscExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
STATIC UINT64 MwaitExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
STATIC UINT64 RdtscpExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
VOID EFIAPI VmgExitIssueAssert(IN OUT SEV_ES_PER_CPU_DATA *SevEsData)
STATIC UINT64 WbinvdExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
STATIC UINT64 MonitorExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
STATIC UINT64 UnsupportedExit(IN GHCB *Ghcb, IN EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
STATIC BOOLEAN IsFunctionIndexed(IN UINT32 EaxIn)
STATIC BOOLEAN GetCpuidFw(IN OUT GHCB *Ghcb, IN UINT32 EaxIn, IN UINT32 EcxIn, IN UINT64 XCr0, IN OUT UINT32 *Eax, IN OUT UINT32 *Ebx, IN OUT UINT32 *Ecx, IN OUT UINT32 *Edx, IN OUT UINT64 *Status, IN OUT BOOLEAN *Unsupported)
STATIC UINT64 RdpmcExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
STATIC UINT64 CpuidExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
STATIC UINT64 MsrExit(IN OUT GHCB *Ghcb, IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, IN CC_INSTRUCTION_DATA *InstructionData)
UINT64 * CcGetRegisterPointer(IN EFI_SYSTEM_CONTEXT_X64 *Regs, IN UINT8 Register)
VOID CcDecodeModRm(IN EFI_SYSTEM_CONTEXT_X64 *Regs, IN OUT CC_INSTRUCTION_DATA *InstructionData)
EFI_STATUS CcInitInstructionData(IN OUT CC_INSTRUCTION_DATA *InstructionData, IN GHCB *Ghcb, IN EFI_SYSTEM_CONTEXT_X64 *Regs)
UINT64 CcInstructionLength(IN CC_INSTRUCTION_DATA *InstructionData)
UINT64 EFIAPI AsmReadMsr64(IN UINT32 Index)
UINTN EFIAPI AsmReadCr4(VOID)
#define DEBUG(Expression)
#define CPUID_INTEL_PROCESSOR_TRACE
#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS
#define CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS
#define CPUID_CACHE_PARAMS
#define CPUID_INTEL_RDT_MONITORING
#define CPUID_VERSION_INFO
#define CPUID_EXTENDED_STATE
#define CPUID_EXTENDED_TOPOLOGY
#define CPUID_V2_EXTENDED_TOPOLOGY
#define CPUID_INTEL_RDT_ALLOCATION
BOOLEAN EFIAPI MemEncryptSevEsDebugVirtualizationIsEnabled(VOID)
MEM_ENCRYPT_SEV_ADDRESS_RANGE_STATE EFIAPI MemEncryptSevGetAddressRangeState(IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, IN UINTN Length)
#define PcdGet32(TokenName)
EFI_STATUS EFIAPI Register(IN EFI_PEI_RSC_HANDLER_CALLBACK Callback)
UINT32 EFIAPI AsmReadMsr32(IN UINT32 Index)