@@ -370,6 +370,13 @@ void xen_host_pci_device_get(XenHostPCIDevice *d, uint16_t domain,
}
d->irq = v;
+ xen_host_pci_get_dec_value(d, "gsi", &v, errp);
+ if (*errp) {
+ d->gsi = -1;
+ } else {
+ d->gsi = v;
+ }
+
xen_host_pci_get_hex_value(d, "class", &v, errp);
if (*errp) {
goto error;
@@ -27,6 +27,7 @@ typedef struct XenHostPCIDevice {
uint16_t device_id;
uint32_t class_code;
int irq;
+ int gsi;
XenHostPCIIORegion io_regions[PCI_NUM_REGIONS - 1];
XenHostPCIIORegion rom;
@@ -840,7 +840,11 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
goto out;
}
- machine_irq = s->real_device.irq;
+ if (s->real_device.gsi < 0) {
+ machine_irq = s->real_device.irq;
+ } else {
+ machine_irq = s->real_device.gsi;
+ }
if (machine_irq == 0) {
XEN_PT_LOG(d, "machine irq is 0\n");
cmd |= PCI_COMMAND_INTX_DISABLE;