]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/qemu-xen-traditional.git/commitdiff
passthrough: Correctly expose PCH ISA bridge for IGD passthrough
authorG.R <firemeteor.guo@gmail.com>
Thu, 25 Jul 2013 08:11:55 +0000 (08:11 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 5 Aug 2013 15:50:12 +0000 (16:50 +0100)
The i915 driver probes chip version through PCH ISA bridge device / vendor ID.
Previously, the PCH ISA bridge is exposed as PCI-PCI bridge in qemu-xen-trad,
which breaks the assumption of the driver. This change fixes the issue by
correctly exposing the ISA bridge to domU.

Signed-off-by: Rui Guo <firemeteor@users.sourceforge.net>
Tested-by: Rui Guo <firemeteor@users.sourceforge.net>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
hw/pci.c
hw/pci.h
hw/pt-graphics.c

index f051de16956bade2d3dfd9bb1828c7c6172034c4..c4232856f13dcbb1414c9dbe269c8f5280ec663a 100644 (file)
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -938,6 +938,16 @@ PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
     return s->bus;
 }
 
+PCIBus *pci_isa_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
+                            uint8_t rid, pci_map_irq_fn map_irq, const char *name)
+{
+    PCIBus *s = pci_bridge_init(bus, devfn, vid, did, rid, map_irq, name);
+
+    pci_config_set_class(s->parent_dev->config, PCI_CLASS_BRIDGE_ISA);
+    s->parent_dev->config[PCI_HEADER_TYPE] = 0x80;
+    return s;
+}
+
 int pt_chk_bar_overlap(PCIBus *bus, int devfn, uint32_t addr,
                         uint32_t size, uint8_t type)
 {
index edc58b6663cbf298e71636177ea66e91ce380248..cacbdd280054b0559d27767a00906e97c789e781 100644 (file)
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -271,6 +271,9 @@ void pci_info(void);
 PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
                         uint8_t rid, pci_map_irq_fn map_irq, const char *name);
 
+PCIBus *pci_isa_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
+                            uint8_t rid, pci_map_irq_fn map_irq, const char *name);
+
 #define NR_PCI_FUNC          8
 #define NR_PCI_DEV           32
 #define NR_PCI_DEVFN         (NR_PCI_FUNC * NR_PCI_DEV)
index c6f886958d8445e49d8fdcdda7669adc51ed40b1..7302b25d045355671b8f88171c5bc9daf9bb97c1 100644 (file)
@@ -3,6 +3,7 @@
  */
 
 #include "pass-through.h"
+#include "pci.h"
 #include "pci/header.h"
 #include "pci/pci.h"
 
@@ -40,9 +41,11 @@ void intel_pch_init(PCIBus *bus)
     did = pt_pci_host_read(pci_dev_1f, PCI_DEVICE_ID, 2);
     rid = pt_pci_host_read(pci_dev_1f, PCI_REVISION, 1);
 
-    if ( vid == PCI_VENDOR_ID_INTEL )
-        pci_bridge_init(bus, PCI_DEVFN(0x1f, 0), vid, did, rid,
-                        pch_map_irq, "intel_bridge_1f");
+    if (vid == PCI_VENDOR_ID_INTEL) {
+        pci_isa_bridge_init(bus, PCI_DEVFN(0x1f, 0), vid, did, rid,
+                            pch_map_irq, "intel_bridge_1f");
+
+    }
 }
 
 uint32_t igd_read_opregion(struct pt_dev *pci_dev)