audk/OvmfPkg/AcpiPlatformDxe
Volker Rümelin 90bb4c577d OvmfPkg: AcpiPlatformDxe: Don't enable unsupported PCI attributes
Current code in PciEnableDecoding tries to unconditionally enable
EFI_PCI_IO_ATTRIBUTE_IO and EFI_PCI_IO_ATTRIBUTE_MEMORY even if they
are unsupported attributes. This fails on devices which don't
support both attributes.

This patch masks out unsupported attributes.

Information to reproduce the bug.

Host lspci -s 0000:04:00.0 -vnn:
04:00.0 USB controller [0c03]: Renesas Technology Corp. uPD720201 USB
3.0 Host Controller [1912:0014] (rev 03) (prog-if 30 [XHCI])
	Flags: fast devsel, IRQ 19
	Memory at ef900000 (64-bit, non-prefetchable) [size=8K]
	Capabilities: [50] Power Management version 3
	Capabilities: [70] MSI: Enable- Count=1/8 Maskable- 64bit+
	Capabilities: [90] MSI-X: Enable- Count=8 Masked-
	Capabilities: [a0] Express Endpoint, MSI 00
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [150] Latency Tolerance Reporting
	Kernel driver in use: pci-stub
	Kernel modules: xhci_pci

libvirt xml:
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x11'
       function='0'/>
    </hostdev>

OVMF debug log with additional DEBUG statement:
OnRootBridgesConnected: root bridges have been connected, installing
ACPI tables
Select Item: 0x19
EnablePciDecoding: GetLocation: D=0000:00:00.0
    OrigAttr=0000000000004000 SuppAttr=000000000000E700
EnablePciDecoding: GetLocation: D=0000:00:10.0
    OrigAttr=0000000000004000 SuppAttr=000000000000E700
EnablePciDecoding: GetLocation: D=0000:00:11.0
    OrigAttr=0000000000004000 SuppAttr=000000000000E600
EnablePciDecoding: EfiPciIoAttributeOperationEnable: Unsupported
Select Item: 0x28
Select Item: 0x19
Select Item: 0x2A
Select Item: 0x19
Select Item: 0x27
InstallQemuFwCfgTables: installed 6 tables

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-04-19 13:18:34 +02:00
..
AcpiPlatform.c OvmfPkg: AcpiPlatformDxe: extract common entry point 2015-02-19 23:45:57 +00:00
AcpiPlatform.h OvmfPkg: AcpiPlatformDxe: enable PCI IO and MMIO while fetching QEMU tables 2016-03-23 17:39:35 +01:00
AcpiPlatformDxe.inf OvmfPkg: AcpiPlatformDxe: enable PCI IO and MMIO while fetching QEMU tables 2016-03-23 17:39:35 +01:00
EntryPoint.c OvmfPkg: AcpiPlatformDxe: when PCI is enabled, wait for Platform BDS's cue 2016-03-23 17:39:35 +01:00
PciDecoding.c OvmfPkg: AcpiPlatformDxe: Don't enable unsupported PCI attributes 2016-04-19 13:18:34 +02:00
Qemu.c OvmfPkg/AcpiPlatformDxe: Split QEMU fw-cfg into a new file 2015-02-02 19:08:57 +00:00
QemuFwCfgAcpi.c OvmfPkg: AcpiPlatformDxe: enable PCI IO and MMIO while fetching QEMU tables 2016-03-23 17:39:35 +01:00
QemuFwCfgAcpiPlatform.c OvmfPkg: AcpiPlatformDxe: extract common entry point 2015-02-19 23:45:57 +00:00
QemuFwCfgAcpiPlatformDxe.inf OvmfPkg: AcpiPlatformDxe: enable PCI IO and MMIO while fetching QEMU tables 2016-03-23 17:39:35 +01:00
QemuLoader.h OvmfPkg: AcpiPlatformDxe: actualize QemuLoader.h comments 2014-09-22 21:11:09 +00:00
Xen.c