lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250210224615.GN32480@redhat.com>
Date: Mon, 10 Feb 2025 23:46:15 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: David Laight <david.laight.linux@...il.com>
Cc: Alex Williamson <alex.williamson@...hat.com>, bhelgaas@...gle.com,
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
	mitchell.augustin@...onical.com, ilpo.jarvinen@...ux.intel.com
Subject: Re: [PATCH v2] PCI: Batch BAR sizing operations

On 02/10, David Laight wrote:
>
> On Mon, 10 Feb 2025 13:48:48 -0700
> Alex Williamson <alex.williamson@...hat.com> wrote:
>
> > On Mon, 10 Feb 2025 21:08:19 +0100
> > Oleg Nesterov <oleg@...hat.com> wrote:
> >
> > > On 02/10, Oleg Nesterov wrote:
> > > >
> > > > On 02/10, Alex Williamson wrote:
> > > > >
> > > > > --- a/drivers/pci/probe.c
> > > > > +++ b/drivers/pci/probe.c
> > > > > @@ -345,7 +345,8 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
>
> You probably need __always_inline to have any chance of a compile-time
> test of howmany.

Can't really comment...

But note that nobody else reported this problem, so I guess the newer
compilers are smart enough? Not that I am sure we can rely on it...

> > > >
> > > > 	BUILD_BUG_ON(__builtin_constant_p(howmany) && howmany > PCI_STD_NUM_BARS);
>
> 	statically_true(howmany > PCI_STD_NUM_BARS)

Indeed.

Oleg.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ