]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/UefiCpuPkg: Add CcExit prefix to the APIs of CcExitLib
authorMin M Xu <min.m.xu@intel.com>
Mon, 7 Nov 2022 07:50:11 +0000 (15:50 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 14 Nov 2022 04:55:34 +0000 (04:55 +0000)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4123

APIs which are defined in CcExitLib.h are added with the CcExit prefix.
This is to make the APIs' name more meaningful.

This change impacts OvmfPkg/UefiCpuPkg.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
15 files changed:
OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c
OvmfPkg/Library/CcExitLib/CcExitLib.c
OvmfPkg/Library/CcExitLib/CcExitVcHandler.c
OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
OvmfPkg/Library/CcExitLib/PeiDxeCcExitVcHandler.c
OvmfPkg/Library/CcExitLib/SecCcExitVcHandler.c
OvmfPkg/PlatformPei/AmdSev.c
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c
UefiCpuPkg/Include/Library/CcExitLib.h
UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.c
UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c
UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c
UefiCpuPkg/Library/MpInitLib/AmdSev.c
UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c

index 73698a7b9d8c0228e8f35efb1adfa0274d10a39e..4d684964d8382ea40876d7a323125397676c5a92 100644 (file)
@@ -193,9 +193,9 @@ PageStateChangeVmgExit (
   //\r
   while (Info->Header.CurrentEntry <= Info->Header.EndEntry) {\r
     Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;\r
-    VmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
+    CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
 \r
-    Status = VmgExit (Ghcb, SVM_EXIT_SNP_PAGE_STATE_CHANGE, 0, 0);\r
+    Status = CcExitVmgExit (Ghcb, SVM_EXIT_SNP_PAGE_STATE_CHANGE, 0, 0);\r
 \r
     //\r
     // The Page State Change VMGEXIT can pass the failure through the\r
@@ -251,7 +251,7 @@ InternalSetPageState (
     //\r
     // Initialize the GHCB\r
     //\r
-    VmgInit (Ghcb, &InterruptState);\r
+    CcExitVmgInit (Ghcb, &InterruptState);\r
 \r
     //\r
     // Build the page state structure\r
@@ -293,7 +293,7 @@ InternalSetPageState (
       PvalidateRange (Info, CurrentEntry, EndEntry, TRUE);\r
     }\r
 \r
-    VmgDone (Ghcb, InterruptState);\r
+    CcExitVmgDone (Ghcb, InterruptState);\r
 \r
     BaseAddress = NextAddress;\r
   }\r
index 477064cde2bb20f30230d0fb906b9a834dcae55c..e256000fb2836806cdbf9e17a78172ce3a73a987 100644 (file)
@@ -103,7 +103,7 @@ VmgExitErrorCheck (
 **/\r
 UINT64\r
 EFIAPI\r
-VmgExit (\r
+CcExitVmgExit (\r
   IN OUT GHCB    *Ghcb,\r
   IN     UINT64  ExitCode,\r
   IN     UINT64  ExitInfo1,\r
@@ -114,9 +114,9 @@ VmgExit (
   Ghcb->SaveArea.SwExitInfo1 = ExitInfo1;\r
   Ghcb->SaveArea.SwExitInfo2 = ExitInfo2;\r
 \r
-  VmgSetOffsetValid (Ghcb, GhcbSwExitCode);\r
-  VmgSetOffsetValid (Ghcb, GhcbSwExitInfo1);\r
-  VmgSetOffsetValid (Ghcb, GhcbSwExitInfo2);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbSwExitCode);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbSwExitInfo1);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbSwExitInfo2);\r
 \r
   //\r
   // Guest memory is used for the guest-hypervisor communication, so fence\r
@@ -138,12 +138,12 @@ VmgExit (
 \r
   @param[in, out]  Ghcb            A pointer to the GHCB\r
   @param[in, out]  InterruptState  A pointer to hold the current interrupt\r
-                                   state, used for restoring in VmgDone ()\r
+                                   state, used for restoring in CcExitVmgDone ()\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
-VmgInit (\r
+CcExitVmgInit (\r
   IN OUT GHCB     *Ghcb,\r
   IN OUT BOOLEAN  *InterruptState\r
   )\r
@@ -173,7 +173,7 @@ VmgInit (
 **/\r
 VOID\r
 EFIAPI\r
-VmgDone (\r
+CcExitVmgDone (\r
   IN OUT GHCB     *Ghcb,\r
   IN     BOOLEAN  InterruptState\r
   )\r
@@ -195,7 +195,7 @@ VmgDone (
 **/\r
 VOID\r
 EFIAPI\r
-VmgSetOffsetValid (\r
+CcExitVmgSetOffsetValid (\r
   IN OUT GHCB           *Ghcb,\r
   IN     GHCB_REGISTER  Offset\r
   )\r
@@ -224,7 +224,7 @@ VmgSetOffsetValid (
 **/\r
 BOOLEAN\r
 EFIAPI\r
-VmgIsOffsetValid (\r
+CcExitVmgIsOffsetValid (\r
   IN GHCB           *Ghcb,\r
   IN GHCB_REGISTER  Offset\r
   )\r
index ad2a922c9f43b3548fef327bf832093cc8f8ad02..985e5479775ca5bc149d398ec99ff76ea9afbf8d 100644 (file)
@@ -611,7 +611,7 @@ UnsupportedExit (
 {\r
   UINT64  Status;\r
 \r
-  Status = VmgExit (Ghcb, SVM_EXIT_UNSUPPORTED, Regs->ExceptionData, 0);\r
+  Status = CcExitVmgExit (Ghcb, SVM_EXIT_UNSUPPORTED, Regs->ExceptionData, 0);\r
   if (Status == 0) {\r
     GHCB_EVENT_INJECTION  Event;\r
 \r
@@ -755,8 +755,8 @@ MmioExit (
       CopyMem (Ghcb->SharedBuffer, &InstructionData->Ext.RegData, Bytes);\r
 \r
       Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;\r
-      VmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
-      Status = VmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, ExitInfo2);\r
+      CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
+      Status = CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, ExitInfo2);\r
       if (Status != 0) {\r
         return Status;\r
       }\r
@@ -807,8 +807,8 @@ MmioExit (
       CopyMem (Ghcb->SharedBuffer, &Regs->Rax, Bytes);\r
 \r
       Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;\r
-      VmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
-      Status = VmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, ExitInfo2);\r
+      CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
+      Status = CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, ExitInfo2);\r
       if (Status != 0) {\r
         return Status;\r
       }\r
@@ -843,8 +843,8 @@ MmioExit (
       CopyMem (Ghcb->SharedBuffer, InstructionData->Immediate, Bytes);\r
 \r
       Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;\r
-      VmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
-      Status = VmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, ExitInfo2);\r
+      CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
+      Status = CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, ExitInfo2);\r
       if (Status != 0) {\r
         return Status;\r
       }\r
@@ -882,8 +882,8 @@ MmioExit (
       ExitInfo2 = Bytes;\r
 \r
       Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;\r
-      VmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
-      Status = VmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2);\r
+      CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
+      Status = CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2);\r
       if (Status != 0) {\r
         return Status;\r
       }\r
@@ -942,8 +942,8 @@ MmioExit (
       ExitInfo2 = Bytes;\r
 \r
       Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;\r
-      VmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
-      Status = VmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2);\r
+      CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
+      Status = CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2);\r
       if (Status != 0) {\r
         return Status;\r
       }\r
@@ -979,8 +979,8 @@ MmioExit (
       ExitInfo2 = Bytes;\r
 \r
       Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;\r
-      VmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
-      Status = VmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2);\r
+      CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
+      Status = CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2);\r
       if (Status != 0) {\r
         return Status;\r
       }\r
@@ -1011,8 +1011,8 @@ MmioExit (
       ExitInfo2 = Bytes;\r
 \r
       Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;\r
-      VmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
-      Status = VmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2);\r
+      CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
+      Status = CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2);\r
       if (Status != 0) {\r
         return Status;\r
       }\r
@@ -1068,11 +1068,11 @@ MwaitExit (
   DecodeModRm (Regs, InstructionData);\r
 \r
   Ghcb->SaveArea.Rax = Regs->Rax;\r
-  VmgSetOffsetValid (Ghcb, GhcbRax);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbRax);\r
   Ghcb->SaveArea.Rcx = Regs->Rcx;\r
-  VmgSetOffsetValid (Ghcb, GhcbRcx);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbRcx);\r
 \r
-  return VmgExit (Ghcb, SVM_EXIT_MWAIT, 0, 0);\r
+  return CcExitVmgExit (Ghcb, SVM_EXIT_MWAIT, 0, 0);\r
 }\r
 \r
 /**\r
@@ -1100,13 +1100,13 @@ MonitorExit (
   DecodeModRm (Regs, InstructionData);\r
 \r
   Ghcb->SaveArea.Rax = Regs->Rax;  // Identity mapped, so VA = PA\r
-  VmgSetOffsetValid (Ghcb, GhcbRax);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbRax);\r
   Ghcb->SaveArea.Rcx = Regs->Rcx;\r
-  VmgSetOffsetValid (Ghcb, GhcbRcx);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbRcx);\r
   Ghcb->SaveArea.Rdx = Regs->Rdx;\r
-  VmgSetOffsetValid (Ghcb, GhcbRdx);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbRdx);\r
 \r
-  return VmgExit (Ghcb, SVM_EXIT_MONITOR, 0, 0);\r
+  return CcExitVmgExit (Ghcb, SVM_EXIT_MONITOR, 0, 0);\r
 }\r
 \r
 /**\r
@@ -1131,7 +1131,7 @@ WbinvdExit (
   IN     SEV_ES_INSTRUCTION_DATA  *InstructionData\r
   )\r
 {\r
-  return VmgExit (Ghcb, SVM_EXIT_WBINVD, 0, 0);\r
+  return CcExitVmgExit (Ghcb, SVM_EXIT_WBINVD, 0, 0);\r
 }\r
 \r
 /**\r
@@ -1160,14 +1160,14 @@ RdtscpExit (
 \r
   DecodeModRm (Regs, InstructionData);\r
 \r
-  Status = VmgExit (Ghcb, SVM_EXIT_RDTSCP, 0, 0);\r
+  Status = CcExitVmgExit (Ghcb, SVM_EXIT_RDTSCP, 0, 0);\r
   if (Status != 0) {\r
     return Status;\r
   }\r
 \r
-  if (!VmgIsOffsetValid (Ghcb, GhcbRax) ||\r
-      !VmgIsOffsetValid (Ghcb, GhcbRcx) ||\r
-      !VmgIsOffsetValid (Ghcb, GhcbRdx))\r
+  if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax) ||\r
+      !CcExitVmgIsOffsetValid (Ghcb, GhcbRcx) ||\r
+      !CcExitVmgIsOffsetValid (Ghcb, GhcbRdx))\r
   {\r
     return UnsupportedExit (Ghcb, Regs, InstructionData);\r
   }\r
@@ -1206,16 +1206,16 @@ VmmCallExit (
   DecodeModRm (Regs, InstructionData);\r
 \r
   Ghcb->SaveArea.Rax = Regs->Rax;\r
-  VmgSetOffsetValid (Ghcb, GhcbRax);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbRax);\r
   Ghcb->SaveArea.Cpl = (UINT8)(Regs->Cs & 0x3);\r
-  VmgSetOffsetValid (Ghcb, GhcbCpl);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbCpl);\r
 \r
-  Status = VmgExit (Ghcb, SVM_EXIT_VMMCALL, 0, 0);\r
+  Status = CcExitVmgExit (Ghcb, SVM_EXIT_VMMCALL, 0, 0);\r
   if (Status != 0) {\r
     return Status;\r
   }\r
 \r
-  if (!VmgIsOffsetValid (Ghcb, GhcbRax)) {\r
+  if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax)) {\r
     return UnsupportedExit (Ghcb, Regs, InstructionData);\r
   }\r
 \r
@@ -1254,28 +1254,28 @@ MsrExit (
     case 0x30: // WRMSR\r
       ExitInfo1          = 1;\r
       Ghcb->SaveArea.Rax = Regs->Rax;\r
-      VmgSetOffsetValid (Ghcb, GhcbRax);\r
+      CcExitVmgSetOffsetValid (Ghcb, GhcbRax);\r
       Ghcb->SaveArea.Rdx = Regs->Rdx;\r
-      VmgSetOffsetValid (Ghcb, GhcbRdx);\r
+      CcExitVmgSetOffsetValid (Ghcb, GhcbRdx);\r
     //\r
     // fall through\r
     //\r
     case 0x32: // RDMSR\r
       Ghcb->SaveArea.Rcx = Regs->Rcx;\r
-      VmgSetOffsetValid (Ghcb, GhcbRcx);\r
+      CcExitVmgSetOffsetValid (Ghcb, GhcbRcx);\r
       break;\r
     default:\r
       return UnsupportedExit (Ghcb, Regs, InstructionData);\r
   }\r
 \r
-  Status = VmgExit (Ghcb, SVM_EXIT_MSR, ExitInfo1, 0);\r
+  Status = CcExitVmgExit (Ghcb, SVM_EXIT_MSR, ExitInfo1, 0);\r
   if (Status != 0) {\r
     return Status;\r
   }\r
 \r
   if (ExitInfo1 == 0) {\r
-    if (!VmgIsOffsetValid (Ghcb, GhcbRax) ||\r
-        !VmgIsOffsetValid (Ghcb, GhcbRdx))\r
+    if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax) ||\r
+        !CcExitVmgIsOffsetValid (Ghcb, GhcbRdx))\r
     {\r
       return UnsupportedExit (Ghcb, Regs, InstructionData);\r
     }\r
@@ -1471,8 +1471,8 @@ IoioExit (
       }\r
 \r
       Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;\r
-      VmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
-      Status = VmgExit (Ghcb, SVM_EXIT_IOIO_PROT, ExitInfo1, ExitInfo2);\r
+      CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
+      Status = CcExitVmgExit (Ghcb, SVM_EXIT_IOIO_PROT, ExitInfo1, ExitInfo2);\r
       if (Status != 0) {\r
         return Status;\r
       }\r
@@ -1495,15 +1495,15 @@ IoioExit (
       CopyMem (&Ghcb->SaveArea.Rax, &Regs->Rax, IOIO_DATA_BYTES (ExitInfo1));\r
     }\r
 \r
-    VmgSetOffsetValid (Ghcb, GhcbRax);\r
+    CcExitVmgSetOffsetValid (Ghcb, GhcbRax);\r
 \r
-    Status = VmgExit (Ghcb, SVM_EXIT_IOIO_PROT, ExitInfo1, 0);\r
+    Status = CcExitVmgExit (Ghcb, SVM_EXIT_IOIO_PROT, ExitInfo1, 0);\r
     if (Status != 0) {\r
       return Status;\r
     }\r
 \r
     if ((ExitInfo1 & IOIO_TYPE_IN) != 0) {\r
-      if (!VmgIsOffsetValid (Ghcb, GhcbRax)) {\r
+      if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax)) {\r
         return UnsupportedExit (Ghcb, Regs, InstructionData);\r
       }\r
 \r
@@ -1536,7 +1536,7 @@ InvdExit (
   IN     SEV_ES_INSTRUCTION_DATA  *InstructionData\r
   )\r
 {\r
-  return VmgExit (Ghcb, SVM_EXIT_INVD, 0, 0);\r
+  return CcExitVmgExit (Ghcb, SVM_EXIT_INVD, 0, 0);\r
 }\r
 \r
 /**\r
@@ -1581,23 +1581,23 @@ GetCpuidHyp (
 {\r
   *UnsupportedExit   = FALSE;\r
   Ghcb->SaveArea.Rax = EaxIn;\r
-  VmgSetOffsetValid (Ghcb, GhcbRax);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbRax);\r
   Ghcb->SaveArea.Rcx = EcxIn;\r
-  VmgSetOffsetValid (Ghcb, GhcbRcx);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbRcx);\r
   if (EaxIn == CPUID_EXTENDED_STATE) {\r
     Ghcb->SaveArea.XCr0 = XCr0;\r
-    VmgSetOffsetValid (Ghcb, GhcbXCr0);\r
+    CcExitVmgSetOffsetValid (Ghcb, GhcbXCr0);\r
   }\r
 \r
-  *Status = VmgExit (Ghcb, SVM_EXIT_CPUID, 0, 0);\r
+  *Status = CcExitVmgExit (Ghcb, SVM_EXIT_CPUID, 0, 0);\r
   if (*Status != 0) {\r
     return FALSE;\r
   }\r
 \r
-  if (!VmgIsOffsetValid (Ghcb, GhcbRax) ||\r
-      !VmgIsOffsetValid (Ghcb, GhcbRbx) ||\r
-      !VmgIsOffsetValid (Ghcb, GhcbRcx) ||\r
-      !VmgIsOffsetValid (Ghcb, GhcbRdx))\r
+  if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax) ||\r
+      !CcExitVmgIsOffsetValid (Ghcb, GhcbRbx) ||\r
+      !CcExitVmgIsOffsetValid (Ghcb, GhcbRcx) ||\r
+      !CcExitVmgIsOffsetValid (Ghcb, GhcbRdx))\r
   {\r
     *UnsupportedExit = TRUE;\r
     return FALSE;\r
@@ -2049,15 +2049,15 @@ RdpmcExit (
   UINT64  Status;\r
 \r
   Ghcb->SaveArea.Rcx = Regs->Rcx;\r
-  VmgSetOffsetValid (Ghcb, GhcbRcx);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbRcx);\r
 \r
-  Status = VmgExit (Ghcb, SVM_EXIT_RDPMC, 0, 0);\r
+  Status = CcExitVmgExit (Ghcb, SVM_EXIT_RDPMC, 0, 0);\r
   if (Status != 0) {\r
     return Status;\r
   }\r
 \r
-  if (!VmgIsOffsetValid (Ghcb, GhcbRax) ||\r
-      !VmgIsOffsetValid (Ghcb, GhcbRdx))\r
+  if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax) ||\r
+      !CcExitVmgIsOffsetValid (Ghcb, GhcbRdx))\r
   {\r
     return UnsupportedExit (Ghcb, Regs, InstructionData);\r
   }\r
@@ -2092,13 +2092,13 @@ RdtscExit (
 {\r
   UINT64  Status;\r
 \r
-  Status = VmgExit (Ghcb, SVM_EXIT_RDTSC, 0, 0);\r
+  Status = CcExitVmgExit (Ghcb, SVM_EXIT_RDTSC, 0, 0);\r
   if (Status != 0) {\r
     return Status;\r
   }\r
 \r
-  if (!VmgIsOffsetValid (Ghcb, GhcbRax) ||\r
-      !VmgIsOffsetValid (Ghcb, GhcbRdx))\r
+  if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax) ||\r
+      !CcExitVmgIsOffsetValid (Ghcb, GhcbRdx))\r
   {\r
     return UnsupportedExit (Ghcb, Regs, InstructionData);\r
   }\r
@@ -2150,9 +2150,9 @@ Dr7WriteExit (
   // Using a value of 0 for ExitInfo1 means RAX holds the value\r
   //\r
   Ghcb->SaveArea.Rax = *Register;\r
-  VmgSetOffsetValid (Ghcb, GhcbRax);\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbRax);\r
 \r
-  Status = VmgExit (Ghcb, SVM_EXIT_DR7_WRITE, 0, 0);\r
+  Status = CcExitVmgExit (Ghcb, SVM_EXIT_DR7_WRITE, 0, 0);\r
   if (Status != 0) {\r
     return Status;\r
   }\r
@@ -2243,7 +2243,7 @@ InternalVmgExitHandleVc (
 \r
   Regs = SystemContext.SystemContextX64;\r
 \r
-  VmgInit (Ghcb, &InterruptState);\r
+  CcExitVmgInit (Ghcb, &InterruptState);\r
 \r
   ExitCode = Regs->ExceptionData;\r
   switch (ExitCode) {\r
@@ -2327,7 +2327,7 @@ InternalVmgExitHandleVc (
     VcRet = EFI_PROTOCOL_ERROR;\r
   }\r
 \r
-  VmgDone (Ghcb, InterruptState);\r
+  CcExitVmgDone (Ghcb, InterruptState);\r
 \r
   return VcRet;\r
 }\r
index 08e92c66ce744e23358c52ed9d95c1cd0bdfc6a6..081af7e12aa58bbb13c052c966649cf9368cf0a2 100644 (file)
@@ -464,7 +464,7 @@ MmioExit (
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-VmTdExitHandleVe (\r
+CcExitHandleVe (\r
   IN OUT EFI_EXCEPTION_TYPE  *ExceptionType,\r
   IN OUT EFI_SYSTEM_CONTEXT  SystemContext\r
   )\r
index bb718161f58895fa393b06ad0bf6d45d92fd8cc8..522f747f08c19ae4fa611bbd6d0915465b2f6977 100644 (file)
@@ -33,7 +33,7 @@
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-VmgExitHandleVc (\r
+CcExitHandleVc (\r
   IN OUT EFI_EXCEPTION_TYPE  *ExceptionType,\r
   IN OUT EFI_SYSTEM_CONTEXT  SystemContext\r
   )\r
index 769e0b5b7417897586058c7e44c6bbec2dd4cd5c..da70581af8d890ff9c720f9814680cfccb4325d2 100644 (file)
@@ -33,7 +33,7 @@
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-VmgExitHandleVc (\r
+CcExitHandleVc (\r
   IN OUT EFI_EXCEPTION_TYPE  *ExceptionType,\r
   IN OUT EFI_SYSTEM_CONTEXT  SystemContext\r
   )\r
index 80a1194ffcb9d7d9c8fc9fd692c4016a527ed183..e1b9fd9b7f689532c1c0a63c40f3f52981ce3c19 100644 (file)
@@ -50,7 +50,7 @@ AmdSevSnpInitialize (
   }\r
 \r
   //\r
-  // Query the hypervisor feature using the VmgExit and set the value in the\r
+  // Query the hypervisor feature using the CcExitVmgExit and set the value in the\r
   // hypervisor features PCD.\r
   //\r
   HvFeatures = GetHypervisorFeature ();\r
@@ -129,19 +129,19 @@ GetHypervisorFeature (
   //\r
   // Initialize the GHCB\r
   //\r
-  VmgInit (Ghcb, &InterruptState);\r
+  CcExitVmgInit (Ghcb, &InterruptState);\r
 \r
   //\r
   // Query the Hypervisor Features.\r
   //\r
-  Status = VmgExit (Ghcb, SVM_EXIT_HYPERVISOR_FEATURES, 0, 0);\r
+  Status = CcExitVmgExit (Ghcb, SVM_EXIT_HYPERVISOR_FEATURES, 0, 0);\r
   if ((Status != 0)) {\r
     SevEsProtocolFailure (GHCB_TERMINATE_GHCB_GENERAL);\r
   }\r
 \r
   Features = Ghcb->SaveArea.SwExitInfo2;\r
 \r
-  VmgDone (Ghcb, InterruptState);\r
+  CcExitVmgDone (Ghcb, InterruptState);\r
 \r
   return Features;\r
 }\r
index 58bcad825d57574c22ffb52ab577ecd4e6eb735a..d57f7ca25ccf31b634de8e171ea5ca89e008ecbd 100644 (file)
@@ -82,12 +82,12 @@ QemuFlashPtrWrite (
     // #VC exception. Instead, use the VMGEXIT MMIO write support directly\r
     // to perform the update.\r
     //\r
-    VmgInit (Ghcb, &InterruptState);\r
+    CcExitVmgInit (Ghcb, &InterruptState);\r
     Ghcb->SharedBuffer[0]    = Value;\r
     Ghcb->SaveArea.SwScratch = (UINT64)(UINTN)Ghcb->SharedBuffer;\r
-    VmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
-    VmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, PhysAddr, 1);\r
-    VmgDone (Ghcb, InterruptState);\r
+    CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch);\r
+    CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, PhysAddr, 1);\r
+    CcExitVmgDone (Ghcb, InterruptState);\r
   } else {\r
     *Ptr = Value;\r
   }\r
index 1ae618c19b9e6af48a7a7639b5a817affa6ffce1..3381d583691feedb3a58b0f37e5d9e7492b4515b 100644 (file)
@@ -41,7 +41,7 @@
 **/\r
 UINT64\r
 EFIAPI\r
-VmgExit (\r
+CcExitVmgExit (\r
   IN OUT GHCB    *Ghcb,\r
   IN     UINT64  ExitCode,\r
   IN     UINT64  ExitInfo1,\r
@@ -56,12 +56,12 @@ VmgExit (
 \r
   @param[in, out]  Ghcb            A pointer to the GHCB\r
   @param[in, out]  InterruptState  A pointer to hold the current interrupt\r
-                                   state, used for restoring in VmgDone ()\r
+                                   state, used for restoring in CcExitVmgDone ()\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
-VmgInit (\r
+CcExitVmgInit (\r
   IN OUT GHCB     *Ghcb,\r
   IN OUT BOOLEAN  *InterruptState\r
   );\r
@@ -79,7 +79,7 @@ VmgInit (
 **/\r
 VOID\r
 EFIAPI\r
-VmgDone (\r
+CcExitVmgDone (\r
   IN OUT GHCB     *Ghcb,\r
   IN     BOOLEAN  InterruptState\r
   );\r
@@ -96,7 +96,7 @@ VmgDone (
 **/\r
 VOID\r
 EFIAPI\r
-VmgSetOffsetValid (\r
+CcExitVmgSetOffsetValid (\r
   IN OUT GHCB           *Ghcb,\r
   IN     GHCB_REGISTER  Offset\r
   );\r
@@ -116,7 +116,7 @@ VmgSetOffsetValid (
 **/\r
 BOOLEAN\r
 EFIAPI\r
-VmgIsOffsetValid (\r
+CcExitVmgIsOffsetValid (\r
   IN GHCB           *Ghcb,\r
   IN GHCB_REGISTER  Offset\r
   );\r
@@ -142,7 +142,7 @@ VmgIsOffsetValid (
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-VmgExitHandleVc (\r
+CcExitHandleVc (\r
   IN OUT EFI_EXCEPTION_TYPE  *ExceptionType,\r
   IN OUT EFI_SYSTEM_CONTEXT  SystemContext\r
   );\r
@@ -168,7 +168,7 @@ VmgExitHandleVc (
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-VmTdExitHandleVe (\r
+CcExitHandleVe (\r
   IN OUT EFI_EXCEPTION_TYPE  *ExceptionType,\r
   IN OUT EFI_SYSTEM_CONTEXT  SystemContext\r
   );\r
index 79eca74e138f6b7a953d92ec5d73fcacee350ace..230e50705b4a076940cad6534f22ad03ea5b0521 100644 (file)
@@ -35,7 +35,7 @@
 **/\r
 UINT64\r
 EFIAPI\r
-VmgExit (\r
+CcExitVmgExit (\r
   IN OUT GHCB    *Ghcb,\r
   IN     UINT64  ExitCode,\r
   IN     UINT64  ExitInfo1,\r
@@ -60,12 +60,12 @@ VmgExit (
 \r
   @param[in, out]  Ghcb            A pointer to the GHCB\r
   @param[in, out]  InterruptState  A pointer to hold the current interrupt\r
-                                   state, used for restoring in VmgDone ()\r
+                                   state, used for restoring in CcExitVmgDone ()\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
-VmgInit (\r
+CcExitVmgInit (\r
   IN OUT GHCB     *Ghcb,\r
   IN OUT BOOLEAN  *InterruptState\r
   )\r
@@ -85,7 +85,7 @@ VmgInit (
 **/\r
 VOID\r
 EFIAPI\r
-VmgDone (\r
+CcExitVmgDone (\r
   IN OUT GHCB     *Ghcb,\r
   IN     BOOLEAN  InterruptState\r
   )\r
@@ -104,7 +104,7 @@ VmgDone (
 **/\r
 VOID\r
 EFIAPI\r
-VmgSetOffsetValid (\r
+CcExitVmgSetOffsetValid (\r
   IN OUT GHCB           *Ghcb,\r
   IN     GHCB_REGISTER  Offset\r
   )\r
@@ -126,7 +126,7 @@ VmgSetOffsetValid (
 **/\r
 BOOLEAN\r
 EFIAPI\r
-VmgIsOffsetValid (\r
+CcExitVmgIsOffsetValid (\r
   IN GHCB           *Ghcb,\r
   IN GHCB_REGISTER  Offset\r
   )\r
@@ -155,7 +155,7 @@ VmgIsOffsetValid (
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-VmgExitHandleVc (\r
+CcExitHandleVc (\r
   IN OUT EFI_EXCEPTION_TYPE  *ExceptionType,\r
   IN OUT EFI_SYSTEM_CONTEXT  SystemContext\r
   )\r
@@ -183,7 +183,7 @@ VmgExitHandleVc (
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-VmTdExitHandleVe (\r
+CcExitHandleVe (\r
   IN OUT EFI_EXCEPTION_TYPE  *ExceptionType,\r
   IN OUT EFI_SYSTEM_CONTEXT  SystemContext\r
   )\r
index 2b6d9da5c7132cb6b6d4256cd3c5e1a37576c5d1..748cf8d3bfc6305a4458b38702135bd587bb0168 100644 (file)
@@ -40,7 +40,7 @@ CommonExceptionHandlerWorker (
       //   On other       - ExceptionType contains (possibly new) exception\r
       //                    value\r
       //\r
-      Status = VmgExitHandleVc (&ExceptionType, SystemContext);\r
+      Status = CcExitHandleVc (&ExceptionType, SystemContext);\r
       if (!EFI_ERROR (Status)) {\r
         return;\r
       }\r
@@ -57,7 +57,7 @@ CommonExceptionHandlerWorker (
       //   On other       - ExceptionType contains (possibly new) exception\r
       //                    value\r
       //\r
-      Status = VmTdExitHandleVe (&ExceptionType, SystemContext);\r
+      Status = CcExitHandleVe (&ExceptionType, SystemContext);\r
       if (!EFI_ERROR (Status)) {\r
         return;\r
       }\r
index 0a9ea79f52dcdf07786eb95f1a09b337f369c340..497cd1649930d341da29022ce97a2dd0415ed0eb 100644 (file)
@@ -39,7 +39,7 @@ CommonExceptionHandler (
       //   On other       - ExceptionType contains (possibly new) exception\r
       //                    value\r
       //\r
-      Status = VmgExitHandleVc (&ExceptionType, SystemContext);\r
+      Status = CcExitHandleVc (&ExceptionType, SystemContext);\r
       if (!EFI_ERROR (Status)) {\r
         return;\r
       }\r
@@ -57,7 +57,7 @@ CommonExceptionHandler (
       //   On other       - ExceptionType contains (possibly new) exception\r
       //                    value\r
       //\r
-      Status = VmTdExitHandleVe (&ExceptionType, SystemContext);\r
+      Status = CcExitHandleVe (&ExceptionType, SystemContext);\r
       if (!EFI_ERROR (Status)) {\r
         return;\r
       }\r
index 2dd8f4d74621aac1e3aa04dd70a2a8346fe4f29f..ca9bfed7f3b1e910d1207fac7c3a637e3f4d88fc 100644 (file)
@@ -209,7 +209,7 @@ SevEsPlaceApHlt (
     Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);\r
     Ghcb                    = Msr.Ghcb;\r
 \r
-    VmgInit (Ghcb, &InterruptState);\r
+    CcExitVmgInit (Ghcb, &InterruptState);\r
 \r
     if (DoDecrement) {\r
       DoDecrement = FALSE;\r
@@ -221,13 +221,13 @@ SevEsPlaceApHlt (
       InterlockedDecrement ((UINT32 *)&CpuMpData->MpCpuExchangeInfo->NumApsExecuting);\r
     }\r
 \r
-    Status = VmgExit (Ghcb, SVM_EXIT_AP_RESET_HOLD, 0, 0);\r
+    Status = CcExitVmgExit (Ghcb, SVM_EXIT_AP_RESET_HOLD, 0, 0);\r
     if ((Status == 0) && (Ghcb->SaveArea.SwExitInfo2 != 0)) {\r
-      VmgDone (Ghcb, InterruptState);\r
+      CcExitVmgDone (Ghcb, InterruptState);\r
       break;\r
     }\r
 \r
-    VmgDone (Ghcb, InterruptState);\r
+    CcExitVmgDone (Ghcb, InterruptState);\r
   }\r
 \r
   //\r
index ef56af1f738b7eec67beea12a3bf8d011c5114e1..a84e9e33bafab03cefbd6fdc6883f0b22873a53c 100644 (file)
@@ -222,9 +222,9 @@ GetSevEsAPMemory (
   Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);\r
   Ghcb                    = Msr.Ghcb;\r
 \r
-  VmgInit (Ghcb, &InterruptState);\r
-  VmgExit (Ghcb, SVM_EXIT_AP_JUMP_TABLE, 0, (UINT64)(UINTN)StartAddress);\r
-  VmgDone (Ghcb, InterruptState);\r
+  CcExitVmgInit (Ghcb, &InterruptState);\r
+  CcExitVmgExit (Ghcb, SVM_EXIT_AP_JUMP_TABLE, 0, (UINT64)(UINTN)StartAddress);\r
+  CcExitVmgDone (Ghcb, InterruptState);\r
 \r
   return (UINTN)StartAddress;\r
 }\r
index 4c4f81af7c22b234d2ca1c42693b96db87b126dc..bfda1e19030d2c7bb24c3391019996c1c55ce211 100644 (file)
@@ -150,16 +150,16 @@ SevSnpCreateSaveArea (
   Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);\r
   Ghcb                    = Msr.Ghcb;\r
 \r
-  VmgInit (Ghcb, &InterruptState);\r
+  CcExitVmgInit (Ghcb, &InterruptState);\r
   Ghcb->SaveArea.Rax = SaveArea->SevFeatures;\r
-  VmgSetOffsetValid (Ghcb, GhcbRax);\r
-  VmgExitStatus = VmgExit (\r
+  CcExitVmgSetOffsetValid (Ghcb, GhcbRax);\r
+  VmgExitStatus = CcExitVmgExit (\r
                     Ghcb,\r
                     SVM_EXIT_SNP_AP_CREATION,\r
                     ExitInfo1,\r
                     ExitInfo2\r
                     );\r
-  VmgDone (Ghcb, InterruptState);\r
+  CcExitVmgDone (Ghcb, InterruptState);\r
 \r
   ASSERT (VmgExitStatus == 0);\r
   if (VmgExitStatus != 0) {\r