]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
UefiCpuPkg/MpInitLib: Use SEV-SNP AP Creation NAE event to launch APs
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / DxeMpLib.c
index 02bc9c2bd2c4f763ba471ffb222b0ced8a8cea89..60d14a5a0e101e7c71c368903bc3c9390f110833 100644 (file)
@@ -93,7 +93,14 @@ GetWakeupBuffer (
   EFI_PHYSICAL_ADDRESS  StartAddress;\r
   EFI_MEMORY_TYPE       MemoryType;\r
 \r
-  if (ConfidentialComputingGuestHas (CCAttrAmdSevEs)) {\r
+  if (ConfidentialComputingGuestHas (CCAttrAmdSevEs) &&\r
+      !ConfidentialComputingGuestHas (CCAttrAmdSevSnp))\r
+  {\r
+    //\r
+    // An SEV-ES-only guest requires the memory to be reserved. SEV-SNP, which\r
+    // is also considered SEV-ES, uses a different AP startup method, though,\r
+    // which does not have the same requirement.\r
+    //\r
     MemoryType = EfiReservedMemoryType;\r
   } else {\r
     MemoryType = EfiBootServicesData;\r
@@ -380,7 +387,7 @@ RelocateApLoop (
   MpInitLibWhoAmI (&ProcessorNumber);\r
   CpuMpData    = GetCpuMpData ();\r
   MwaitSupport = IsMwaitSupport ();\r
-  if (CpuMpData->SevEsIsEnabled) {\r
+  if (CpuMpData->UseSevEsAPMethod) {\r
     StackStart = CpuMpData->SevEsAPResetStackStart;\r
   } else {\r
     StackStart = mReservedTopOfApStack;\r
@@ -430,7 +437,7 @@ MpInitChangeApLoopCallback (
     CpuPause ();\r
   }\r
 \r
-  if (CpuMpData->SevEsIsEnabled && (CpuMpData->WakeupBuffer != (UINTN)-1)) {\r
+  if (CpuMpData->UseSevEsAPMethod && (CpuMpData->WakeupBuffer != (UINTN)-1)) {\r
     //\r
     // There are APs present. Re-use reserved memory area below 1MB from\r
     // WakeupBuffer as the area to be used for transitioning to 16-bit mode\r