summary refs log tree commit diff stats
path: root/hw/i2c/imx_i2c.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-08-01 15:14:49 +0200
committerMichael S. Tsirkin <mst@redhat.com>2024-09-11 09:46:04 -0400
commitaa37616fb4eed38f3fc26507faf2433c998e0073 (patch)
treeb523cdd78f81bc612a2b6d139ec204d4a958ace9 /hw/i2c/imx_i2c.c
parente228d62b4af29bca698ec57efdceb46f392f5444 (diff)
downloadfocaccia-qemu-aa37616fb4eed38f3fc26507faf2433c998e0073.tar.gz
focaccia-qemu-aa37616fb4eed38f3fc26507faf2433c998e0073.zip
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>
Diffstat (limited to 'hw/i2c/imx_i2c.c')
0 files changed, 0 insertions, 0 deletions