[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 26/29] hw/isa/piix: Reuse PIIX3's PCI interrupt triggering in
From: |
Bernhard Beschow |
Subject: |
[PATCH v8 26/29] hw/isa/piix: Reuse PIIX3's PCI interrupt triggering in PIIX4 |
Date: |
Sat, 7 Oct 2023 14:38:34 +0200 |
Speeds up PIIX4 which resolves an old TODO. Also makes PIIX4 compatible with Xen
which relies on pci_bus_fire_intx_routing_notifier() to be fired.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/isa/piix.c | 27 +++------------------------
1 file changed, 3 insertions(+), 24 deletions(-)
diff --git a/hw/isa/piix.c b/hw/isa/piix.c
index 449c1baaab..17677c2126 100644
--- a/hw/isa/piix.c
+++ b/hw/isa/piix.c
@@ -81,27 +81,6 @@ static void piix_set_pci_irq(void *opaque, int pirq, int
level)
piix_set_pci_irq_level(s, pirq, level);
}
-static void piix4_set_irq(void *opaque, int irq_num, int level)
-{
- int i, pic_irq, pic_level;
- PIIXState *s = opaque;
- PCIBus *bus = pci_get_bus(&s->dev);
-
- /* now we change the pic irq level according to the piix irq mappings */
- /* XXX: optimize */
- pic_irq = s->dev.config[PIIX_PIRQCA + irq_num];
- if (pic_irq < ISA_NUM_IRQS) {
- /* The pic level is the logical OR of all the PCI irqs mapped to it. */
- pic_level = 0;
- for (i = 0; i < PIIX_NUM_PIRQS; i++) {
- if (pic_irq == s->dev.config[PIIX_PIRQCA + i]) {
- pic_level |= pci_bus_get_irq_level(bus, i);
- }
- }
- qemu_set_irq(s->isa_irqs_in[pic_irq], pic_level);
- }
-}
-
static void piix_request_i8259_irq(void *opaque, int irq, int level)
{
PIIXState *s = opaque;
@@ -223,7 +202,7 @@ static int piix4_post_load(void *opaque, int version_id)
s->rcr = 0;
}
- return 0;
+ return piix_post_load(opaque, version_id);
}
static int piix3_pre_save(void *opaque)
@@ -442,6 +421,7 @@ static void pci_piix_class_init(ObjectClass *klass, void
*data)
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass);
+ k->config_write = piix_write_config;
dc->reset = piix_reset;
dc->desc = "ISA bridge";
dc->hotpluggable = false;
@@ -497,7 +477,6 @@ static void piix3_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
- k->config_write = piix_write_config;
k->realize = piix3_realize;
/* 82371SB PIIX3 PCI-to-ISA bridge (Step A1) */
k->device_id = PCI_DEVICE_ID_INTEL_82371SB_0;
@@ -522,7 +501,7 @@ static void piix4_realize(PCIDevice *dev, Error **errp)
return;
}
- pci_bus_irqs(pci_bus, piix4_set_irq, s, PIIX_NUM_PIRQS);
+ pci_bus_irqs(pci_bus, piix_set_pci_irq, s, PIIX_NUM_PIRQS);
}
static void piix4_init(Object *obj)
--
2.42.0
- [PATCH v8 04/29] hw/isa/piix3: Resolve redundant PIIX_NUM_PIC_IRQS, (continued)
- [PATCH v8 04/29] hw/isa/piix3: Resolve redundant PIIX_NUM_PIC_IRQS, Bernhard Beschow, 2023/10/07
- [PATCH v8 18/29] hw/isa/piix4: Reuse struct PIIXState from PIIX3, Bernhard Beschow, 2023/10/07
- [PATCH v8 14/29] hw/isa/piix3: Drop the "3" from PIIX base class name, Bernhard Beschow, 2023/10/07
- [PATCH v8 13/29] hw/isa/piix3: Create power management controller in host device, Bernhard Beschow, 2023/10/07
- [PATCH v8 21/29] hw/isa/piix: Allow for optional PIT creation in PIIX3, Bernhard Beschow, 2023/10/07
- [PATCH v8 16/29] hw/isa/piix4: Rename "isa" attribute to "isa_irqs_in", Bernhard Beschow, 2023/10/07
- [PATCH v8 23/29] hw/isa/piix: Share PIIX3's base class with PIIX4, Bernhard Beschow, 2023/10/07
- [PATCH v8 24/29] hw/isa/piix: Reuse PIIX3 base class' realize method in PIIX4, Bernhard Beschow, 2023/10/07
- [PATCH v8 25/29] hw/isa/piix: Rename functions to be shared for PCI interrupt triggering, Bernhard Beschow, 2023/10/07
- [PATCH v8 12/29] hw/isa/piix3: Create USB controller in host device, Bernhard Beschow, 2023/10/07
- [PATCH v8 26/29] hw/isa/piix: Reuse PIIX3's PCI interrupt triggering in PIIX4,
Bernhard Beschow <=
- [PATCH v8 22/29] hw/isa/piix: Harmonize names of reset control memory regions, Bernhard Beschow, 2023/10/07
- [PATCH v8 28/29] hw/isa/piix: Implement multi-process QEMU support also for PIIX4, Bernhard Beschow, 2023/10/07
- [PATCH v8 19/29] hw/isa/piix3: Merge hw/isa/piix4.c, Bernhard Beschow, 2023/10/07
- [PATCH v8 20/29] hw/isa/piix: Allow for optional PIC creation in PIIX3, Bernhard Beschow, 2023/10/07
- [PATCH v8 29/29] hw/i386/pc_piix: Make PIIX4 south bridge usable in PC machine, Bernhard Beschow, 2023/10/07
- [PATCH v8 17/29] hw/isa/piix4: Rename reset control operations to match PIIX3, Bernhard Beschow, 2023/10/07
- [PATCH v8 15/29] hw/isa/piix4: Remove unused inbound ISA interrupt lines, Bernhard Beschow, 2023/10/07
- [PATCH v8 27/29] hw/isa/piix: Resolve duplicate code regarding PCI interrupt wiring, Bernhard Beschow, 2023/10/07
- Re: [PATCH v8 00/29] Consolidate PIIX south bridges, Chuck Zmudzinski, 2023/10/08