[PATCH v2 0/2] PCI/CXL: Distinguish CXL capabilities in MCAP
penn <[email protected]>
| Newsgroups | org.kernel.vger.linux-pci,org.kernel.vger.linux-cxl,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
From: Penn <[email protected]> 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