[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/36] hw/i386/pc_piix: Make piix_intx_routing_notifier_xen() more
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 17/36] hw/i386/pc_piix: Make piix_intx_routing_notifier_xen() more device independent |
Date: |
Fri, 19 Jan 2024 12:34:46 +0100 |
From: Bernhard Beschow <shentey@gmail.com>
This is a follow-up on commit 89965db43cce "hw/isa/piix3: Avoid Xen-specific
variant of piix3_write_config()" which introduced
piix_intx_routing_notifier_xen(). This function is implemented in board code but
accesses the PCI configuration space of the PIIX ISA function to determine the
PCI interrupt routes. Avoid this by reusing pci_device_route_intx_to_irq() which
makes piix_intx_routing_notifier_xen() more device-agnostic.
One remaining improvement would be making piix_intx_routing_notifier_xen()
agnostic towards the number of PCI interrupt routes and move it to xen-hvm.
This might be useful for possible Q35 Xen efforts but remains a future exercise
for now.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240107231623.5282-1-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/i386/pc_piix.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 042c13cdbc..abfcfe4d2b 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -92,13 +92,10 @@ static void piix_intx_routing_notifier_xen(PCIDevice *dev)
{
int i;
- /* Scan for updates to PCI link routes (0x60-0x63). */
+ /* Scan for updates to PCI link routes. */
for (i = 0; i < PIIX_NUM_PIRQS; i++) {
- uint8_t v = dev->config_read(dev, PIIX_PIRQCA + i, 1);
- if (v & 0x80) {
- v = 0;
- }
- v &= 0xf;
+ const PCIINTxRoute route = pci_device_route_intx_to_irq(dev, i);
+ const uint8_t v = route.mode == PCI_INTX_ENABLED ? route.irq : 0;
xen_set_pci_link_route(i, v);
}
}
--
2.41.0
- [PULL 07/36] accel/tcg: Remove unused tb_invalidate_phys_addr(), (continued)
- [PULL 07/36] accel/tcg: Remove unused tb_invalidate_phys_addr(), Philippe Mathieu-Daudé, 2024/01/19
- [PULL 08/36] accel/tcg: Remove tb_invalidate_phys_page() from system emulation, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 09/36] target/alpha: Extract clk_helper.c from sys_helper.c, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 10/36] target/alpha: Only build sys_helper.c on system emulation, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 11/36] system/cpu-timers: Have icount_configure() return a boolean, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 12/36] system/cpu-timers: Introduce ICountMode enumerator, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 13/36] target/arm: Ensure icount is enabled when emulating INST_RETIRED, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 14/36] util/async: Only call icount_notify_exit() if icount is enabled, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 15/36] target/sh4: Deprecate the shix machine, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 16/36] hw/block: Deprecate the TC58128 block device, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 17/36] hw/i386/pc_piix: Make piix_intx_routing_notifier_xen() more device independent,
Philippe Mathieu-Daudé <=
- [PULL 18/36] hw/pflash: refactor pflash_data_write(), Philippe Mathieu-Daudé, 2024/01/19
- [PULL 19/36] hw/pflash: use ldn_{be,le}_p and stn_{be,le}_p, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 20/36] hw/pflash: implement update buffer for block writes, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 21/36] system/replay: Restrict icount to system emulation, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 22/36] system/watchpoint: Move TCG specific code to accel/tcg/, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 23/36] cpus: Restrict 'start-powered-off' property to system emulation, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 24/36] accel: Rename accel_init_ops_interfaces() to include 'system', Philippe Mathieu-Daudé, 2024/01/19
- [PULL 26/36] hw/s390x: Rename cpu_class_init() to include 'sclp', Philippe Mathieu-Daudé, 2024/01/19
- [PULL 25/36] hw/core/cpu: Rename cpu_class_init() to include 'common', Philippe Mathieu-Daudé, 2024/01/19
- [PULL 27/36] target/i386: Rename tcg_cpu_FOO() to include 'x86', Philippe Mathieu-Daudé, 2024/01/19