-bugfix: fix qmp command migrate-set-parameters -some bugfixs about ARM hot-plugged CPUs -hw/core/machine:Fix the missing consideration of cluster-id -test/tcg:Fix target-specific Makefile variable path for user-mode -tests:add (riscv virt) machine mapping to testenv -Make a litte improvement in curl and hw/riscv -qemu support for loongarch -hw/pvrdma: Protect against buggy or malious guest driver -hw/audio/intel-hda:fix stream reset -dsoundaudio:fix crackling audio recordings -add notify-vm-exit support for i386 -blok-backend: prevent dangling BDS pointers across aio_poll() -net:Fix uninitialized data usage -net/eth:Don't consider ESP to be an IPv6 option header -hw/net/vmxnet3:Log guest-triggerable errors using LOG_GUEST_ERROR Signed-off-by: FeiXu <xufei30@huawei.com>
66 lines
2.5 KiB
Diff
66 lines
2.5 KiB
Diff
From b5e972454b1c4784c6b8e163016a237c084a1b46 Mon Sep 17 00:00:00 2001
|
|
From: jianchunfu <jianchunfu_yewu@cmss.chinamobile.com>
|
|
Date: Fri, 17 Mar 2023 11:12:02 +0800
|
|
Subject: [PATCH] hw/pci: Trace IRQ routing on PCI topology
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Trace how IRQ are rooted from EP to RC.
|
|
|
|
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
|
|
Signed-off-by: jianchunfu <jianchunfu_yewu@cmss.chinamobile.com>
|
|
---
|
|
hw/pci/pci.c | 8 ++++++++
|
|
hw/pci/trace-events | 1 +
|
|
2 files changed, 9 insertions(+)
|
|
|
|
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
|
|
index b89c36ab80..96dcc738f2 100644
|
|
--- a/hw/pci/pci.c
|
|
+++ b/hw/pci/pci.c
|
|
@@ -269,11 +269,15 @@ static void pci_change_irq_level(PCIDevice *pci_dev, int irq_num, int change)
|
|
{
|
|
PCIBus *bus;
|
|
for (;;) {
|
|
+ int dev_irq = irq_num;
|
|
bus = pci_get_bus(pci_dev);
|
|
if (!bus) {
|
|
return;
|
|
}
|
|
irq_num = bus->map_irq(pci_dev, irq_num);
|
|
+ trace_pci_route_irq(dev_irq, DEVICE(pci_dev)->canonical_path, irq_num,
|
|
+ pci_bus_is_root(bus) ? "root-complex"
|
|
+ : DEVICE(bus->parent_dev)->canonical_path);
|
|
if (bus->set_irq)
|
|
break;
|
|
pci_dev = bus->parent_dev;
|
|
@@ -1531,8 +1535,12 @@ PCIINTxRoute pci_device_route_intx_to_irq(PCIDevice *dev, int pin)
|
|
PCIBus *bus;
|
|
|
|
do {
|
|
+ int dev_irq = pin;
|
|
bus = pci_get_bus(dev);
|
|
pin = bus->map_irq(dev, pin);
|
|
+ trace_pci_route_irq(dev_irq, DEVICE(dev)->canonical_path, pin,
|
|
+ pci_bus_is_root(bus) ? "root-complex"
|
|
+ : DEVICE(bus->parent_dev)->canonical_path);
|
|
dev = bus->parent_dev;
|
|
} while (dev);
|
|
|
|
diff --git a/hw/pci/trace-events b/hw/pci/trace-events
|
|
index fc777d0b5e..7e294b7e8a 100644
|
|
--- a/hw/pci/trace-events
|
|
+++ b/hw/pci/trace-events
|
|
@@ -3,6 +3,7 @@
|
|
# pci.c
|
|
pci_update_mappings_del(void *d, uint32_t bus, uint32_t slot, uint32_t func, int bar, uint64_t addr, uint64_t size) "d=%p %02x:%02x.%x %d,0x%"PRIx64"+0x%"PRIx64
|
|
pci_update_mappings_add(void *d, uint32_t bus, uint32_t slot, uint32_t func, int bar, uint64_t addr, uint64_t size) "d=%p %02x:%02x.%x %d,0x%"PRIx64"+0x%"PRIx64
|
|
+pci_route_irq(int dev_irq, const char *dev_path, int parent_irq, const char *parent_path) "IRQ %d @%s -> IRQ %d @%s"
|
|
|
|
# pci_host.c
|
|
pci_cfg_read(const char *dev, unsigned devid, unsigned fnid, unsigned offs, unsigned val) "%s %02u:%u @0x%x -> 0x%x"
|
|
--
|
|
2.27.0
|
|
|