diff options
author | Laszlo Ersek <lersek@redhat.com> | 2023-11-11 00:58:04 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-12-07 18:04:57 +0000 |
commit | 86cc0f15d9b120c435e285b38df0072ca404522b (patch) | |
tree | 3ffcc699f445fa0c8e08af5989676c8f6be68130 | |
parent | 8bd14e685ef75d0653ab28f554e647ab4f32cd2c (diff) | |
download | edk2-86cc0f15d9b120c435e285b38df0072ca404522b.tar.gz |
OvmfPkg: unplug CsmSupportLib from BdsDxe
CsmSupportLib is effectively a hack. It produces the following protocols:
- Legacy Bios Platform,
- Legacy Interrupt,
- Legacy Region2.
(Note that the "OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf" file contains
an error where it claims that "Legacy Bios Platform" is "consumed" -- it
is not; the lib instance produces that protocol).
At the same time, the library instance consumes
gEfiLegacyBiosProtocolGuid.
This *seemingly* creates a circular dependency with LegacyBiosDxe, because
that driver has the exact opposite protocol usage patterns. The solution
is that LegacyBiosDxe has a DEPEX on the protocols produced by
CsmSupportLib, while CsmSupportLib consumes the Legacy Bios Protocol from
LegacyBiosDxe only in the member functions of the protocols it produces.
Therefore, once BdsDxe is dispatched, and the CsmSupportLib constructor
exposes those three protocols, LegacyBiosDxe can also be started by the
DXE dispatcher, and then the protocols from CsmSupportLib become
functional.
But the main reason why CsmSupportLib is a hack is that it should be a
normal platform DXE driver (called e.g. "CsmSupportDxe"), and not a NULL
class library that's randomly hooked into BdsDxe.
Given that we have removed LegacyBiosDxe earlier (so there is no DEPEX we
need to satisfy now, conceptually), unhook CsmSupportLib from BdsDxe.
--*--
Note that in the BhyveX64 platform, the pathname
"OvmfPkg/Bhyve/Csm/CsmSupportLib/CsmSupportLib.inf" is bogus, and has
always been, since commit 656419f922c0 ("Add BhyvePkg, to support the
bhyve hypervisor", 2020-07-31).
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Corvin Köhne <corvink@freebsd.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-22-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | OvmfPkg/Bhyve/BhyveX64.dsc | 1 | ||||
-rw-r--r-- | OvmfPkg/OvmfPkgIa32.dsc | 3 | ||||
-rw-r--r-- | OvmfPkg/OvmfPkgIa32X64.dsc | 3 | ||||
-rw-r--r-- | OvmfPkg/OvmfPkgX64.dsc | 3 | ||||
-rw-r--r-- | OvmfPkg/OvmfXen.dsc | 7 |
5 files changed, 1 insertions, 16 deletions
diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index 1a87c281e6..62acb2547c 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -667,7 +667,6 @@ <LibraryClasses>
!ifdef $(CSM_ENABLE)
!error "CSM is being torn down"
- NULL|OvmfPkg/Bhyve/Csm/CsmSupportLib/CsmSupportLib.inf
!endif
}
MdeModulePkg/Logo/LogoDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 2c3c03bf67..8cd43f2d94 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -781,9 +781,6 @@ MdeModulePkg/Universal/BdsDxe/BdsDxe.inf {
<LibraryClasses>
XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf
-!ifdef $(CSM_ENABLE)
- NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf
-!endif
}
MdeModulePkg/Logo/LogoDxe.inf
MdeModulePkg/Application/UiApp/UiApp.inf {
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 10698cbb25..456b1c267c 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -795,9 +795,6 @@ MdeModulePkg/Universal/BdsDxe/BdsDxe.inf {
<LibraryClasses>
XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf
-!ifdef $(CSM_ENABLE)
- NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf
-!endif
}
MdeModulePkg/Logo/LogoDxe.inf
MdeModulePkg/Application/UiApp/UiApp.inf {
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index edfbf03a5f..b2a5546270 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -863,9 +863,6 @@ MdeModulePkg/Universal/BdsDxe/BdsDxe.inf {
<LibraryClasses>
XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf
-!ifdef $(CSM_ENABLE)
- NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf
-!endif
}
MdeModulePkg/Logo/LogoDxe.inf
MdeModulePkg/Application/UiApp/UiApp.inf {
diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index b510a2ef95..d1554259b7 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -593,12 +593,7 @@ MdeModulePkg/Universal/Metronome/Metronome.inf
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf
- MdeModulePkg/Universal/BdsDxe/BdsDxe.inf {
- <LibraryClasses>
-!ifdef $(CSM_ENABLE)
- NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf
-!endif
- }
+ MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
MdeModulePkg/Logo/LogoDxe.inf
MdeModulePkg/Application/UiApp/UiApp.inf {
<LibraryClasses>
|