OvmfPkg/UefiCpuPkg: Add CcExit prefix to the APIs of CcExitLib

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>
This commit is contained in:
Min M Xu
2022-11-07 15:50:11 +08:00
committed by mergify[bot]
parent a89f558d3c
commit 765ba5bf05
15 changed files with 117 additions and 117 deletions

View File

@@ -41,7 +41,7 @@
**/
UINT64
EFIAPI
VmgExit (
CcExitVmgExit (
IN OUT GHCB *Ghcb,
IN UINT64 ExitCode,
IN UINT64 ExitInfo1,
@@ -56,12 +56,12 @@ VmgExit (
@param[in, out] Ghcb A pointer to the GHCB
@param[in, out] InterruptState A pointer to hold the current interrupt
state, used for restoring in VmgDone ()
state, used for restoring in CcExitVmgDone ()
**/
VOID
EFIAPI
VmgInit (
CcExitVmgInit (
IN OUT GHCB *Ghcb,
IN OUT BOOLEAN *InterruptState
);
@@ -79,7 +79,7 @@ VmgInit (
**/
VOID
EFIAPI
VmgDone (
CcExitVmgDone (
IN OUT GHCB *Ghcb,
IN BOOLEAN InterruptState
);
@@ -96,7 +96,7 @@ VmgDone (
**/
VOID
EFIAPI
VmgSetOffsetValid (
CcExitVmgSetOffsetValid (
IN OUT GHCB *Ghcb,
IN GHCB_REGISTER Offset
);
@@ -116,7 +116,7 @@ VmgSetOffsetValid (
**/
BOOLEAN
EFIAPI
VmgIsOffsetValid (
CcExitVmgIsOffsetValid (
IN GHCB *Ghcb,
IN GHCB_REGISTER Offset
);
@@ -142,7 +142,7 @@ VmgIsOffsetValid (
**/
EFI_STATUS
EFIAPI
VmgExitHandleVc (
CcExitHandleVc (
IN OUT EFI_EXCEPTION_TYPE *ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
);
@@ -168,7 +168,7 @@ VmgExitHandleVc (
**/
EFI_STATUS
EFIAPI
VmTdExitHandleVe (
CcExitHandleVe (
IN OUT EFI_EXCEPTION_TYPE *ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
);

View File

@@ -35,7 +35,7 @@
**/
UINT64
EFIAPI
VmgExit (
CcExitVmgExit (
IN OUT GHCB *Ghcb,
IN UINT64 ExitCode,
IN UINT64 ExitInfo1,
@@ -60,12 +60,12 @@ VmgExit (
@param[in, out] Ghcb A pointer to the GHCB
@param[in, out] InterruptState A pointer to hold the current interrupt
state, used for restoring in VmgDone ()
state, used for restoring in CcExitVmgDone ()
**/
VOID
EFIAPI
VmgInit (
CcExitVmgInit (
IN OUT GHCB *Ghcb,
IN OUT BOOLEAN *InterruptState
)
@@ -85,7 +85,7 @@ VmgInit (
**/
VOID
EFIAPI
VmgDone (
CcExitVmgDone (
IN OUT GHCB *Ghcb,
IN BOOLEAN InterruptState
)
@@ -104,7 +104,7 @@ VmgDone (
**/
VOID
EFIAPI
VmgSetOffsetValid (
CcExitVmgSetOffsetValid (
IN OUT GHCB *Ghcb,
IN GHCB_REGISTER Offset
)
@@ -126,7 +126,7 @@ VmgSetOffsetValid (
**/
BOOLEAN
EFIAPI
VmgIsOffsetValid (
CcExitVmgIsOffsetValid (
IN GHCB *Ghcb,
IN GHCB_REGISTER Offset
)
@@ -155,7 +155,7 @@ VmgIsOffsetValid (
**/
EFI_STATUS
EFIAPI
VmgExitHandleVc (
CcExitHandleVc (
IN OUT EFI_EXCEPTION_TYPE *ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
@@ -183,7 +183,7 @@ VmgExitHandleVc (
**/
EFI_STATUS
EFIAPI
VmTdExitHandleVe (
CcExitHandleVe (
IN OUT EFI_EXCEPTION_TYPE *ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)

View File

@@ -40,7 +40,7 @@ CommonExceptionHandlerWorker (
// On other - ExceptionType contains (possibly new) exception
// value
//
Status = VmgExitHandleVc (&ExceptionType, SystemContext);
Status = CcExitHandleVc (&ExceptionType, SystemContext);
if (!EFI_ERROR (Status)) {
return;
}
@@ -57,7 +57,7 @@ CommonExceptionHandlerWorker (
// On other - ExceptionType contains (possibly new) exception
// value
//
Status = VmTdExitHandleVe (&ExceptionType, SystemContext);
Status = CcExitHandleVe (&ExceptionType, SystemContext);
if (!EFI_ERROR (Status)) {
return;
}

View File

@@ -39,7 +39,7 @@ CommonExceptionHandler (
// On other - ExceptionType contains (possibly new) exception
// value
//
Status = VmgExitHandleVc (&ExceptionType, SystemContext);
Status = CcExitHandleVc (&ExceptionType, SystemContext);
if (!EFI_ERROR (Status)) {
return;
}
@@ -57,7 +57,7 @@ CommonExceptionHandler (
// On other - ExceptionType contains (possibly new) exception
// value
//
Status = VmTdExitHandleVe (&ExceptionType, SystemContext);
Status = CcExitHandleVe (&ExceptionType, SystemContext);
if (!EFI_ERROR (Status)) {
return;
}

View File

@@ -209,7 +209,7 @@ SevEsPlaceApHlt (
Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);
Ghcb = Msr.Ghcb;
VmgInit (Ghcb, &InterruptState);
CcExitVmgInit (Ghcb, &InterruptState);
if (DoDecrement) {
DoDecrement = FALSE;
@@ -221,13 +221,13 @@ SevEsPlaceApHlt (
InterlockedDecrement ((UINT32 *)&CpuMpData->MpCpuExchangeInfo->NumApsExecuting);
}
Status = VmgExit (Ghcb, SVM_EXIT_AP_RESET_HOLD, 0, 0);
Status = CcExitVmgExit (Ghcb, SVM_EXIT_AP_RESET_HOLD, 0, 0);
if ((Status == 0) && (Ghcb->SaveArea.SwExitInfo2 != 0)) {
VmgDone (Ghcb, InterruptState);
CcExitVmgDone (Ghcb, InterruptState);
break;
}
VmgDone (Ghcb, InterruptState);
CcExitVmgDone (Ghcb, InterruptState);
}
//

View File

@@ -222,9 +222,9 @@ GetSevEsAPMemory (
Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);
Ghcb = Msr.Ghcb;
VmgInit (Ghcb, &InterruptState);
VmgExit (Ghcb, SVM_EXIT_AP_JUMP_TABLE, 0, (UINT64)(UINTN)StartAddress);
VmgDone (Ghcb, InterruptState);
CcExitVmgInit (Ghcb, &InterruptState);
CcExitVmgExit (Ghcb, SVM_EXIT_AP_JUMP_TABLE, 0, (UINT64)(UINTN)StartAddress);
CcExitVmgDone (Ghcb, InterruptState);
return (UINTN)StartAddress;
}

View File

@@ -150,16 +150,16 @@ SevSnpCreateSaveArea (
Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);
Ghcb = Msr.Ghcb;
VmgInit (Ghcb, &InterruptState);
CcExitVmgInit (Ghcb, &InterruptState);
Ghcb->SaveArea.Rax = SaveArea->SevFeatures;
VmgSetOffsetValid (Ghcb, GhcbRax);
VmgExitStatus = VmgExit (
CcExitVmgSetOffsetValid (Ghcb, GhcbRax);
VmgExitStatus = CcExitVmgExit (
Ghcb,
SVM_EXIT_SNP_AP_CREATION,
ExitInfo1,
ExitInfo2
);
VmgDone (Ghcb, InterruptState);
CcExitVmgDone (Ghcb, InterruptState);
ASSERT (VmgExitStatus == 0);
if (VmgExitStatus != 0) {