From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Bernhard Beschow" <shentey@gmail.com>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 1/6] hw/pci/pci_host: Trace config accesses on unexisting functions
Date: Wed, 4 Jan 2023 14:39:30 +0100 [thread overview]
Message-ID: <20230104133935.4639-2-philmd@linaro.org> (raw)
In-Reply-To: <20230104133935.4639-1-philmd@linaro.org>
Currently we only emit trace events for existing PCI functions.
In order to ease debugging PCI enumeration process, also emit
for unexisting functions:
$ qemu-system-foo -trace pci_cfg_\*
...
pci_cfg_read empty 00:0a.4 @0x0 -> 0xffffffff
pci_cfg_read empty 00:0a.5 @0x0 -> 0xffffffff
pci_cfg_read empty 00:0a.6 @0x0 -> 0xffffffff
pci_cfg_read empty 00:0a.7 @0x0 -> 0xffffffff
pci_cfg_read pcnet 00:0b.0 @0x0 -> 0x20001022
pci_cfg_read empty 00:0c.0 @0x0 -> 0xffffffff
pci_cfg_read empty 00:0d.0 @0x0 -> 0xffffffff
pci_cfg_read empty 00:0e.0 @0x0 -> 0xffffffff
pci_cfg_read empty 00:0f.0 @0x0 -> 0xffffffff
pci_cfg_read empty 00:10.0 @0x0 -> 0xffffffff
pci_cfg_read empty 00:11.0 @0x0 -> 0xffffffff
pci_cfg_read cirrus-vga 00:12.0 @0x0 -> 0xb81013
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/pci/pci_host.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/pci/pci_host.c b/hw/pci/pci_host.c
index eaf217ff55..ead1d3e61c 100644
--- a/hw/pci/pci_host.c
+++ b/hw/pci/pci_host.c
@@ -118,6 +118,9 @@ void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, unsigned len)
uint32_t config_addr = addr & (PCI_CONFIG_SPACE_SIZE - 1);
if (!pci_dev) {
+ trace_pci_cfg_write("empty", extract32(addr, 16, 8),
+ extract32(addr, 11, 5), extract32(addr, 8, 3),
+ config_addr, val);
return;
}
@@ -131,6 +134,9 @@ uint32_t pci_data_read(PCIBus *s, uint32_t addr, unsigned len)
uint32_t config_addr = addr & (PCI_CONFIG_SPACE_SIZE - 1);
if (!pci_dev) {
+ trace_pci_cfg_read("empty", extract32(addr, 16, 8),
+ extract32(addr, 11, 5), extract32(addr, 8, 3),
+ config_addr, ~0x0);
return ~0x0;
}
--
2.38.1
next prev parent reply other threads:[~2023-01-04 13:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-04 13:39 [PATCH 0/6] hw/mips/gt64xxx_pci: Fix endianness swap on big-endian hosts Philippe Mathieu-Daudé
2023-01-04 13:39 ` Philippe Mathieu-Daudé [this message]
2023-01-04 13:39 ` [PATCH 2/6] hw/mips/malta: Split FPGA LEDs/ASCII display updates Philippe Mathieu-Daudé
2023-01-04 13:39 ` [PATCH 3/6] hw/mips/malta: Trace " Philippe Mathieu-Daudé
2023-01-04 13:39 ` [PATCH 4/6] hw/mips/gt64xxx_pci: Accumulate address space changes Philippe Mathieu-Daudé
2023-01-04 13:39 ` [PATCH 5/6] hw/mips/gt64xxx_pci: Endian-swap using PCI_HOST_BRIDGE MemoryRegionOps Philippe Mathieu-Daudé
2023-01-23 21:52 ` Nathan Chancellor
2023-01-24 2:17 ` BALATON Zoltan
2023-02-20 22:43 ` Alex Bennée
2023-01-04 13:39 ` [PATCH 6/6] tests/avocado: Add tests booting YAMON ROM on MIPS Malta machines Philippe Mathieu-Daudé
2023-01-04 14:12 ` Philippe Mathieu-Daudé
2023-01-04 18:20 ` [PATCH 0/6] hw/mips/gt64xxx_pci: Fix endianness swap on big-endian hosts Richard Henderson
2023-01-13 8:29 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230104133935.4639-2-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=aurelien@aurel32.net \
--cc=jiaxun.yang@flygoat.com \
--cc=qemu-devel@nongnu.org \
--cc=shentey@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).