[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 57/58] pci: Display PCI IRQ pin in "info pci"
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 57/58] pci: Display PCI IRQ pin in "info pci" |
Date: |
Fri, 12 Jun 2020 10:53:07 -0400 |
From: Peter Xu <peterx@redhat.com>
Sometimes it would be good to be able to read the pin number along
with the IRQ number allocated. Since we'll dump the IRQ number, no
reason to not dump the pin information. For example, the vfio-pci
device will overwrite the pin with the hardware pin number. It would
be nice to know the pin number of one assigned device from QMP/HMP.
CC: Dr. David Alan Gilbert <dgilbert@redhat.com>
CC: Alex Williamson <alex.williamson@redhat.com>
CC: Michael S. Tsirkin <mst@redhat.com>
CC: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
CC: Julia Suvorova <jusual@redhat.com>
CC: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20200317195908.283800-1-peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
---
qapi/misc.json | 6 ++++--
hw/pci/pci.c | 1 +
monitor/hmp-cmds.c | 3 ++-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/qapi/misc.json b/qapi/misc.json
index 99b90ac80b..a5a0beb902 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -403,6 +403,8 @@
#
# @irq: if an IRQ is assigned to the device, the IRQ number
#
+# @irq_pin: the IRQ pin, zero means no IRQ (since 5.1)
+#
# @qdev_id: the device name of the PCI device
#
# @pci_bridge: if the device is a PCI bridge, the bridge information
@@ -417,8 +419,8 @@
{ 'struct': 'PciDeviceInfo',
'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
- '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
- 'regions': ['PciMemoryRegion']} }
+ '*irq': 'int', 'irq_pin': 'int', 'qdev_id': 'str',
+ '*pci_bridge': 'PciBridgeInfo', 'regions': ['PciMemoryRegion'] }}
##
# @PciInfo:
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 1b88a32cf7..a60cf3ae3b 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1776,6 +1776,7 @@ static PciDeviceInfo *qmp_query_pci_device(PCIDevice
*dev, PCIBus *bus,
info->regions = qmp_query_pci_regions(dev);
info->qdev_id = g_strdup(dev->qdev.id ? dev->qdev.id : "");
+ info->irq_pin = dev->config[PCI_INTERRUPT_PIN];
if (dev->config[PCI_INTERRUPT_PIN] != 0) {
info->has_irq = true;
info->irq = dev->config[PCI_INTERRUPT_LINE];
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 9c61e769ca..e03adf0d4d 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -688,7 +688,8 @@ static void hmp_info_pci_device(Monitor *mon, const
PciDeviceInfo *dev)
}
if (dev->has_irq) {
- monitor_printf(mon, " IRQ %" PRId64 ".\n", dev->irq);
+ monitor_printf(mon, " IRQ %" PRId64 ", pin %c\n",
+ dev->irq, (char)('A' + dev->irq_pin - 1));
}
if (dev->has_pci_bridge) {
--
MST
- [PULL v2 43/58] Support adding individual regions in libvhost-user, (continued)
- [PULL v2 43/58] Support adding individual regions in libvhost-user, Michael S. Tsirkin, 2020/06/12
- [PULL v2 44/58] Support individual region unmap in libvhost-user, Michael S. Tsirkin, 2020/06/12
- [PULL v2 45/58] Lift max ram slots limit in libvhost-user, Michael S. Tsirkin, 2020/06/12
- [PULL v2 46/58] libvhost-user: advertise vring features, Michael S. Tsirkin, 2020/06/12
- [PULL v2 47/58] hw/pci: Fix crash when running QEMU with "-nic model=rocker", Michael S. Tsirkin, 2020/06/12
- [PULL v2 51/58] acpi: make build_madt() more generic., Michael S. Tsirkin, 2020/06/12
- [PULL v2 55/58] acpi: ged: rename event memory region, Michael S. Tsirkin, 2020/06/12
- [PULL v2 52/58] acpi: create acpi-common.c and move madt code, Michael S. Tsirkin, 2020/06/12
- [PULL v2 53/58] acpi: madt: skip pci override on pci-less systems., Michael S. Tsirkin, 2020/06/12
- [PULL v2 54/58] acpi: fadt: add hw-reduced sleep register support, Michael S. Tsirkin, 2020/06/12
- [PULL v2 57/58] pci: Display PCI IRQ pin in "info pci",
Michael S. Tsirkin <=
- [PULL v2 56/58] Fix parameter type in vhost migration log path, Michael S. Tsirkin, 2020/06/12
- [PULL v2 31/58] hw/pci/pci_bridge: Correct pci_bridge_io memory region size, Michael S. Tsirkin, 2020/06/12
- [PULL v2 05/58] qtest: allow DSDT acpi table changes, Michael S. Tsirkin, 2020/06/12
- [PULL v2 04/58] tests/acpi: update expected SRAT files, Michael S. Tsirkin, 2020/06/12
- [PULL v2 02/58] diffs-allowed: add the SRAT AML to diffs-allowed, Michael S. Tsirkin, 2020/06/12
- [PULL v2 18/58] tests/acpi: Add void tables for Q35/TPM-TIS bios-tables-test, Michael S. Tsirkin, 2020/06/12
- [PULL v2 25/58] virtio-balloon: Implement support for page poison reporting feature, Michael S. Tsirkin, 2020/06/12
- [PULL v2 14/58] acpi: Convert build_tpm2() to build_append* API, Michael S. Tsirkin, 2020/06/12
- [PULL v2 32/58] hw/pci/pci_bridge: Use the IEC binary prefix definitions, Michael S. Tsirkin, 2020/06/12
- [PULL v2 17/58] test/tpm-emu: include sockets and channel headers in tpm-emu header, Michael S. Tsirkin, 2020/06/12