Skip to content

Commit 8b87eb9

Browse files
tlendackymergify[bot]
authored andcommitted
OvmfPkg: Use the OvmfPkg version of CcProbeLib
Currently, multiple dsc files within the OvmfPkg directory use the NULL version of the CcProbeLib library. However, these packages have support for confidential guests (usage of CcExitLib, MemEncrypt{Sev,Tdx}Lib, etc.) and should be using the OvmfPkg version of the CcProbeLib. The use of the NULL library causes the PCI option ROM to be enabled, which can't be trusted as it originates from the hypervisor. The use of the NULL library also causes a KVM hypervisor error when attempting to map/back the option ROM region when running an SEV-SNP guest. Update the various dsc files to reference the OvmfPkg version of the CcProbeLib library and prevent usage of PCI option ROMs. Signed-off-by: Tom Lendacky <[email protected]>
1 parent d51baa0 commit 8b87eb9

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

OvmfPkg/AmdSev/AmdSevX64.dsc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@
142142
PciCapLib|OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf
143143
PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf
144144
PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf
145-
CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf
146145
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
147146
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
148147
SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf
@@ -165,6 +164,7 @@
165164
VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
166165
LoadLinuxLib|OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf
167166
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf
167+
CcProbeLib|OvmfPkg/Library/CcProbeLib/DxeCcProbeLib.inf
168168
LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf
169169
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
170170
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
@@ -232,6 +232,7 @@
232232
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
233233
CcExitLib|OvmfPkg/Library/CcExitLib/SecCcExitLib.inf
234234
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf
235+
CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf
235236

236237
[LibraryClasses.common.PEI_CORE]
237238
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
@@ -248,6 +249,7 @@
248249
DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf
249250
!endif
250251
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
252+
CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf
251253

252254
[LibraryClasses.common.PEIM]
253255
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
@@ -277,6 +279,7 @@
277279
QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf
278280

279281
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf
282+
CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf
280283
PlatformInitLib|OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
281284

282285
[LibraryClasses.common.DXE_CORE]

OvmfPkg/CloudHv/CloudHvX64.dsc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@
160160
PciCapLib|OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf
161161
PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf
162162
PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf
163-
CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf
164163
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
165164
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
166165
SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf
@@ -187,6 +186,9 @@
187186
ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLib.inf
188187
!if $(SMM_REQUIRE) == FALSE
189188
LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf
189+
CcProbeLib|OvmfPkg/Library/CcProbeLib/DxeCcProbeLib.inf
190+
!else
191+
CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf
190192
!endif
191193
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
192194
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
@@ -270,6 +272,7 @@
270272
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
271273
CcExitLib|OvmfPkg/Library/CcExitLib/SecCcExitLib.inf
272274
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf
275+
CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf
273276

274277
[LibraryClasses.common.PEI_CORE]
275278
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
@@ -286,6 +289,7 @@
286289
DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
287290
!endif
288291
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
292+
CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf
289293

290294
[LibraryClasses.common.PEIM]
291295
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
@@ -314,6 +318,7 @@
314318
QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibNull.inf
315319

316320
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf
321+
CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf
317322
PlatformInitLib|OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
318323

319324
[LibraryClasses.common.DXE_CORE]

OvmfPkg/Microvm/MicrovmX64.dsc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@
163163
PciCapLib|OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf
164164
PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf
165165
PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf
166-
CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf
167166
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
168167
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
169168
SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf
@@ -186,6 +185,7 @@
186185
VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
187186
LoadLinuxLib|OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf
188187
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf
188+
CcProbeLib|OvmfPkg/Library/CcProbeLib/DxeCcProbeLib.inf
189189
LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf
190190
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
191191
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
@@ -278,6 +278,7 @@
278278
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
279279
CcExitLib|OvmfPkg/Library/CcExitLib/SecCcExitLib.inf
280280
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf
281+
CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf
281282

282283
[LibraryClasses.common.PEI_CORE]
283284
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
@@ -294,6 +295,7 @@
294295
DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf
295296
!endif
296297
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
298+
CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf
297299

298300
[LibraryClasses.common.PEIM]
299301
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
@@ -322,6 +324,7 @@
322324
QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf
323325

324326
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf
327+
CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf
325328
PlatformInitLib|OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
326329

327330
[LibraryClasses.common.DXE_CORE]

0 commit comments

Comments
 (0)