qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Subject: Re: [PATCH] hw/pci: Display correct size for unmapped BARs in HMP 'info pci'
Date: Wed, 4 Jan 2023 08:29:51 +0100	[thread overview]
Message-ID: <9cf47256-2c46-d6d2-6c14-4f3a5eb8ba91@linaro.org> (raw)
In-Reply-To: <3d9d574b-7682-d06d-c8ad-27c6ec2cf6c4@linaro.org>

On 3/1/23 20:45, Philippe Mathieu-Daudé wrote:
> On 3/1/23 20:39, Philippe Mathieu-Daudé wrote:
>> On 3/1/23 18:39, BALATON Zoltan wrote:
>>> On Tue, 3 Jan 2023, Philippe Mathieu-Daudé wrote:
>>>> When a BAR is not mapped, the displayed size is shifted by 1 byte:
>>>>
>>>>  (qemu) info pci
>>>>    ...
>>>>    Bus  0, device  11, function 0:
>>>>      Ethernet controller: PCI device 1022:2000
>>>>        PCI subsystem 0000:0000
>>>>        IRQ 10, pin A
>>>>        BAR0: I/O at 0xffffffffffffffff [0x001e].
>>>>        BAR1: 32 bit memory at 0xffffffffffffffff [0x0000001e].   <===
>>>>        BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe].   <===
>>>>        id ""
>>>>    Bus  0, device  18, function 0:
>>>>      VGA controller: PCI device 1013:00b8
>>>>        PCI subsystem 1af4:1100
>>>>        BAR0: 32 bit prefetchable memory at 0x10000000 [0x11ffffff].
>>>>        BAR1: 32 bit memory at 0x12050000 [0x12050fff].
>>>>        BAR6: 32 bit memory at 0xffffffffffffffff [0x0000fffe].   <===
>>>>        id ""
>>>>
>>>> Only substract this byte when the BAR is mapped to display
>>>> the correct size:
>>>>
>>>>  (qemu) info pci
>>>>    ...
>>>>    Bus  0, device  11, function 0:
>>>>      Ethernet controller: PCI device 1022:2000
>>>>        PCI subsystem 0000:0000
>>>>        IRQ 10, pin A
>>>>        BAR0: I/O at 0xffffffffffffffff [0x001f].
>>>>        BAR1: 32 bit memory at 0xffffffffffffffff [0x0000001f].   <===
>>>>        BAR6: 32 bit memory at 0xffffffffffffffff [0x0003ffff].   <===
>>>>        id ""
>>>>    Bus  0, device  18, function 0:
>>>>      VGA controller: PCI device 1013:00b8
>>>>        PCI subsystem 1af4:1100
>>>>        BAR0: 32 bit prefetchable memory at 0x10000000 [0x11ffffff].
> 
> Hmm actually here 0x11ffffff isn't the size but the higher address,
> 
>>>>        BAR1: 32 bit memory at 0x12050000 [0x12050fff].
>>>>        BAR6: 32 bit memory at 0xffffffffffffffff [0x0000ffff].   <===
> 
> while here this is the size. Confusing. Wouldn't it be simpler to only
> display the size?
Or range and size:

   Bus  0, device  18, function 0:
     VGA controller: PCI device 1013:00b8
       PCI subsystem 1af4:1100
       BAR0: 32 bit prefetchable memory at 0x10000000-0x12000000 
[0x02000000]
       BAR1: 32 bit memory at 0x12050000-0x12051000 [0x00001000]
       BAR6: 32 bit memory at 0xffffffffffffffff-0xffffffffffffffff 
[0x00010000]




      reply	other threads:[~2023-01-04  7:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 16:48 [PATCH] hw/pci: Display correct size for unmapped BARs in HMP 'info pci' Philippe Mathieu-Daudé
2023-01-03 17:39 ` BALATON Zoltan
2023-01-03 19:39   ` Philippe Mathieu-Daudé
2023-01-03 19:45     ` Philippe Mathieu-Daudé
2023-01-04  7:29       ` Philippe Mathieu-Daudé [this message]

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=9cf47256-2c46-d6d2-6c14-4f3a5eb8ba91@linaro.org \
    --to=philmd@linaro.org \
    --cc=balaton@eik.bme.hu \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).