Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] PCI/CXL: Distinguish CXL capabilities in MCAP
@ 2026-08-17  7:58 penn
  2026-08-17  7:58 ` [PATCH v2 1/2] PCI: Add MMIO Capabilities Register Block definitions penn
  2026-08-17  7:58 ` [PATCH v2 2/2] cxl/core: Skip non-CXL capabilities in MCAP penn
  0 siblings, 2 replies; 5+ messages in thread
From: penn @ 2026-08-17  7:58 UTC (permalink / raw)
  To: linux-cxl
  Cc: linux-pci, linux-kernel, bhelgaas, dave, jic23, dave.jiang,
	alison.schofield, vishal.l.verma, ira.weiny, djbw, johnny.li,
	peng.guo, jingzhong.yang, Penn

From: Penn <engguopeng@buaa.edu.cn>

When MMPT is enabled, a device may expose PCI-SIG-defined MMPT
capabilities alongside CXL-defined capabilities in the same MMIO
Capabilities Register Block (MCAP).

MCAP capability IDs are scoped by Vendor ID, but the CXL capability
parser currently matches entries using only their capability IDs. This
can cause MMPT entries to be interpreted as CXL register blocks.

Add the generic PCI MCAP register definitions, then update the CXL
parser to reject capabilities carrying a non-zero Vendor ID other than
PCI_VENDOR_ID_CXL, while preserving compatibility with legacy CXL
capability headers.

Patch 1 adds the PCI MCAP array and capability header definitions.
Patch 2 filters non-CXL capabilities before interpreting their IDs
while continuing to accept legacy capability headers whose Vendor ID
field reads as zero.

The fix has been tested on CXL 1.1 and CXL 3.0 devices. On the
MMPT-enabled device, it prevents both Mailbox and Status capabilities
from being misidentified.

Changes in v2:
- Update the MCAP specification citation to PCIe r7.0 sec 6.35.
- Accept a zero Vendor ID for compatibility with legacy CXL devices.
- Move the u16 declaration above the u32 declaration.
- Document testing on CXL 1.1 and CXL 3.0 devices.

Penn (2):
  PCI: Add MMIO Capabilities Register Block definitions
  cxl/core: Skip non-CXL capabilities in MCAP

 drivers/cxl/core/regs.c       | 12 +++++++++++-
 include/uapi/linux/pci_regs.h | 22 ++++++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-17  8:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-17  7:58 [PATCH v2 0/2] PCI/CXL: Distinguish CXL capabilities in MCAP penn
2026-08-17  7:58 ` [PATCH v2 1/2] PCI: Add MMIO Capabilities Register Block definitions penn
2026-08-17  8:07   ` sashiko-bot
2026-08-17  7:58 ` [PATCH v2 2/2] cxl/core: Skip non-CXL capabilities in MCAP penn
2026-08-17  8:10   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox