In preparation for moving the irq allocation into generic code, remove the pin parameter from irq__register_device and temporarily place the onus on the emulation driver to allocate the pin (which is always 1 and only used on PCI anyway). Signed-off-by: Will Deacon <will.deacon@xxxxxxx> --- tools/kvm/arm/irq.c | 2 +- tools/kvm/hw/pci-shmem.c | 6 +++--- tools/kvm/hw/vesa.c | 6 +++--- tools/kvm/include/kvm/irq.h | 2 +- tools/kvm/powerpc/irq.c | 3 +-- tools/kvm/virtio/mmio.c | 4 ++-- tools/kvm/virtio/pci.c | 6 +++--- tools/kvm/x86/irq.c | 10 +--------- 8 files changed, 15 insertions(+), 24 deletions(-) diff --git a/tools/kvm/arm/irq.c b/tools/kvm/arm/irq.c index e173e04f3668..dd53f1216c51 100644 --- a/tools/kvm/arm/irq.c +++ b/tools/kvm/arm/irq.c @@ -4,7 +4,7 @@ #include "arm-common/gic.h" -int irq__register_device(u32 dev, u8 *pin, u8 *line) +int irq__register_device(u32 dev, u8 *line) { *line = gic__alloc_irqnum(); return 0; diff --git a/tools/kvm/hw/pci-shmem.c b/tools/kvm/hw/pci-shmem.c index 701231a6ce1e..d0d88f821aba 100644 --- a/tools/kvm/hw/pci-shmem.c +++ b/tools/kvm/hw/pci-shmem.c @@ -352,7 +352,7 @@ int shmem_parser(const struct option *opt, const char *arg, int unset) int pci_shmem__init(struct kvm *kvm) { - u8 line, pin; + u8 line; char *mem; int r; @@ -360,11 +360,11 @@ int pci_shmem__init(struct kvm *kvm) return 0; /* Register good old INTx */ - r = irq__register_device(PCI_DEVICE_ID_PCI_SHMEM, &pin, &line); + r = irq__register_device(PCI_DEVICE_ID_PCI_SHMEM, &line); if (r < 0) return r; - pci_shmem_pci_device.irq_pin = pin; + pci_shmem_pci_device.irq_pin = 1; pci_shmem_pci_device.irq_line = line; /* Register MMIO space for MSI-X */ diff --git a/tools/kvm/hw/vesa.c b/tools/kvm/hw/vesa.c index 47e3a694d98b..07c3978c785e 100644 --- a/tools/kvm/hw/vesa.c +++ b/tools/kvm/hw/vesa.c @@ -55,14 +55,14 @@ static struct framebuffer vesafb; struct framebuffer *vesa__init(struct kvm *kvm) { u16 vesa_base_addr; - u8 line, pin; + u8 line; char *mem; int r; if (!kvm->cfg.vnc && !kvm->cfg.sdl && !kvm->cfg.gtk) return NULL; - r = irq__register_device(PCI_DEVICE_ID_VESA, &pin, &line); + r = irq__register_device(PCI_DEVICE_ID_VESA, &line); if (r < 0) return ERR_PTR(r); @@ -70,7 +70,7 @@ struct framebuffer *vesa__init(struct kvm *kvm) if (r < 0) return ERR_PTR(r); - vesa_pci_device.irq_pin = pin; + vesa_pci_device.irq_pin = 1; vesa_pci_device.irq_line = line; vesa_base_addr = (u16)r; vesa_pci_device.bar[0] = cpu_to_le32(vesa_base_addr | PCI_BASE_ADDRESS_SPACE_IO); diff --git a/tools/kvm/include/kvm/irq.h b/tools/kvm/include/kvm/irq.h index 5c1274b98610..20213c064b0b 100644 --- a/tools/kvm/include/kvm/irq.h +++ b/tools/kvm/include/kvm/irq.h @@ -22,7 +22,7 @@ struct pci_dev { struct list_head lines; }; -int irq__register_device(u32 dev, u8 *pin, u8 *line); +int irq__register_device(u32 dev, u8 *line); struct rb_node *irq__get_pci_tree(void); diff --git a/tools/kvm/powerpc/irq.c b/tools/kvm/powerpc/irq.c index ae9da507fb82..d906bb2840bc 100644 --- a/tools/kvm/powerpc/irq.c +++ b/tools/kvm/powerpc/irq.c @@ -32,9 +32,8 @@ * generic & cope with multiple PPC platform types. */ -int irq__register_device(u32 dev, u8 *pin, u8 *line) +int irq__register_device(u32 dev, u8 *line) { - *pin = 1; /* * Have I said how nasty I find this? Line should be dontcare... PHB * should determine which CPU/XICS IRQ to fire. diff --git a/tools/kvm/virtio/mmio.c b/tools/kvm/virtio/mmio.c index afae6a70f006..90f90ede3c1f 100644 --- a/tools/kvm/virtio/mmio.c +++ b/tools/kvm/virtio/mmio.c @@ -260,7 +260,7 @@ int virtio_mmio_init(struct kvm *kvm, void *dev, struct virtio_device *vdev, int device_id, int subsys_id, int class) { struct virtio_mmio *vmmio = vdev->virtio; - u8 pin, line; + u8 line; vmmio->addr = virtio_mmio_get_io_space_block(VIRTIO_MMIO_IO_SIZE); vmmio->kvm = kvm; @@ -277,7 +277,7 @@ int virtio_mmio_init(struct kvm *kvm, void *dev, struct virtio_device *vdev, .queue_num_max = 256, }; - if (irq__register_device(subsys_id, &pin, &line) < 0) + if (irq__register_device(subsys_id, &line) < 0) return -1; vmmio->irq = line; vmmio->dev_hdr = (struct device_header) { diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c index e1b5be6b036e..77dde3bee741 100644 --- a/tools/kvm/virtio/pci.c +++ b/tools/kvm/virtio/pci.c @@ -335,7 +335,7 @@ int virtio_pci__init(struct kvm *kvm, void *dev, struct virtio_device *vdev, int device_id, int subsys_id, int class) { struct virtio_pci *vpci = vdev->virtio; - u8 pin, line; + u8 line; int r; vpci->kvm = kvm; @@ -406,14 +406,14 @@ int virtio_pci__init(struct kvm *kvm, void *dev, struct virtio_device *vdev, vpci->pci_hdr.msix.pba_offset = cpu_to_le32(2 | PCI_IO_SIZE); vpci->config_vector = 0; - r = irq__register_device(subsys_id, &pin, &line); + r = irq__register_device(subsys_id, &line); if (r < 0) goto free_msix_mmio; if (kvm__supports_extension(kvm, KVM_CAP_SIGNAL_MSI)) vpci->features |= VIRTIO_PCI_F_SIGNAL_MSI; - vpci->pci_hdr.irq_pin = pin; + vpci->pci_hdr.irq_pin = 1; vpci->pci_hdr.irq_line = line; r = device__register(&vpci->dev_hdr); if (r < 0) diff --git a/tools/kvm/x86/irq.c b/tools/kvm/x86/irq.c index 7447c6b7d7aa..17db2110e96f 100644 --- a/tools/kvm/x86/irq.c +++ b/tools/kvm/x86/irq.c @@ -85,7 +85,7 @@ static int insert(struct rb_root *root, struct pci_dev *data) return 0; } -int irq__register_device(u32 dev, u8 *pin, u8 *line) +int irq__register_device(u32 dev, u8 *line) { struct pci_dev *node; int r; @@ -100,13 +100,6 @@ int irq__register_device(u32 dev, u8 *pin, u8 *line) *node = (struct pci_dev) { .id = dev, - /* - * PCI supports only INTA#,B#,C#,D# per device. - * A#,B#,C#,D# are allowed for multifunctional - * devices so stick with A# for our single - * function devices. - */ - .pin = 1, }; INIT_LIST_HEAD(&node->lines); @@ -126,7 +119,6 @@ int irq__register_device(u32 dev, u8 *pin, u8 *line) new->line = next_line++; *line = new->line; - *pin = node->pin; list_add(&new->node, &node->lines); -- 1.8.2.2 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html