Introduce Xen PCI Passthrough, PCI config space helpers

A more complete history can be found here:
git://xenbits.xensource.com/qemu-xen-unstable.git

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
Signed-off-by: Guy Zana <guy@neocleus.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
This commit is contained in:
Allen Kay 2012-06-21 15:40:48 +00:00 committed by Stefano Stabellini
parent eaab4d60d3
commit 93d7ae8e77
3 changed files with 1399 additions and 0 deletions

View File

@ -673,6 +673,13 @@ static int xen_pt_initfn(PCIDevice *d)
/* Handle real device's MMIO/PIO BARs */ /* Handle real device's MMIO/PIO BARs */
xen_pt_register_regions(s); xen_pt_register_regions(s);
/* reinitialize each config register to be emulated */
if (xen_pt_config_init(s)) {
XEN_PT_ERR(d, "PCI Config space initialisation failed.\n");
xen_host_pci_device_put(&s->real_device);
return -1;
}
/* Bind interrupt */ /* Bind interrupt */
if (!s->dev.config[PCI_INTERRUPT_PIN]) { if (!s->dev.config[PCI_INTERRUPT_PIN]) {
XEN_PT_LOG(d, "no pin interrupt\n"); XEN_PT_LOG(d, "no pin interrupt\n");
@ -771,6 +778,9 @@ static int xen_pt_unregister_device(PCIDevice *d)
} }
} }
/* delete all emulated config registers */
xen_pt_config_delete(s);
xen_pt_unregister_regions(s); xen_pt_unregister_regions(s);
memory_listener_unregister(&s->memory_listener); memory_listener_unregister(&s->memory_listener);

View File

@ -62,6 +62,8 @@ typedef int (*xen_pt_conf_byte_read)
#define XEN_PT_BAR_ALLF 0xFFFFFFFF #define XEN_PT_BAR_ALLF 0xFFFFFFFF
#define XEN_PT_BAR_UNMAPPED (-1) #define XEN_PT_BAR_UNMAPPED (-1)
#define PCI_CAP_MAX 48
typedef enum { typedef enum {
XEN_PT_GRP_TYPE_HARDWIRED = 0, /* 0 Hardwired reg group */ XEN_PT_GRP_TYPE_HARDWIRED = 0, /* 0 Hardwired reg group */

File diff suppressed because it is too large Load Diff