qemu-xen: pass-through: always use hw intx pass-through: always use hw intx and always get it from the same place Cc: Tom Rotenberg Cc: Edwin Zhai Signed-off-by: Simon Horman Index: ioemu-remote/hw/pass-through.c =================================================================== --- ioemu-remote.orig/hw/pass-through.c 2009-12-31 13:10:06.000000000 +0900 +++ ioemu-remote/hw/pass-through.c 2009-12-31 13:24:20.000000000 +0900 @@ -2710,7 +2710,7 @@ static uint32_t pt_status_reg_init(struc static uint32_t pt_irqpin_reg_init(struct pt_dev *ptdev, struct pt_reg_info_tbl *reg, uint32_t real_offset) { - return ptdev->dev.config[real_offset]; + return pci_read_intx(ptdev); } /* initialize BAR */ @@ -4471,6 +4471,11 @@ int pt_init(PCIBus *e_bus) return 0; } +static uint8_t pci_read_intx(struct pt_dev *ptdev) +{ + return pci_read_byte(ptdev->pci_dev, PCI_INTERRUPT_PIN); +} + /* The PCI Local Bus Specification, Rev. 3.0, * Section 6.2.4 Miscellaneous Registers, pp 223 * outlines 5 valid values for the intertupt pin (intx). @@ -4499,9 +4504,9 @@ int pt_init(PCIBus *e_bus) * 4 | 3 | INTD# * any other value | 0 | This should never happen, log error message */ -static uint8_t pci_read_intx(struct pt_dev *ptdev) +uint8_t pci_intx(struct pt_dev *ptdev) { - uint8_t r_val = pci_read_byte(ptdev->pci_dev, PCI_INTERRUPT_PIN); + uint8_t r_val = pci_read_intx(ptdev); PT_LOG("intx=%i\n", r_val); if (r_val < 1 || r_val > 4) @@ -4517,14 +4522,3 @@ static uint8_t pci_read_intx(struct pt_d return r_val; } - -/* - * For virtual function 0, always use INTA#, - * otherwise use the hardware value - */ -uint8_t pci_intx(struct pt_dev *ptdev) -{ - if (!PCI_FUNC(ptdev->dev.devfn)) - return 0; - return pci_read_intx(ptdev); -}