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: <6933b7946874f_1b2e10067@dwillia2-mobl4.notmuch>
Date: Fri, 5 Dec 2025 20:56:52 -0800
From: <dan.j.williams@...el.com>
To: Bjorn Helgaas <helgaas@...nel.org>, <dan.j.williams@...el.com>
CC: Terry Bowman <terry.bowman@....com>, <dave@...olabs.net>,
	<jonathan.cameron@...wei.com>, <dave.jiang@...el.com>,
	<alison.schofield@...el.com>, <bhelgaas@...gle.com>, <shiju.jose@...wei.com>,
	<ming.li@...omail.com>, <Smita.KoralahalliChannabasappa@....com>,
	<rrichter@....com>, <dan.carpenter@...aro.org>,
	<PradeepVineshReddy.Kodamati@....com>, <lukas@...ner.de>,
	<Benjamin.Cheatham@....com>, <sathyanarayanan.kuppuswamy@...ux.intel.com>,
	<linux-cxl@...r.kernel.org>, <alucerop@....com>, <ira.weiny@...el.com>,
	<linux-kernel@...r.kernel.org>, <linux-pci@...r.kernel.org>
Subject: Re: [PATCH v13 01/25] CXL/PCI: Move CXL DVSEC definitions into
 uapi/linux/pci_regs.h

Bjorn Helgaas wrote:
> On Fri, Dec 05, 2025 at 04:41:40PM -0800, dan.j.williams@...el.com wrote:
> > Bjorn Helgaas wrote:
> > > On Mon, Nov 03, 2025 at 06:09:37PM -0600, Terry Bowman wrote:
> > > > The CXL DVSECs are currently defined in cxl/core/cxlpci.h. These are not
> > > > accessible to other subsystems. Move these to uapi/linux/pci_regs.h.
> 
> > > > +#define PCI_DVSEC_HEADER1_LENGTH_MASK  __GENMASK(31, 20)
> > > 
> > > Looks like a functional duplicate of PCI_DVSEC_HEADER1_LEN().
> > > 
> > > Why __GENMASK() instead of GENMASK()?  I don't know the purpose of
> > > __GENMASK(), but I see other include/uapi/ files using GENMASK().
> > > Maybe they're wrong?
> > > 
> > > Same questions for _BITUL() below.
> > 
> > See this commit:
> > 
> > 3c7a8e190bc5 uapi: introduce uapi-friendly macros for GENMASK
> > 
> > GENMASK() for a long time was not available to uapi headers since uapi
> > headers can only include other include/uapi/ headers, not
> > include/linux/. That commit made some common kernel bitfield helpers
> > finally available to the uapi side of the house.
> 
> So are the uses I see here wrong?
> 
>   git grep "\<GENMASK\|\<BIT\>" include/uapi/

Yes, but the build failure for userspace can be mitigated if it provides
a replacement defintion. For example, the project for CXL
user tooling locally defines:

util/bitmap.h:34:#define BIT(nr)                        (1UL << (nr))
util/bitmap.h:31:#define GENMASK(h, l) \

...to supplement the missing kernel definitions, but those predated
2023. Paolo solved the problem globally with 3c7a8e190bc5.

Otherwise, userspace projects that do not already locally define
GENMASK() but include uapi/pci_regs.h would start seeing new build
failures when they update kernel headers.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ