]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/AmdSev/AmdSevX64.dsc
Ovmf/HardwareInfoLib: Create Pei lib to parse directly from fw-cfg
[mirror_edk2.git] / OvmfPkg / AmdSev / AmdSevX64.dsc
index a2f1324c40a6d3accf473cb70769351ef5182571..7497cace9ce128c5ed7a72fb40acf8c837924826 100644 (file)
@@ -32,8 +32,8 @@
   # -D FLAG=VALUE\r
   #\r
   DEFINE SOURCE_DEBUG_ENABLE     = FALSE\r
-  DEFINE TPM_ENABLE              = FALSE\r
-  DEFINE TPM_CONFIG_ENABLE       = FALSE\r
+\r
+!include OvmfPkg/OvmfTpmDefines.dsc.inc\r
 \r
   #\r
   # Shell can be useful for debugging but should not be enabled for production\r
   XCODE:*_*_*_MTOC_FLAGS = -align 0x1000\r
   CLANGPDB:*_*_*_DLINK_FLAGS = /ALIGN:4096\r
 \r
-# Force PE/COFF sections to be aligned at 4KB boundaries to support page level\r
-# protection of DXE_SMM_DRIVER/SMM_CORE modules\r
-[BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM_CORE]\r
-  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000\r
-  XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000\r
-  XCODE:*_*_*_MTOC_FLAGS = -align 0x1000\r
-  CLANGPDB:*_*_*_DLINK_FLAGS = /ALIGN:4096\r
-\r
 ################################################################################\r
 #\r
 # SKU Identification section - list of all SKU IDs supported by this Platform.\r
   PciCapLib|OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf\r
   PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf\r
   PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf\r
+  CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf\r
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf\r
   OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf\r
   SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf\r
   LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf\r
   CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf\r
   FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf\r
+  BlobVerifierLib|OvmfPkg/AmdSev/BlobVerifierLibSevHashes/BlobVerifierLibSevHashes.inf\r
+  MemEncryptTdxLib|OvmfPkg/Library/BaseMemEncryptTdxLib/BaseMemEncryptTdxLib.inf\r
+  PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.inf\r
 \r
 !if $(SOURCE_DEBUG_ENABLE) == TRUE\r
   PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf\r
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf\r
   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf\r
   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf\r
+  VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf\r
 \r
 !if $(BUILD_SHELL) == TRUE\r
   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf\r
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf\r
 \r
-!if $(TPM_ENABLE) == TRUE\r
-  Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf\r
-  Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf\r
-  Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf\r
-  Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf\r
-  TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf\r
-!else\r
-  Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf\r
-  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf\r
-!endif\r
+!include OvmfPkg/OvmfTpmLibs.dsc.inc\r
 \r
 [LibraryClasses.common]\r
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf\r
   VmgExitLib|OvmfPkg/Library/VmgExitLib/VmgExitLib.inf\r
+  TdxLib|MdePkg/Library/TdxLib/TdxLib.inf\r
 \r
 [LibraryClasses.common.SEC]\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf\r
   CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf\r
   MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf\r
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/PeiQemuFwCfgS3LibFwCfg.inf\r
+  QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf\r
   PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
   QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf\r
 \r
-!if $(TPM_ENABLE) == TRUE\r
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf\r
-  Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm.inf\r
-  Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf\r
-!endif\r
-\r
   MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf\r
+  PlatformInitLib|OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf\r
 \r
 [LibraryClasses.common.DXE_CORE]\r
   HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf\r
   MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf\r
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf\r
   QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf\r
-!if $(TPM_ENABLE) == TRUE\r
-  Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibTcg/Tpm12DeviceLibTcg.inf\r
-  Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf\r
-!endif\r
 \r
 [LibraryClasses.common.UEFI_APPLICATION]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
 !endif\r
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf\r
 \r
-[LibraryClasses.common.DXE_SMM_DRIVER]\r
-  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
-  TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
-  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
-  MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf\r
-  MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf\r
-  SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf\r
-!ifdef $(DEBUG_ON_SERIAL_PORT)\r
-  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf\r
-!else\r
-  DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf\r
-!endif\r
-  CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf\r
-!if $(SOURCE_DEBUG_ENABLE) == TRUE\r
-  DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf\r
-!endif\r
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf\r
-  PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf\r
-\r
-[LibraryClasses.common.SMM_CORE]\r
-  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
-  TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
-  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
-  SmmCorePlatformHookLib|MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf\r
-  MemoryAllocationLib|MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf\r
-  SmmServicesTableLib|MdeModulePkg/Library/PiSmmCoreSmmServicesTableLib/PiSmmCoreSmmServicesTableLib.inf\r
-!ifdef $(DEBUG_ON_SERIAL_PORT)\r
-  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf\r
-!else\r
-  DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf\r
-!endif\r
-  PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf\r
-\r
 ################################################################################\r
 #\r
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0\r
 \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|1280\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|800\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|0\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|0\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable|FALSE\r
+  gUefiOvmfPkgTokenSpaceGuid.PcdVideoResolutionSource|0\r
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0\r
   gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase|0x0\r
   gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize|0x0\r
   # Set memory encryption mask\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0\r
 \r
+  # Set Tdx shared bit mask\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask|0x0\r
+\r
   # Set SEV-ES defaults\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbBase|0\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbSize|0\r
 \r
   gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x00\r
 \r
-!if $(TPM_ENABLE) == TRUE\r
-  gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\r
-!endif\r
+  # Set ConfidentialComputing defaults\r
+  gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0\r
+\r
+!include OvmfPkg/OvmfTpmPcds.dsc.inc\r
+\r
+  gEfiMdePkgTokenSpaceGuid.PcdFSBClock|1000000000\r
 \r
 [PcdsDynamicHii]\r
-!if $(TPM_ENABLE) == TRUE && $(TPM_CONFIG_ENABLE) == TRUE\r
-  gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS\r
-  gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x8|3|NV,BS\r
-!endif\r
+!include OvmfPkg/OvmfTpmPcdsHii.dsc.inc\r
 \r
 ################################################################################\r
 #\r
   UefiCpuPkg/CpuMpPei/CpuMpPei.inf\r
   OvmfPkg/AmdSev/SecretPei/SecretPei.inf\r
 \r
-!if $(TPM_ENABLE) == TRUE\r
-  OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPei.inf\r
-  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf\r
-  SecurityPkg/Tcg/TcgPei/TcgPei.inf\r
-  SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf {\r
-    <LibraryClasses>\r
-      HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.inf\r
-      NULL|SecurityPkg/Library/HashInstanceLibSha1/HashInstanceLibSha1.inf\r
-      NULL|SecurityPkg/Library/HashInstanceLibSha256/HashInstanceLibSha256.inf\r
-      NULL|SecurityPkg/Library/HashInstanceLibSha384/HashInstanceLibSha384.inf\r
-      NULL|SecurityPkg/Library/HashInstanceLibSha512/HashInstanceLibSha512.inf\r
-      NULL|SecurityPkg/Library/HashInstanceLibSm3/HashInstanceLibSm3.inf\r
-  }\r
-!endif\r
+!include OvmfPkg/OvmfTpmComponentsPei.dsc.inc\r
 \r
   #\r
   # DXE Phase modules\r
 \r
   MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {\r
     <LibraryClasses>\r
-!if $(TPM_ENABLE) == TRUE\r
-      NULL|SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.inf\r
-      NULL|SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.inf\r
-!endif\r
+!include OvmfPkg/OvmfTpmSecurityStub.dsc.inc\r
   }\r
 \r
   MdeModulePkg/Universal/EbcDxe/EbcDxe.inf\r
-  OvmfPkg/8259InterruptControllerDxe/8259.inf\r
   UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf\r
   UefiCpuPkg/CpuDxe/CpuDxe.inf\r
-  OvmfPkg/8254TimerDxe/8254Timer.inf\r
+  OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf\r
   OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.inf\r
   OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf\r
   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {\r
       NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf\r
       NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf\r
   }\r
-  OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf\r
+  OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf {\r
+    <LibraryClasses>\r
+      NULL|OvmfPkg/AmdSev/BlobVerifierLibSevHashes/BlobVerifierLibSevHashes.inf\r
+  }\r
   OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf\r
   OvmfPkg/Virtio10Dxe/Virtio10.inf\r
   OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
       DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
       PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
   }\r
-  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf\r
   MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
   MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
   MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf\r
   # ACPI Support\r
   #\r
   MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf\r
-  OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf\r
+  OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf\r
   MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf\r
 \r
   #\r
 !endif\r
 \r
   OvmfPkg/PlatformDxe/Platform.inf\r
-  OvmfPkg/AmdSevDxe/AmdSevDxe.inf\r
+  OvmfPkg/AmdSevDxe/AmdSevDxe.inf {\r
+    <LibraryClasses>\r
+    PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf\r
+  }\r
   OvmfPkg/IoMmuDxe/IoMmuDxe.inf\r
 \r
   #\r
   #\r
   # TPM support\r
   #\r
-!if $(TPM_ENABLE) == TRUE\r
-  SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf {\r
-    <LibraryClasses>\r
-      Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.inf\r
-      NULL|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2InstanceLibDTpm.inf\r
-      HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterDxe.inf\r
-      NULL|SecurityPkg/Library/HashInstanceLibSha1/HashInstanceLibSha1.inf\r
-      NULL|SecurityPkg/Library/HashInstanceLibSha256/HashInstanceLibSha256.inf\r
-      NULL|SecurityPkg/Library/HashInstanceLibSha384/HashInstanceLibSha384.inf\r
-      NULL|SecurityPkg/Library/HashInstanceLibSha512/HashInstanceLibSha512.inf\r
-      NULL|SecurityPkg/Library/HashInstanceLibSm3/HashInstanceLibSm3.inf\r
-  }\r
-!if $(TPM_CONFIG_ENABLE) == TRUE\r
-  SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf\r
-!endif\r
-  SecurityPkg/Tcg/TcgDxe/TcgDxe.inf {\r
-    <LibraryClasses>\r
-      Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm.inf\r
-  }\r
-!endif\r
+!include OvmfPkg/OvmfTpmComponentsDxe.dsc.inc\r