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
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
pci_bridge.c
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
pci-qmp-cmds.c
pci-stub.c
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
pcie_doe.c
pcie_host.c
pcie_port.c
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
trace-events Revert "pcie_sriov: Remove num_vfs from PCIESriovPF" 2024-08-01 04:32:00 -04:00
trace.h