qemu/hw/pci
Philippe Mathieu-Daudé aa37616fb4 hw/pci/pci-hmp-cmds: Avoid displaying bogus size in 'info pci'
When BAR aren't mapped, we get:

  (qemu) info pci
    Bus  0, device   0, function 0:
      Host bridge: PCI device dead:beef
        ...
        BAR4: 32 bit memory at 0xffffffffffffffff [0x00000ffe].
        BAR5: I/O at 0xffffffffffffffff [0x0ffe].

Check the BAR is mapped comparing its address to PCI_BAR_UNMAPPED
which is what the PCI layer uses for unmapped BARs.
See pci_bar_address and pci_update_mappings implementations and
in "hw/pci/pci.h":

  typedef struct PCIIORegion {
      pcibus_t addr; /* current PCI mapping address. -1 means not mapped */
  #define PCI_BAR_UNMAPPED (~(pcibus_t)0)
      ...

This improves the logging, not displaying bogus sizes:

  (qemu) info pci
    Bus  0, device   0, function 0:
      Host bridge: PCI device dead:beef
        ...
      BAR4: 32 bit memory (not mapped)
      BAR5: I/O (not mapped)

Remove trailing dot which is not used in other commands format.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240801131449.51328-1-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2024-09-11 09:46:04 -04:00
..
Kconfig kconfig: Add PCIe devices to s390x machines 2023-07-14 11:10:57 +02:00
meson.build meson: remove CONFIG_ALL 2023-12-31 09:11:28 +01:00
msi.c hw/pci/msi: Restrict xen_is_pirq_msi() call to Xen 2024-03-09 18:51:45 +01:00
msix.c hw/pci: Constify VMState 2023-12-30 07:38:06 +11:00
pci_bridge.c pci: SLT must be RO 2023-10-04 04:53:52 -04:00
pci_host.c Revert "hw/pci: Rename has_power to enabled" 2024-08-01 04:32:00 -04:00
pci-hmp-cmds.c hw/pci/pci-hmp-cmds: Avoid displaying bogus size in 'info pci' 2024-09-11 09:46:04 -04:00
pci-internal.h hw/pci/aer: Make PCIE AER error injection facility available for other emulation to use. 2023-03-07 12:39:00 -05:00
pci-qmp-cmds.c pci: Move QMP commands to new hw/pci/pci-qmp-cmds.c 2022-12-19 16:15:17 +01:00
pci-stub.c pci: Move HMP command from hw/pci/pcie_aer.c to pci-hmp-cmds.c 2022-12-19 16:21:56 +01:00
pci.c pci: don't skip function 0 occupancy verification for devfn auto assign 2024-09-11 07:20:30 -04:00
pcie_aer.c hw/pci: Constify VMState 2023-12-30 07:38:06 +11:00
pcie_doe.c hw/pci: PCIe Data Object Exchange emulation 2022-11-07 13:12:19 -05:00
pcie_host.c include/hw/pci: Split pci_device.h off pci.h 2023-01-08 01:54:22 -05:00
pcie_port.c hw/pci: Add pcie_count_ds_port() and pcie_find_port_first() helpers 2023-03-07 19:51:07 -05:00
pcie_sriov.c Revert "pcie_sriov: Do not manually unrealize" 2024-08-01 04:32:00 -04:00
pcie.c virtio,pc,pci: features, cleanups, fixes 2024-03-13 15:11:53 +00:00
shpc.c hw/pci: add some convenient trace-events for pcie and shpc hotplug 2024-03-11 22:09:42 +01:00
slotid_cap.c include/hw/pci: Split pci_device.h off pci.h 2023-01-08 01:54:22 -05:00
trace-events Revert "pcie_sriov: Remove num_vfs from PCIESriovPF" 2024-08-01 04:32:00 -04:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00