]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: restrict XenPlatformLib to BdsDxe in the IA32, IA32X64, X64 DSCs
authorLaszlo Ersek <lersek@redhat.com>
Wed, 26 May 2021 20:14:46 +0000 (22:14 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 4 Jun 2021 16:01:50 +0000 (16:01 +0000)
The "OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf"
library instance is used in the following platform DSC files in edk2:

  OvmfPkg/OvmfPkgIa32.dsc
  OvmfPkg/OvmfPkgIa32X64.dsc
  OvmfPkg/OvmfPkgX64.dsc
  OvmfPkg/OvmfXen.dsc

The Xen customizations are very light-weight in this
PlatformBootManagerLib instance. Isolating them statically, for the sake
of the first three DSC files, would save negligible binary code size, and
would likely worsen code complexity (by way of introducing new internal
interfaces) or blow up source code size (by duplicating almost the entire
lib instance source code). So for now, keep this one bit of Xen dynamism
even on QEMU.

However, because it's only PlatformBootManagerLib now that uses
XenPlatformLib (for the above-stated enlightenment), restrict the
XenPlatformLib class resolution in the first three DSC files to the only
DXE driver that consumes PlatformBootManagerLib (and therefore
XenPlatformLib): BdsDxe. This will cause a build failure later if someone
attempts to call a XenPlatformLib API (that is, tries to re-introduce Xen
enlightenment) in a different module in these non-Xen DSC files.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20210526201446.12554-44-lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
OvmfPkg/OvmfPkgIa32.dsc
OvmfPkg/OvmfPkgIa32X64.dsc
OvmfPkg/OvmfPkgX64.dsc

index 7a37efd35664304576e209d89652a265d3667b87..f53efeae7986569faa40bd9147516d9c57d5d8f7 100644 (file)
   S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf\r
-  XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf\r
 \r
 !if $(TPM_ENABLE) == TRUE\r
   Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf\r
   MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf\r
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf {\r
     <LibraryClasses>\r
+      XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf\r
 !ifdef $(CSM_ENABLE)\r
       NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf\r
       NULL|OvmfPkg/Csm/LegacyBootManagerLib/LegacyBootManagerLib.inf\r
index d6cc58a261d913ba202d3f192486c00257e3c625..b3662e17f256aa733acfaa3c573cba3bd642f3da 100644 (file)
   S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf\r
-  XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf\r
 \r
 !if $(TPM_ENABLE) == TRUE\r
   Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf\r
   MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf\r
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf {\r
     <LibraryClasses>\r
+      XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf\r
 !ifdef $(CSM_ENABLE)\r
       NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf\r
       NULL|OvmfPkg/Csm/LegacyBootManagerLib/LegacyBootManagerLib.inf\r
index ab60c36eca27d2cb45d4fb3e916202abb909a7b5..0a237a90586644800a12b5bc65db30f4778273ee 100644 (file)
   S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf\r
-  XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf\r
 \r
 !if $(TPM_ENABLE) == TRUE\r
   Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf\r
   MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf\r
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf {\r
     <LibraryClasses>\r
+      XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf\r
 !ifdef $(CSM_ENABLE)\r
       NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf\r
       NULL|OvmfPkg/Csm/LegacyBootManagerLib/LegacyBootManagerLib.inf\r