Re: [pciutils PATCH v2] lspci: Determine bridge window address size from bridge_flags

From: David Matlack

Date: Mon Aug 24 2026 - 16:58:47 EST


On Mon, Aug 24, 2026 at 1:34 PM Pali Rohár <pali@xxxxxxxxxx> wrote:
>
> On Monday 24 August 2026 13:22:32 David Matlack wrote:
> > On Mon, Aug 24, 2026 at 10:36 AM Pali Rohár <pali@xxxxxxxxxx> wrote:
> > >
> > > On Monday 24 August 2026 09:24:33 David Matlack wrote:
> > > > On Fri, Aug 21, 2026 at 4:06 PM Pali Rohár <pali@xxxxxxxxxx> wrote:
> > > > >
> > > > > Hello! Thank you for taking this issue. I briefly checked the change and
> > > > > I think that this is the right way how to address that issue.
> > > > >
> > > > > Anyway, it would be nice to provide some example of config space of PCI
> > > > > Bridge (lspci -x) which is affected by this issue and have it in
> > > > > pciutils/tests/ directory.
> > > >
> > > > Ack, I will incorporate that into a v3.
> > >
> > > Feel free to send it separately. No need to have it in this one change.
> >
> > Sure, I can send a 2 patch series in v3 if that's what you mean?
> >
> > By the way, since lspci parsing of the pciutils/tests/ directory would
> > use the dump backend, which does not use PCI_FILL_BRIDGE_BASES, it
> > will not exercise the bug fixed by this commit. Is it still worth
> > adding the test case? I am happy to send it, but I'm curious how it
> > will be used.
>
> I see. Those flags cannot be read from the PCI config space and they
> need to be provided by OS when it is doing enumeration / setup of PCI.
> So lspci -x dump outputs will not provide them.

lspci -x will provide enough information for lspci to determine the
bit-size of bridge windows. But when PCI_FILL_BRIDGE_BASES is set,
show_hypte1() ignores the flags in the config space and uses the
OS-provided flags instead, and that's where the bug was. So when
testing (./lspci -v -F tests/bridge-window-sizes), it outputted the
correct bridge windows with and without the fix.