Files
system76-edk2/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.inf
Lee, Chun-Yi 18b5b14932 OvmfPkg/IncompatiblePciDeviceSupportDxe: Ignore OptionRom in Sev guest
Reference: https://bugzilla.tianocore.org/show_bug.cgi?id=4031

This patch is similar to the c477b2783f patch for Td guest.

Host VMM may inject OptionRom which is untrusted in Sev guest. So PCI
OptionRom needs to be ignored if it is Sev guest. According to
"Table 20. ACPI 2.0 & 3.0 QWORD Address Space Descriptor Usage"
PI spec 1.7, type-specific flags can be set to 0 when Address
Translation Offset == 6 to skip device option ROM.

Without this patch, Sev guest may shows invalid MMIO opcode error
as following:

Invalid MMIO opcode (F6)
ASSERT /home/abuild/rpmbuild/BUILD/edk2-edk2-stable202202/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c(1041): ((BOOLEAN)(0==1))

The OptionRom must be disabled both on Td and Sev guests, so we direct
use CcProbe().

Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2022-09-06 16:55:33 +00:00

43 lines
1.1 KiB
INI

## @file
# A simple DXE_DRIVER that causes the PCI Bus UEFI_DRIVER to allocate 64-bit
# MMIO BARs above 4 GB, regardless of option ROM availability (as long as a CSM
# is not present), conserving 32-bit MMIO aperture for 32-bit BARs.
#
# Copyright (C) 2016, Red Hat, Inc.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = IncompatiblePciDeviceSupportDxe
FILE_GUID = F6697AC4-A776-4EE1-B643-1FEFF2B615BB
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = DriverInitialize
[Sources]
IncompatiblePciDeviceSupport.c
[Packages]
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
[LibraryClasses]
CcProbeLib
DebugLib
MemoryAllocationLib
PcdLib
UefiBootServicesTableLib
UefiDriverEntryPoint
[Protocols]
gEfiIncompatiblePciDeviceSupportProtocolGuid ## SOMETIMES_PRODUCES
gEfiLegacyBiosProtocolGuid ## NOTIFY
[Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size ## CONSUMES
[Depex]
TRUE