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: <17f51c55-2355-46f0-84e3-3a76a615d9bb@amd.com>
Date: Thu, 2 Oct 2025 10:25:54 -0500
From: "Bowman, Terry" <terry.bowman@....com>
To: Jonathan Cameron <jonathan.cameron@...wei.com>
Cc: dave@...olabs.net, dave.jiang@...el.com, alison.schofield@...el.com,
 dan.j.williams@...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 v12 07/25] CXL/PCI: Move CXL DVSEC definitions into
 uapi/linux/pci_regs.h



On 10/1/2025 10:58 AM, Jonathan Cameron wrote:
> On Thu, 25 Sep 2025 17:34:22 -0500
> Terry Bowman <terry.bowman@....com> wrote:
>
>> The CXL DVSECs are currently defined in cxl/core/cxlpci.h. These are not
>> accessible to other subsystems.
>>
>> Change DVSEC name formatting to follow the existing PCI format in
>> pci_regs.h. The current format uses CXL_DVSEC_XYZ. Change to be PCI_DVSEC_CXL_XYZ.
>> Reuse the existing formatting.
>>
>> Update existing occurrences to match the name change.
>>
>> Update the inline documentation to refer to latest CXL spec version.
>>
>> Signed-off-by: Terry Bowman <terry.bowman@....com>
> Maybe we discussed it in earlier versions and I've forgotten but generally renaming
> uapi defines is a non starter.
>
> I was kind of assuming lspci used these, but nope, it uses hard coded
> value of 3 and it's own defines for the fields. (A younger me even reviewed
> the patch adding those :) )
>
> https://github.com/pciutils/pciutils/blob/master/ls-ecaps.c#L1279
>
> However, that doesn't mean other code isn't already using those defines.
>
> Minimum I think would be to state here why you think we can get away with
> this change. 
>
> Personally I'd just not bother changing that one.
>
> Jonathan
>
>

Ok, I'll leave these below as-is.

#define PCI_DVSEC_CXL_PORT                             3                                   
#define PCI_DVSEC_CXL_PORT_CTL                         0x0c                                  
#define PCI_DVSEC_CXL_PORT_CTL_UNMASK_SBR              0x00000001

Terry

>> diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
>> index f5b17745de60..bd03799612d3 100644
>> --- a/include/uapi/linux/pci_regs.h
>> +++ b/include/uapi/linux/pci_regs.h
>> @@ -1234,9 +1234,64 @@
>>  /* Deprecated old name, replaced with PCI_DOE_DATA_OBJECT_DISC_RSP_3_TYPE */
>>  #define PCI_DOE_DATA_OBJECT_DISC_RSP_3_PROTOCOL		PCI_DOE_DATA_OBJECT_DISC_RSP_3_TYPE
>>  
>> -/* Compute Express Link (CXL r3.1, sec 8.1.5) */
>> -#define PCI_DVSEC_CXL_PORT				3
> This is a userspace header. We can't rename existing definitions
> as we have no idea who is using them.   Only option would be to
> add a comment making the old ones deprecated and adding new ones alongside.
>
>
>> -#define PCI_DVSEC_CXL_PORT_CTL				0x0c
>> -#define PCI_DVSEC_CXL_PORT_CTL_UNMASK_SBR		0x00000001
> ....
>
>> +/* CXL 3.2 8.1.5: Extensions DVSEC for Ports */
>> +#define PCI_DVSEC_CXL_PORT_EXT					3
>> +#define   PCI_DVSEC_CXL_PORT_EXT_CTL_OFFSET			0x0c
>> +#define    PCI_DVSEC_CXL_PORT_EXT_CTL_UNMASK_SBR		0x00000001


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ