OvmfPkg/PlatformPei: set PcdConfidentialComputingAttr when SEV is active
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275 The MpInitLib uses the ConfidentialComputingAttr PCD to determine whether AMD SEV is active so that it can use the VMGEXITs defined in the GHCB specification to create APs. Cc: Michael Roth <michael.roth@amd.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Suggested-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
This commit is contained in:
		
				
					committed by
					
						![mergify[bot]](/avatar/e3df20cd7a67969c41a65f03bea54961?size=40) mergify[bot]
						mergify[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							26210f9436
						
					
				
				
					commit
					504ae26b80
				
			| @@ -575,6 +575,9 @@ | |||||||
|  |  | ||||||
|   gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x00 |   gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x00 | ||||||
|  |  | ||||||
|  |   # Set ConfidentialComputing defaults | ||||||
|  |   gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0 | ||||||
|  |  | ||||||
| !if $(TPM_ENABLE) == TRUE | !if $(TPM_ENABLE) == TRUE | ||||||
|   gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |   gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} | ||||||
| !endif | !endif | ||||||
|   | |||||||
| @@ -651,6 +651,9 @@ | |||||||
|   gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01 |   gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01 | ||||||
|   gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01 |   gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01 | ||||||
|  |  | ||||||
|  |   # Set ConfidentialComputing defaults | ||||||
|  |   gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0 | ||||||
|  |  | ||||||
| [PcdsDynamicHii] | [PcdsDynamicHii] | ||||||
| !if $(TPM_ENABLE) == TRUE && $(TPM_CONFIG_ENABLE) == TRUE | !if $(TPM_ENABLE) == TRUE && $(TPM_CONFIG_ENABLE) == TRUE | ||||||
|   gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS |   gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS | ||||||
|   | |||||||
| @@ -659,6 +659,9 @@ | |||||||
|   gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} |   gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} | ||||||
| !endif | !endif | ||||||
|  |  | ||||||
|  |   # Set ConfidentialComputing defaults | ||||||
|  |   gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0 | ||||||
|  |  | ||||||
| [PcdsDynamicDefault.X64] | [PcdsDynamicDefault.X64] | ||||||
|   # IPv4 and IPv6 PXE Boot support. |   # IPv4 and IPv6 PXE Boot support. | ||||||
|   gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01 |   gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01 | ||||||
|   | |||||||
| @@ -662,6 +662,9 @@ | |||||||
|   gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01 |   gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01 | ||||||
|   gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01 |   gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01 | ||||||
|  |  | ||||||
|  |   # Set ConfidentialComputing defaults | ||||||
|  |   gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0 | ||||||
|  |  | ||||||
| [PcdsDynamicHii] | [PcdsDynamicHii] | ||||||
| !if $(TPM_ENABLE) == TRUE && $(TPM_CONFIG_ENABLE) == TRUE | !if $(TPM_ENABLE) == TRUE && $(TPM_CONFIG_ENABLE) == TRUE | ||||||
|   gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS |   gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS | ||||||
|   | |||||||
| @@ -20,6 +20,7 @@ | |||||||
| #include <Register/Amd/Msr.h> | #include <Register/Amd/Msr.h> | ||||||
| #include <Register/Intel/SmramSaveStateMap.h> | #include <Register/Intel/SmramSaveStateMap.h> | ||||||
| #include <Library/VmgExitLib.h> | #include <Library/VmgExitLib.h> | ||||||
|  | #include <ConfidentialComputingGuestAttr.h> | ||||||
|  |  | ||||||
| #include "Platform.h" | #include "Platform.h" | ||||||
|  |  | ||||||
| @@ -345,4 +346,18 @@ AmdSevInitialize ( | |||||||
|   // Check and perform SEV-ES initialization if required. |   // Check and perform SEV-ES initialization if required. | ||||||
|   // |   // | ||||||
|   AmdSevEsInitialize (); |   AmdSevEsInitialize (); | ||||||
|  |  | ||||||
|  |   // | ||||||
|  |   // Set the Confidential computing attr PCD to communicate which SEV | ||||||
|  |   // technology is active. | ||||||
|  |   // | ||||||
|  |   if (MemEncryptSevSnpIsEnabled ()) { | ||||||
|  |     PcdStatus = PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrAmdSevSnp); | ||||||
|  |   } else if (MemEncryptSevEsIsEnabled ()) { | ||||||
|  |     PcdStatus = PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrAmdSevEs); | ||||||
|  |   } else { | ||||||
|  |     PcdStatus = PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrAmdSev); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   ASSERT_RETURN_ERROR (PcdStatus); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -106,6 +106,7 @@ | |||||||
|   gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber |   gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber | ||||||
|   gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize |   gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize | ||||||
|   gUefiCpuPkgTokenSpaceGuid.PcdSevEsIsEnabled |   gUefiCpuPkgTokenSpaceGuid.PcdSevEsIsEnabled | ||||||
|  |   gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr | ||||||
|  |  | ||||||
| [FixedPcd] | [FixedPcd] | ||||||
|   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress |   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user