Skip to content

[26.04_linux-nvidia-7.3-next] CXL Type-2 device support - cxl reset and cxl type2 passthrough - #714

Draft
JiandiAnNVIDIA wants to merge 57 commits into
NVIDIA:26.04_linux-nvidia-7.3-nextfrom
JiandiAnNVIDIA:cxl-reset-and-vfio
Draft

JiandiAnNVIDIA wants to merge 57 commits into
NVIDIA:26.04_linux-nvidia-7.3-nextfrom
JiandiAnNVIDIA:cxl-reset-and-vfio

Conversation

@JiandiAnNVIDIA

@JiandiAnNVIDIA JiandiAnNVIDIA commented Nov 17, 2026 •

Copy link
Copy Markdown

Description

LP: https://bugs.launchpad.net/ubuntu/+source/linux-nvidia-bos/+bug/2174630

Enables CXL Type-2 device support for Vera-Rubin GPUs in CXL mode: CXL Reset as a PCI reset method, the arm64 cache-maintenance provider it needs, and VFIO passthrough of a CXL Type-2 device to a QEMU/KVM guest.

Series backported

# Series Ver Patches Author Origin
1 PCI/CXL: Add CXL reset support for Type 2 devices v17 19 Srirangan Madhavan https://lore.kernel.org/linux-cxl/[email protected]/
2 arm64: SMCCC cache clean/invalidate v5 2 Srirangan Madhavan https://lore.kernel.org/lkml/[email protected]/
3 vfio/pci: CXL Type-2 device passthrough v6 31 Manish Honap https://lore.kernel.org/linux-cxl/[email protected]/

Upstream prerequisites

All three are 7.4-merge-window commits, cherry-picked unmodified, and are the only non-NVIDIA: SAUCE: commits in the branch. Series 2 does not build without the two SMCCC commits, which are applied in upstream order ahead of it; the cache-maintenance fix is applied ahead of its first user instead.

  • fe7f2a805443 — firmware: smccc: Add an Arm SMCCC bus
    Provides include/linux/arm-smccc-bus.h, drivers/firmware/smccc/bus.c and the modalias plumbing.
  • d8263a131bb0 — firmware: hwrng: arm_smccc_trng: Register as an SMCCC device
    Converts smccc.c to arm_smccc_device_register(), which the cache provider also uses.
  • b2f3a170ae96 — cache: Make cpu_cache_invalidate_memregion() error out if there are no handlers
    Makes the generic framework return -ENXIO when no cache-maintenance provider is registered, instead of reporting success for a writeback that never happened. Needed by the CXL reset paths, which must not drop a decoder while the CPU may still hold dirty lines for its range.

Adaptation: v6 was written against CXL reset v15

Series 3 calls cxl_restore_state_after_pci_reset(pdev, snapshot), which in v15 was a self-contained "restore the HDM decoder" helper that took the region quiesce itself. v17 reused the name for the completion half of a prepared reset pair; it takes six arguments and is a no-op when the cache argument is NULL.

vfio cannot use v17's prepared pair in either of its two recovery paths:

  • cxl_region_quiesce_lock() is down_write() on a global rwsem.
  • pci_dev_save_and_disable() runs reset_prepare() for every device on the bus before resetting any of them, so a second CXL endpoint behind the same bridge would block on the first.
  • The low-power path's window is the guest's suspend residency, which is unbounded.

Both sites are "unplanned recovery" in v17's own terms, so they need the self-contained form. Added as one new patch:

NVIDIA: SAUCE: PCI/CXL: Recover HDM state after an unprepared reset
drivers/pci/cxl.c (+48), include/cxl/pci.h (+9)

Adds cxl_recover_state_after_pci_reset(), exported to the vfio-cxl module. It is v15's semantics rebuilt from v17's own internals — no new behaviour — and takes/releases the quiesce within the call. It also revives cxl_hdm_cache_copy_decoders(), which v17 left with no callers (see "Feedback for the series authors").

Modified patches

Five commits deviate from the posted mails. Each carries a [jan: ...] note under its (backported from ...) line.

Series Patch File(s) Change Reason
cxl reset v17 4/19 cxl: Embed decoder configuration in a standalone structure drivers/cxl/core/region.c reapplied the cxld->config sub-struct conversion on top of the existing multi-level interleave logic conflicts with SAUCE commit 5dd563b (interleave support) already in 7.3-next
SMCCC v5 2/2 cache: add SMCCC-backed cache invalidate provider drivers/firmware/smccc/smccc.c dropped the arm-rsi smccc_devices[] entry carried as context RSI device registration is not present in 7.3-next
vfio v6 4/31 PCI/CXL: Let the driver that owns the HDM range run CXL Reset drivers/pci/cxl.c, include/cxl/pci.h rebased v15-era signatures onto v17: threaded @owned through cxl_reset_cache_prepare(), dropped the unused @dev parameter, kept v17's cache-aware bodies and VF/multifunction check this patch is what promotes the CXL reset API into include/cxl/pci.h and exports it to vfio-cxl; v17 reshaped everything it touches
vfio v6 21/31 vfio/cxl: Expose the HDM memory region to the guest drivers/vfio/pci/cxl/vfio_cxl_core.c vfio_cxl_power_up() now calls cxl_recover_state_after_pci_reset() v17's same-named function is a no-op without a prepared cache
vfio v6 26/31 vfio/cxl: Restore the HDM decoder after a hot reset drivers/vfio/pci/cxl/vfio_cxl_core.c same call swap in vfio_cxl_reset_done(), plus corrected a comment claiming this path uses the same helper as the cxl_bus reset method v17 moved cxl_bus to the prepared pair, which this path cannot enter

Configuration

One [Config] patch, debian.nvidia-7.3/config/annotations, 18 entries. Symbols already satisfied by debian.master were deliberately left out.

Symbol amd64 arm64 Note
CXL_BUS, CXL_PCI, CXL_ACPI, CXL_MEM, CXL_PMEM, CXL_PORT y y CXL core built in; required for Type-2 and RAS
CXL_RESET y y hidden bool selected by CXL_BUS
CXL_MEM_RAW_COMMANDS n y
ARM_SMCCC_CACHE - y arm64 only; cache provider for CXL Reset
VFIO_CXL m m matches VFIO_PCI / VFIO_PCI_CORE; select VFIO_PCI_CORE prevents y
DEV_DAX, DEV_DAX_CXL, DEV_DAX_FSDEV, DEV_DAX_HMEM, DEV_DAX_KMEM y y required built-in by DEV_DAX_CXL=y
FWCTL y y selected by CXL_BUS when CXL_FEATURES is on
RUST_FWCTL_ABSTRACTIONS n n only visible because FWCTL is built in
ACPI_APEI_EINJ y y override debian.master m→y; ACPI_APEI_EINJ_CXL depends on CXL_BUS <= ACPI_APEI_EINJ

CXL 2.0 added 16-way memory interleaving, making the comment that the
specification supports only 8-way interleaving stale. Explain that 16 is
the largest interleave a decoder can express, without changing the limit.

Suggested-by: Jonathan Cameron <[email protected]>
Link: https://lore.kernel.org/linux-cxl/20260912003057.3db9335c@jic23-hlaptop/
Signed-off-by: Srirangan Madhavan <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Reviewed-by: Richard Cheng <[email protected]>
Reviewed-by: Li Ming <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
read_cdat_data() resolves a CXL port's upstream device to its backing PCI
device. HDM cache updates need the same mapping.

Factor the lookup into cxl_port_get_uport_pci_dev() and return a referenced
PCI device to make caller ownership explicit.

Use automatic reference cleanup in read_cdat_data(), as suggested by
Li Ming, so early returns release the PCI device reference.

Signed-off-by: Srirangan Madhavan <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Reviewed-by: Richard Cheng <[email protected]>
Reviewed-by: Li Ming <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
Move the common decoder declarations to include/cxl/cxl.h for use by
shared decoder settings. Preserve their layout and documentation.

Signed-off-by: Srirangan Madhavan <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Reviewed-by: Richard Cheng <[email protected]>
Reviewed-by: Li Ming <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
…ture

Define cxl_decoder_config independently and embed it in cxl_decoder. Update
decoder field accesses without changing behavior, so reset snapshots can
reuse the configuration type without struct_group_tagged().

Signed-off-by: Srirangan Madhavan <[email protected]>
Reviewed-by: Richard Cheng <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Reviewed-by: Li Ming <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
[jan: reapplied the cxl_decoder config sub-struct conversion onto the multi-level interleave selector/distance logic from 5dd563b]
Signed-off-by: Jiandi An <[email protected]>
Keep common decoder configuration in cxl_decoder_config and represent
endpoint DPA skip in cxl_endpoint_decoder_settings. Share range
programming, but keep endpoint skip and switch target-list writes in
their respective commit paths.

Separate commit initiation from completion waiting so reset restoration
can reuse register programming without changing normal DPA-lock policy.

Signed-off-by: Srirangan Madhavan <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Reviewed-by: Li Ming <[email protected]>
Assisted-by: LLM
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
The PCI core will restore HDM decoders after a reset, possibly while no
CXL driver is loaded, so it cannot call into cxl_core.

Move the HDM register programming helpers from hdm.c to hdm_regs.c and
build that file into the kernel whenever CXL_BUS is enabled, including
when CXL_BUS is modular. Export only the symbols that cxl_core uses.

Keep the DPA lock assertion in the normal decoder programming caller so
the register helpers do not depend on cxl_rwsem. Leave cxl_rwsem in
cxl_core until built-in cache management needs it.

Signed-off-by: Srirangan Madhavan <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Reviewed-by: Li Ming <[email protected]>
Reviewed-by: Richard Cheng <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
Factor common HDM register parsing into cxl_hdm_unpack_decoder().
Validate range and interleave parameters in locals before publishing the
decoder configuration, including enable and lock flags. Reject nonzero
ranges whose end overflows the address space while preserving the
zero-size range representation.

Read decoder base and size registers low then high through a shared
helper used by enumeration and the reset snapshot.

Read switch target lists and endpoint DPA skip in their respective
branches of init_hdm_decoder().

Preserve the decoder ID allocated by cxl_decoder_init() when publishing
the parsed configuration.

Signed-off-by: Srirangan Madhavan <[email protected]>
Assisted-by: LLM
Reviewed-by: Richard Cheng <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
Keep the region and DPA locks available to built-in CXL state management
when cxl_core is modular.

Signed-off-by: Srirangan Madhavan <[email protected]>
Reviewed-by: Richard Cheng <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
Early PCI discovery creates the HDM cache, while later CXL enumeration and
decoder operations provide updated programming state.

Refresh the PCI snapshot when decoders are enumerated, committed, or reset
so reset recovery need not walk the CXL topology. Keep cache access and
locking in the built-in HDM state helpers. Ignore updates when no cache
exists and reject decoder-count mismatches.

Use CXL_RESET for the PCI HDM cache. Shared HDM register helpers do not
require it.

Skip cache checks and updates for DVSEC-emulated decoders, which do not
use HDM registers. Keep cached global control when MMIO reads return all
ones.

Non-PCI mock ports have no upstream PCI device, so the cache helpers
ignore them. This avoids test wrappers and a circular dependency between
cxl_core and cxl_mock.

Signed-off-by: Srirangan Madhavan <[email protected]>
Assisted-by: LLM
Reviewed-by: Richard Cheng <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
Build register discovery with the built-in HDM helpers so PCI enumeration
can use it even when cxl_core is modular. Export the interfaces used by
cxl_core and preserve the BAR and offset in the register map.

Signed-off-by: Srirangan Madhavan <[email protected]>
Reviewed-by: Richard Cheng <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
Cache HDM state in pci_dev->hdm after BAR resource setup and before driver
binding, so reset can restore it without a bound CXL driver.

Limit caching to devices that advertise CXL.cache, CXL.mem, CXL Reset,
and Reset Memory Clear. Save their HDM register location, decoder
settings, and Device DVSEC state.

Validate capability reads and decoder counts, and restore PCI_COMMAND
after temporary MMIO access, reporting restoration failures. Publish the
cache under the PCI device lock and protect later updates with the DPA
lock.

Signed-off-by: Srirangan Madhavan <[email protected]>
Assisted-by: LLM
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
Implement CXL Device Reset for eligible Type 2 devices: disable CXL.cache,
perform supported writeback, drain transactions, prepare the IOMMU,
initiate reset with Memory Clear enabled, and wait for completion.

Observe the 100 ms post-reset quiet period before polling Status2, and
treat an all-ones read as not ready. Wait for the timeout the device
advertises, up to 100 seconds, and access only Status2 until reset
completion, error or expiry, as CXL 4.0 section 9.7.3 requires. Control2
cleanup runs only afterwards. Treat Control2 command bits as
transient state, restore cache policy on exit, preserve the primary error,
and abort when IOMMU preparation fails.

Reuse Device DVSEC discovery from cache initialization and keep the
reset entry point declaration private to PCI core.

Signed-off-by: Srirangan Madhavan <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
@JiandiAnNVIDIA
JiandiAnNVIDIA marked this pull request as draft November 17, 2026 00:28
@nirmoy

nirmoy commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Boro watcher review skipped

The PR watcher skips automatic boro reviews for changes with more than 50 commits. This change currently has 56 commits.

To run the review anyway, ask BaseOS_Kernel_Bot in #baseos-kernel:

review https://github.com/NVIDIA/NV-Kernels/pull/714

Head: fd7aa2c98d8d

This comment is maintained by BaseOS Reviewer. It is updated when the watcher sees a newer head.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Validation Report

Patchscan ⚠️ Missing Fixes Detected

The following upstream fix commits appear to be missing:

Details
Checking 56 commits...
checking fd7aa2c98d8d5ffb0324a25333c805f096a7fefc NVIDIA: SAUCE: [Config] CXL annotations for CXL reset and VFIO passthrough..... no upstream reference
checking 1ec8b523809a6355b5f8d4bd7caeda65c2e32e51 NVIDIA: SAUCE: selftests/vfio: Add CXL Type-2 passthrough tests..... no upstream reference
checking c61cb23111d228a4d997e671fd0809780f97043b NVIDIA: SAUCE: Documentation: vfio-pci: Document CXL Type-2 device passthrough..... no upstream reference
checking ed0e2a73a80a63e02ab983c4846083ee67f28b11 NVIDIA: SAUCE: vfio/cxl: Run the CXL reset at the vfio reset points..... no upstream reference
checking a20abad78bf1566cc872c3f91935de202f8ea3ea NVIDIA: SAUCE: vfio/cxl: Export the HDM memory region as a dma-buf..... no upstream reference
checking d5939475cbe5b564b12f460b3e8f106e18e871a1 NVIDIA: SAUCE: vfio/cxl: Describe the CXL device and decoder geometry to userspace..... no upstream reference
checking 79466de3350031c1c901b4f03fbd451fcfaa52c8 NVIDIA: SAUCE: vfio/cxl: Restore the HDM decoder after a hot reset..... no upstream reference
checking 0133a23107631406e852efcf855a0859b4d58888 NVIDIA: SAUCE: vfio/cxl: Exclude the HDM decoder registers from direct BAR access..... no upstream reference
checking fb5174449d2b6be9987f0c5bf5fccc08c5fcf6f3 NVIDIA: SAUCE: vfio/cxl: Expose the HDM decoder registers read-only to the guest..... no upstream reference
checking e6d5e873200ba6f643efaf61b6ec90810ffb7b26 NVIDIA: SAUCE: vfio/cxl: Contain HDM memory errors with memory_failure()..... no upstream reference
checking 06f1ba0fca25b1ffc5c877a6b0be295d1a56599e NVIDIA: SAUCE: vfio/cxl: Allow mmap of the HDM memory region..... no upstream reference
checking 805a10dd56a7dbfd9ebc63610ce5e368c3e13140 NVIDIA: SAUCE: vfio/cxl: Expose the HDM memory region to the guest..... no upstream reference
checking 151bfe0bbcf3a78c0b33506fc26eb057bc7487d9 NVIDIA: SAUCE: PCI/CXL: Recover HDM state after an unprepared reset..... no upstream reference
checking cc1483f1bb0608aa4c95eec36bb3797e4e7032eb NVIDIA: SAUCE: vfio/cxl: Own the whole component register BAR..... no upstream reference
checking 2087edc16ed50660012d455bcb95b07e3cd55d25 NVIDIA: SAUCE: vfio/cxl: Create the CXL memdev and set media ready at bind..... no upstream reference
checking d12b2a28ce2c0eabc88debb07c0bad88a322dddd NVIDIA: SAUCE: vfio/cxl: Add the vfio-cxl provider module skeleton..... no upstream reference
checking 2c1a04e3bfad9e39abbf54e2016b8fdcb3e4a435 NVIDIA: SAUCE: vfio/pci: Call the device provider across low-power transitions..... no upstream reference
checking 1afee6fe7535aa85893f6ab2658c602da0caa2ed NVIDIA: SAUCE: vfio/pci: Revoke and re-arm one device-specific region..... no upstream reference
checking cd499b595922a7ea66956d3c09dd2d851b540768 NVIDIA: SAUCE: vfio/pci: Route every reset point through a try-reset helper..... no upstream reference
checking 3e74245eacf0cd4ea13f2a58171bb19fe28689cf NVIDIA: SAUCE: vfio/pci: Provide an opt-out for the CXL Type-2 extensions..... no upstream reference
checking 439fece384d8a35d5f1660f724bb734b8e9f7732 NVIDIA: SAUCE: vfio/pci: Bracket PCI resets with the CXL reset hooks..... no upstream reference
checking 0e7ae9b3ba14ef8f460a75f3047885d75892ff22 NVIDIA: SAUCE: vfio/pci: Call the CXL open and close hooks around device use..... no upstream reference
checking 6b5c35f8db0cf43d7278835919e028e85929f359 NVIDIA: SAUCE: vfio/pci: Virtualize the CXL DVSEC in vfio_pci_config.c..... no upstream reference
checking 01e588b0e9c4597e3af3cc0c2ec870045ba3e9ae NVIDIA: SAUCE: vfio/pci: Refuse ioeventfds and dma-buf exports over excluded ranges..... no upstream reference
checking 751ab2fa341655fe49d3a529a4bea807290e93ed NVIDIA: SAUCE: vfio/pci: Advertise the mmap areas around excluded ranges..... no upstream reference
checking cb86d63f0019c0a49fa9710cf0a17f14e918436c NVIDIA: SAUCE: vfio/pci: Add a generic excluded-range list..... no upstream reference
checking fe25a27dd8981dba7bdf8dbac6ed3a5e146ae438 NVIDIA: SAUCE: vfio/pci: Detect CXL devices and load the CXL provider on demand..... no upstream reference
checking 0a2b03fdad7e85b06b241da250eeddf9dc39ffc4 NVIDIA: SAUCE: vfio/pci: Add the CXL provider ops registration interface..... no upstream reference
checking dd3df41a5730f35448067dc545b2ee159543c5cc NVIDIA: SAUCE: PCI: Refuse bus and slot reset below a CXL port with SBR masked..... no upstream reference
checking 0ae18a413a9c3e67d7855a9ffbe49fef0c6ebd13 NVIDIA: SAUCE: PCI/CXL: Let the driver that owns the HDM range run CXL Reset..... no upstream reference
checking 6bea339a40a0065c2891d45e43175c0db82b0273 NVIDIA: SAUCE: cxl: Move component register defines to uapi/cxl/cxl_regs.h..... no upstream reference
checking e449a7aac6bb885b310630b7764180213da8d907 NVIDIA: SAUCE: cxl/regs: Let a BAR-owning driver own the component register block..... no upstream reference
checking e62e5afe59050da6f4f7f6a8409d086bbd960f4e NVIDIA: SAUCE: cxl/regs: Split the BAR block request and ioremap helpers..... no upstream reference
checking b1a084fa42aede86278403878ecaf7dc8919a04c NVIDIA: SAUCE: cache: add SMCCC-backed cache invalidate provider..... no upstream reference
checking 7c0add862fb13e8d1f45a85bbc320b09160a3246 NVIDIA: SAUCE: arm64: smccc: add cache clean/invalidate IDs and return codes..... no upstream reference
checking af1076889c4d3752dc6ceadcf05afb3a1bdd29b9 firmware: hwrng: arm_smccc_trng: Register as an SMCCC device..... found upstream
W: Found fix commit c6e78a4080a3b310a9f61db778d6dee7bc646cb7 for d8263a131bb05398faa72ac32be54a03e48fa197
checking 705538c1ce4c5504335ce7e7243b5582c6097dea firmware: smccc: Add an Arm SMCCC bus..... found upstream
checking c77f3d9feb8d4c622faf20c58f0634412e2f8ae9 NVIDIA: SAUCE: cxl: Add KUnit checks for HDM decoder unpacking..... no upstream reference
checking 734e305597c656b821ca1b9e902176a835cb6f3a NVIDIA: SAUCE: PCI/CXL: Flush host and device caches for CXL bus reset..... no upstream reference
checking 09f30d57458ace4a3f4e61f76f9e589b0e55c106 NVIDIA: SAUCE: PCI/CXL: Restore CXL state after CXL bus reset..... no upstream reference
checking 694b91f008c38cd34410d1bbb5ab4b7160bfefd1 NVIDIA: SAUCE: PCI/CXL: Expose CXL Reset as a PCI reset method..... no upstream reference
checking 4e35e79e17aa4581524f1d8eb44186e3950ac1ec NVIDIA: SAUCE: PCI/CXL: Restore CXL state after PCI reset..... no upstream reference
checking 67fc6ee118753c53f96a2fa2ac28064b11049359 NVIDIA: SAUCE: PCI/CXL: Reject reset with unsafe function scope..... no upstream reference
checking 639f608ad9afb5d822c444fdf8463223b6b712a1 NVIDIA: SAUCE: cxl: Validate and synchronize HDM ranges around reset..... no upstream reference
checking 3f7fe18612e61db0087de06afaa0ffdaf32b7ab3 NVIDIA: SAUCE: PCI/CXL: Add CXL Device Reset sequencing..... no upstream reference
checking 545c7513d03e73c2c8037463a554ed8ed59c29bc NVIDIA: SAUCE: PCI/CXL: Cache endpoint HDM state during PCI enumeration..... no upstream reference
checking 79ba90db19fb53bc4c4e5715fb8bf3dbc028d94c NVIDIA: SAUCE: cxl: Build register block helpers into the kernel..... no upstream reference
checking 3c2e7f6960cbbfd972c28c2dba4461584128939b NVIDIA: SAUCE: cxl: Refresh cached PCI HDM decoder settings..... no upstream reference
checking 25d484e41c94e8cacd0513307e9406c5dceaf748 NVIDIA: SAUCE: cxl: Move cxl_rwsem into built-in code..... no upstream reference
checking 58f9a474347d5661e01af0791833d9f1f8d5402d NVIDIA: SAUCE: cxl: Share HDM decoder register unpacking..... no upstream reference
checking f380354387784b8de052df9ea2cd0113d80753d3 NVIDIA: SAUCE: cxl: Move HDM decoder helpers to built-in code..... no upstream reference
checking 9fad4af954eda4646d236f6f51512d3330077a9f NVIDIA: SAUCE: cxl: Introduce endpoint HDM decoder settings..... no upstream reference
checking 14de298b5c9f87441868ca6ccf9cebd47e4cf125 NVIDIA: SAUCE: cxl: Embed decoder configuration in a standalone structure..... no upstream reference
checking 64c335be1a6161f47d6862ab7362247faa1a17d7 NVIDIA: SAUCE: cxl: Move decoder declarations to shared header..... no upstream reference
checking 1f0f7017cd398541f9c4a08b9d2b14ab5dc3960c NVIDIA: SAUCE: cxl: Share CXL port upstream PCI device lookup..... no upstream reference
checking 78c05c4608d0ae33e74e19b8e990d7ef0024ff80 NVIDIA: SAUCE: cxl: Clarify decoder interleave limit..... no upstream reference
All fixes:
Fixes for af1076889c4d ("firmware: hwrng: arm_smccc_trng: Register as an SMCCC device")
          c6e78a4080a3 ("firmware: smccc: Pass only the required device probe arguments")

PR Lint ❌ Errors found

Details
Checking 56 commits...

Cherry-pick digest:
E: 734e305597c6 ("NVIDIA: SAUCE: PCI/CXL: Flush host and d"): diff MISMATCH with lore patch (add [Author: reason] annotation if intentional)
┌──────────────┬──────────────────────────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local        │ Referenced upstream / Patch subject                              │ Patch-ID   │ Subject │ SoB chain                 │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ fd7aa2c98d8d │ [SAUCE] [config] cxl annotations for cxl reset and vfio passthro │ N/A        │ N/A     │ jan                       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 1ec8b523809a │ selftests/vfio: add cxl type-2 passthrough tests                 │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ c61cb23111d2 │ documentation: vfio-pci: document cxl type-2 device passthrough  │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ ed0e2a73a80a │ vfio/cxl: run the cxl reset at the vfio reset points             │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ a20abad78bf1 │ vfio/cxl: export the hdm memory region as a dma-buf              │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ d5939475cbe5 │ vfio/cxl: describe the cxl device and decoder geometry to usersp │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 79466de33500 │ vfio/cxl: restore the hdm decoder after a hot reset              │ noted      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 0133a2310763 │ vfio/cxl: exclude the hdm decoder registers from direct bar acce │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ fb5174449d2b │ vfio/cxl: expose the hdm decoder registers read-only to the gues │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ e6d5e873200b │ vfio/cxl: contain hdm memory errors with memory_failure()        │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 06f1ba0fca25 │ vfio/cxl: allow mmap of the hdm memory region                    │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 805a10dd56a7 │ vfio/cxl: expose the hdm memory region to the guest              │ noted      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 151bfe0bbcf3 │ [SAUCE] pci/cxl: recover hdm state after an unprepared reset     │ N/A        │ N/A     │ jan                       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ cc1483f1bb06 │ vfio/cxl: own the whole component register bar                   │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 2087edc16ed5 │ vfio/cxl: create the cxl memdev and set media ready at bind      │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ d12b2a28ce2c │ vfio/cxl: add the vfio-cxl provider module skeleton              │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 2c1a04e3bfad │ vfio/pci: call the device provider across low-power transitions  │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 1afee6fe7535 │ vfio/pci: revoke and re-arm one device-specific region           │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ cd499b595922 │ vfio/pci: route every reset point through a try-reset helper     │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 3e74245eacf0 │ vfio/pci: provide an opt-out for the cxl type-2 extensions       │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 439fece384d8 │ vfio/pci: bracket pci resets with the cxl reset hooks            │ noted      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 0e7ae9b3ba14 │ vfio/pci: call the cxl open and close hooks around device use    │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 6b5c35f8db0c │ vfio/pci: virtualize the cxl dvsec in vfio_pci_config.c          │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 01e588b0e9c4 │ vfio/pci: refuse ioeventfds and dma-buf exports over excluded ra │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 751ab2fa3416 │ vfio/pci: advertise the mmap areas around excluded ranges        │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ cb86d63f0019 │ vfio/pci: add a generic excluded-range list                      │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ fe25a27dd898 │ vfio/pci: detect cxl devices and load the cxl provider on demand │ noted      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 0a2b03fdad7e │ vfio/pci: add the cxl provider ops registration interface        │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ dd3df41a5730 │ pci: refuse bus and slot reset below a cxl port with sbr masked  │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 0ae18a413a9c │ pci/cxl: let the driver that owns the hdm range run cxl reset    │ noted      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 6bea339a40a0 │ cxl: move component register defines to uapi/cxl/cxl_regs.h      │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ e449a7aac6bb │ cxl/regs: let a bar-owning driver own the component register blo │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ e62e5afe5905 │ cxl/regs: split the bar block request and ioremap helpers        │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ b1a084fa42ae │ cache: add smccc-backed cache invalidate provider                │ noted      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 7c0add862fb1 │ arm64: smccc: add cache clean/invalidate ids and return codes    │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ af1076889c4d │ d8263a131bb0 firmware: hwrng: arm_smccc_trng: Register as an SMC │ match      │ match   │ preserved + jan added     │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 705538c1ce4c │ fe7f2a805443 firmware: smccc: Add an Arm SMCCC bus               │ context    │ match   │ preserved + jan added     │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ c77f3d9feb8d │ cxl: add kunit checks for hdm decoder unpacking                  │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 734e305597c6 │ pci/cxl: flush host and device caches for cxl bus reset          │ MISMATCH   │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 09f30d57458a │ pci/cxl: restore cxl state after cxl bus reset                   │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 694b91f008c3 │ pci/cxl: expose cxl reset as a pci reset method                  │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 4e35e79e17aa │ pci/cxl: restore cxl state after pci reset                       │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 67fc6ee11875 │ pci/cxl: reject reset with unsafe function scope                 │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 639f608ad9af │ cxl: validate and synchronize hdm ranges around reset            │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 3f7fe18612e6 │ pci/cxl: add cxl device reset sequencing                         │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 545c7513d03e │ pci/cxl: cache endpoint hdm state during pci enumeration         │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 79ba90db19fb │ cxl: build register block helpers into the kernel                │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 3c2e7f6960cb │ cxl: refresh cached pci hdm decoder settings                     │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 25d484e41c94 │ cxl: move cxl_rwsem into built-in code                           │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 58f9a474347d │ cxl: share hdm decoder register unpacking                        │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ f38035438778 │ cxl: move hdm decoder helpers to built-in code                   │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 9fad4af954ed │ cxl: introduce endpoint hdm decoder settings                     │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 14de298b5c9f │ cxl: embed decoder configuration in a standalone structure       │ noted      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 64c335be1a61 │ cxl: move decoder declarations to shared header                  │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 1f0f7017cd39 │ cxl: share cxl port upstream pci device lookup                   │ match      │ found   │ ok, backporter: jan       │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 78c05c4608d0 │ cxl: clarify decoder interleave limit                            │ match      │ found   │ ok, backporter: jan       │
└──────────────┴──────────────────────────────────────────────────────────────────┴────────────┴─────────┴───────────────────────────┘

Lint: all checks passed.

@jamieNguyenNVIDIA

jamieNguyenNVIDIA commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Consolidated findings from Codex + Claude:

  1. High — provider-state use-after-free. First reported by Sashiko (as Critical), quoted by Alex Williamson. Final cdev close wakes unregister before __fput() drops the cdev's parent reference. Unbind can then free PCI-devres-owned vfio_cxl_state before the delayed release callback accesses it. Please align the allocation and teardown lifetimes.

  2. High — CXL reset/hotplug deadlock. First reported by Dave Jiang on November 16. pci_cxl_reset_prepare() introduces the cycle cxl_rwsem.region → slot reset lock → pci_rescan_remove_lock → cxl_rwsem.region, involving reset, the hotplug IRQ and removal of another CXL device. Dave observed a stock-v17 lockdep warning and a hang after widening the existing race window. Please break this cycle.

  3. High — unmasked VFIO hot reset omits host-cache maintenance. Identified by Codex, checked with Claude. vfio_cxl_reset_prepare() revokes mappings and dma-bufs but leaves dirty write-back HDM cache lines. Arm64's cache-unmap hooks are no-ops, and VFIO_DEVICE_PCI_HOT_RESET bypasses prepared CXL reset invalidation. With SBR unmasked, late writeback can target HDM after its decoder disappears. Please perform cache maintenance or refuse unsafe resets.

  4. High — provider loading can deadlock async probe. First reported by Sashiko (as High), quoted by Alex Williamson. With vfio-pci async_probe=1 or driver_async_probe=vfio-pci, probe synchronously requests unloaded vfio-cxl. Unless the provider also has async probing requested, its loader waits in async_synchronize_full() for the probe waiting on modprobe. Please load the provider outside that outstanding async probe.

  5. Medium — bind-time readiness failure disables later waits. Identified by Codex, checked with Claude. vfio_cxl_init_device() sets await_mem_active = !ret, misclassifying hardware-init timeouts and config-read -ENODEV as software initialization. Later resets skip polling and can reopen unavailable HDM. Please use Mem_HwInit_Mode and keep actual failures closed; this also avoids the up-to-256-second bind wait on software-initialized devices.

No earlier upstream report of items 3 or 5 was found in the reviewed material.

Reviewed draft head: 41c6eca401f15a13fdc7b45d7293773827a63dca.

Validation:

  • Full amd64/arm64 builds pass; targeted W=1 adds no warnings; modular CXL compiles on amd64.
  • HDM unpack KUnit passes under QEMU on both architectures (one test each). Arm64 uses neoverse-n1, ARM_LFA=n for a pre-existing LFA build failure. VFIO selftests compile only.
  • Open GPU 620.70.06 builds on amd64. Arm64 is partial: missing cross C++ prevents modeset-blob linking and leaves display symbols unresolved.
  • DOCA-OFED 2610.0.60-1 builds on both architectures for enabled real components; dummy ULP/storage stubs provide no validation.
  • Base/head configuration changes match annotations; toolchain/Rust mismatches prevent claiming a clean annotations check.

No physical CXL hardware reproduction was performed.

};
MODULE_DEVICE_TABLE(arm_smccc, smccc_cache_id_table);

static struct arm_smccc_driver smccc_cache_driver = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 — SMCCC cache instances survive driver unbind/rebind.

Successful probe allocates and registers cache, but this driver has neither a remove callback nor stored driver data. The SMCCC bus exposes normal unbind/rebind. Unbind therefore leaves the allocated instance on the cache-maintenance list; each rebind adds another instance and another firmware operation per invalidation.

cache_coherency_ops_instance_register() only adds the instance to the list; unregister and put are separate operations. A focused cleanup pattern is:

/* After successful registration in smccc_cache_probe(): */
dev_set_drvdata(&sdev->dev, cache);
static void smccc_cache_remove(struct arm_smccc_device *sdev)
{
        struct smccc_cache *cache = dev_get_drvdata(&sdev->dev);

        cache_coherency_ops_instance_unregister(&cache->cci);
        mutex_destroy(&cache->lock);
        cache_coherency_ops_instance_put(&cache->cci);
}

Add .remove = smccc_cache_remove to this driver initializer. Preserve the existing registration-failure cleanup. Unregister takes the framework write lock, which waits for the read-locked cache callbacks before destroying/freeing the instance.

This is a static ownership finding, not a reproduced hardware failure. The pattern has not been compiled or executed; validation should cover unbind/rebind, concurrent invalidation, and registration-failure cleanup. It fixes this leak, not the separate framework behavior when the last provider disappears.

@nvmochs

nvmochs commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator
  1. Medium — CXL function-reset cleanup does not consistently preserve a safe disabled state after failure.

    In drivers/pci/cxl.c, cxl_reset_quiesced() has two related error-handling problems:

    • Caching is restored after failed recovery. If an attempted reset, HDM restoration or final CPU-cache invalidation fails, the function still restores the original cache policy. When caching was originally enabled, this clears DISABLE_CACHING despite unsuccessful recovery. The prepared bus-reset path already avoids restoring caching in this situation.

    • A cleanup failure can bypass saving disabled PCI state. For example, preparation can encounter a cache-writeback timeout before attempting the reset, and restoring the cache policy can then also fail. The early if (rc) return rc skips the cleanup-error branch that calls cxl_reset_save_disabled_state(). The outer PCI reset wrapper subsequently restores PCI state even after an error, potentially re-enabling memory-space access (MSE) and bus mastering/DMA (BME). This case requires both an initial failure and a cleanup failure.

    Requested change: distinguish safely aborted preparation from an attempted reset. Preserve disabled caching/device state after failed recovery, and always save disabled PCI state when cleanup fails, while retaining the original error code.

    Origin and validation: this is inherited from reset v17, rather than introduced by Jiandi’s backport. Sashiko reported it on November 5 against patch 15/19 (https://lore.kernel.org/linux-cxl/[email protected]/) and patch 18/19 (https://lore.kernel.org/linux-cxl/[email protected]/). I found no reply resolving or disputing those reports in the refreshed thread through November 17. Source inspection and checks using the extracted function bodies with mocked helper failures confirm the control-flow problems; physical hardware consequences remain unverified.

  2. Medium — Four annotation notes are silently truncated by the Debian/Ubuntu packaging tools.

    The notes for ACPI_APEI_EINJ, DEV_DAX, DEV_DAX_CXL and DEV_DAX_KMEM contain m->y.

    The Debian/Ubuntu kernel packaging annotations parser (debian/scripts/misc/kconfig/annotations.py), used by debian/rules updateconfigs, treats the first > after note< as the end of the note. It therefore mistakes the > inside m->y for the closing delimiter and reads only Override debian.master m-. Quotation marks do not protect the arrow because this parser does not parse quoted strings.

    When the packaging tools regenerate the annotations file, they write back that truncated note, discarding the remaining explanation. The configuration values themselves are unaffected.

    Requested change: replace m->y with m to y in all four notes before regenerating the file.

  3. Low — The new annotations are outside canonical ordering.

    All 18 new entries have notes but were appended after the existing “Annotations without notes” section. The annotations serializer puts all noted entries first, alphabetically, followed by unnoted entries.

    Consequently, updateconfigs will move the new entries into the earlier noted section. The custom CXL section comment is also discarded. I reproduced this using the repository’s actual serializer.

    Requested change: correct the malformed notes first, then regenerate the annotations through the standard tool.

  4. Low — Correct the PR description’s explanation for VFIO_CXL=m.

    The setting VFIO_CXL=m is correct. The explanation that select VFIO_PCI_CORE prevents y is inaccurate:
    • select VFIO_PCI_CORE means enabling VFIO_CXL also enables the PCI core support it needs. It raises the selected symbol and does not prevent built-in (y) support.

    • The enclosing if VFIO makes VFIO_CXL depend on VFIO. Because this configuration has VFIO=m, VFIO_CXL is limited to m too.

    Suggested replacement wording:

    Matches the modular VFIO stack; the enclosing VFIO=m dependency limits VFIO_CXL to m.

    No Kconfig or annotations value needs changing. This is a PR-description correction only.

  5. Optional — Clarify the broader configuration policy.
    • Built-in CXL/DAX and DEV_DAX_KMEM=y: keep them if the intent is to preserve NVIDIA’s broader CXL boot and host-memory support. A note saying that would explain the choice. The existing references to earlier NVIDIA configuration commits may already provide sufficient justification.

    • CXL_MEM_RAW_COMMANDS=y: this enables a separate raw mailbox interface that this Type-2 provider does not use. If it is wanted for other CXL devices or debugging, briefly document that purpose. Otherwise, retaining the inherited n would avoid an unrelated change.

    These are non-blocking clarifications of intent, not correctness findings or mandatory configuration changes.

@jamieNguyenNVIDIA

Copy link
Copy Markdown
Collaborator

Consolidated findings from Codex + Claude:

  1. High — async-probe deadlock remains through PCI's locality worker. Sashiko's original finding, relayed by Alex Williamson, still applies. With async probing enabled and vfio-cxl unloaded, pci_call_probe() can run probe on a locality worker and wait in flush_work(). There current_is_async() is false, so provider loading still waits synchronously for modprobe, whose loader waits in async_synchronize_full() for the original async probe. Please move loading outside that dependency chain.

  2. High — cache-invalidation failure still permits hot reset. Codex's original cache finding is partly fixed: a successful flush is covered, but a failure only warns. The arm64 provider can return firmware errors; if it has been unbound, the empty provider list instead makes invalidation return success without flushing. Raw SBR still proceeds, so dirty HDM lines can survive decoder loss. Please prevent the reset when the required invalidation fails or no provider is available.

  3. High — CXL reset/hotplug lock cycle is unchanged. Dave Jiang's report still applies: pci_cxl_reset_prepare() holds the region lock across the slot reset, preserving region → slot → rescan/remove → region. Please break this cycle.

  4. Medium — asynchronous provider loading can leave bind deferred. Found independently by Codex and Claude. On the direct async path, loading returns -EPROBE_DEFER, but provider registration binds no device, so it does not trigger a deferred-probe pass; a runtime bind can stay pending after loading succeeds. The "requested once" flag is freed with the failed probe's VFIO object, and the retry is scheduled asynchronously again, so a missing provider defers on every attempt instead of falling back to binding without CXL. Please arrange a completion-triggered retry and preserve load state across attempts.

The provider-state use-after-free and readiness findings are fixed. Matt's reset-cleanup and annotation findings, and the SMCCC-unbind cleanup, are also addressed.

Reviewed head 926ec296c0f76b19d96a8f5787cce94a64552676.

Validation:

  • Fresh W=1 builds of drivers/vfio/pci/, drivers/pci/, drivers/cxl/ and drivers/cache/ pass on amd64 and arm64; the only warning is the pre-existing arm64 nvgrace-gpu unused variable.
  • Source-extracted checks cover the loader decisions and reset cleanup.
  • Full images, KUnit, GPU/DOCA builds and hardware tests were not rerun.

@JiandiAnNVIDIA

Copy link
Copy Markdown
Author
3. **High — CXL reset/hotplug lock cycle is unchanged.** [Dave Jiang's report](https://lore.kernel.org/all/[email protected]/) still applies: [`pci_cxl_reset_prepare()`](https://github.com/NVIDIA/NV-Kernels/blob/926ec296c0f76b19d96a8f5787cce94a64552676/drivers/pci/cxl.c#L519) holds the region lock across the slot reset, preserving region → slot → rescan/remove → region. Please break this cycle.

Defer this for now. On VR this is not exposed. Srirangan is making changes to his v18 for the fix.

The CXL reset/hotplug lock cycle Dave Jiang reported remains unfixed in this backport, by choice. pci_cxl_reset_prepare() holds the global region quiesce across the whole reset, giving cxl_rwsem.region → slot reset lock → pci_rescan_remove_lock → cxl_rwsem.region. The lock is not incidental: the HDM address range is already protected by the request_mem_region() the quiesce takes, so what the rwsem adds is blocking teardown of a committed region over the endpoint. Narrowing it needs a per-endpoint reset marker honoured by the region teardown paths — and Srirangan has now said he plans to solve it in v18 with reference counting rather than lock re-ordering, which touches the same prepare/restore interface this backport carries. A local fix would therefore have to be unpicked at re-port, and the contained alternatives are all worse: taking pci_lock_rescan_remove() first only reduces the cycle to two parties, a trylock doesn't help because the hazard is holding the lock across the SBR, and dropping it across the SBR lets a region be torn down underneath, after which the restore re-commits a stale decoder — corruption instead of a hang. Exposure here is bounded and measured: all four GPU root ports report Root Port (Slot-), so pciehp cannot bind in their hierarchy and the hotplug-driven form cannot occur; what remains needs a deliberate removal or unbind of a CXL device during an in-flight CXL bus reset.

@jamieNguyenNVIDIA

Copy link
Copy Markdown
Collaborator

Consolidated findings from Codex + Claude:

Fixed. Both previous loader findings are resolved: the async-probe deadlock (Sashiko, via Alex Williamson) and the deferred bind that could stay pending after provider loading.

Deferred. Deferring Dave Jiang's hotplug lock cycle is fine for this backport, given the reported non-hotplug VR topology and the planned v18 fix.

Remaining:

  1. High — a failed cache flush still does not stop hot reset. This is the remaining part of Codex's cache finding, independently checked with Claude. reset_check() only checks provider availability. If the actual invalidation fails, reset_prepare() sets hdm_needs_reset but returns through a void hook, so SBR still proceeds. Blocking later mappings cannot prevent existing dirty CPU lines from writing back after HDM decode disappears; the ioctl can also report success. Removing the provider between preflight and flushing still produces silent success without maintenance. Please complete checked cache maintenance after revoking mappings, through a fallible path that can abort before pci_reset_bus(), with provider availability protected through the operation.

Reviewed head fd7aa2c98d8d5ffb0324a25333c805f096a7fefc. Fresh W=1 directory/object builds pass on amd64 and arm64, with only the previously observed unused-variable warning. Source-extracted checks cover loading and reset gating; the latter still allows a raw reset after a flush error. Full images, KUnit, GPU/DOCA builds and hardware tests were not rerun.

@nvmochs

nvmochs commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Four additional findings from my re-review, but IMO these can be pursued as follow-ups.

  1. Low — Release the CXL provider on failed VFIO registration. Normal unbind is fixed. If registration fails after publishing the cdev and an open is in flight, the open can delay final VFIO release until after PCI cleanup frees the provider state. Tear down the provider on the registration error path while PCI devres is still alive. Probe error path
    (https://github.com/NVIDIA/NV-Kernels/blob/fd7aa2c98d8d/drivers/vfio/pci/vfio_pci.c#L197)

  2. Medium — Prepared CXL resets can skip a required flush if the provider disappears. cxl_reset and cxl_bus perform both flushes while the SMCCC provider stays registered. If the last provider unregisters between the availability check and a flush, the cache framework returns success on an empty list. Use a checked cache operation that reports provider absence under the same lock used for the flush. CXL flush path (https://github.com/NVIDIA/NV-Kernels/blob/fd7aa2c98d8d/drivers/cxl/core/hdm_state.c#L334) · Cache framework (https://github.com/NVIDIA/NV-Kernels/blob/fd7aa2c98d8d/lib/cache_maint.c#L61)

  3. Medium — Function-reset cleanup leaves the device disabled after an early abort. The refresh fixes the original cleanup bugs, but sets reset_attempted before the pending-transaction wait and IOMMU preparation. If either step fails, cleanup skips restoring the cache policy and saves PCI state with memory decoding and bus mastering disabled. I confirmed both cases with mocked hardware calls. Set the flag when the code reaches the hardware reset command so earlier failures can roll back. Function-reset code (https://github.com/NVIDIA/NV-Kernels/blob/fd7aa2c98d8d/drivers/pci/cxl.c#L833)

  4. Low — Update the VFIO provider-loading documentation. It still describes synchronous request_module(). Document the module soft dependency, asynchronous fallback, and rebind required if the device initially binds without the provider. Driver model documentation (https://github.com/NVIDIA/NV-Kernels/blob/fd7aa2c98d8d/Documentation/driver-api/vfio-pci-cxl.rst#L64)

Bence Csokas and others added 5 commits November 19, 2026 21:01
…o handlers

Currently, if there are no registered handlers,
cpu_cache_invalidate_memregion() returns 0. Callers are expected to check
cpu_cache_has_invalidate_memregion() and return -ENXIO themselves, instead
of calling this function. If a caller forgets to do this, they may
erroneously think the operation succeeded. This is in contrast to x86,
where cpu_cache_invalidate_memregion() itself checks if the operation is
supported, and returns -ENXIO if it is not.

Reviewed-by: Jonathan Cameron <[email protected]>
Signed-off-by: Bence Csokas <[email protected]>
Signed-off-by: Conor Dooley <[email protected]>
(cherry picked from commit b2f3a17)
Signed-off-by: Jiandi An <[email protected]>
Refuse reset unless enabled system-physical HDM ranges can be reserved
exclusively and CPU-cache invalidation is available. Invalidate before
reset and again before ending IOMMU exclusion, holding range reservations
until the second invalidation completes. A later patch places state
restoration before the second invalidation.

Userspace is expected to offline CXL.mem users before reset. The
reservation enforces this for claimed ranges: the reset fails while a
conflicting resource is claimed, and no one can claim the range during
the reset. It cannot see accesses by code that uses the range without
claiming it, which the offline expectation also covers.

Reject normalized-addressing decoders because their cached ranges are not
system physical addresses. Record Normalized Addressing in the cache when
region discovery sets it, since the cache is filled earlier. A reset that
takes its snapshot between endpoint probe and that update can still
miss it.

Ignore zero-size decoders because they map no address range. Refuse reset
when the device decodes memory through its DVSEC ranges instead of HDM
decoders, since the cache holds no range to reserve for that memory.

Hold the global cxl_rwsem.region write lock across snapshot, reset and
restoration to keep the decoder state and reserved ranges stable. This also
blocks region and decoder sysfs, region probe, poison operations, sanitize
and region-aware event tracing across CXL devices. The Memory Clear wait
lasts up to the timeout the device advertises, at most 100 seconds; cache
flushes and other reset work extend the hold.

Allow the existing CXL_REGION_INVALIDATION_TEST option to bypass missing
CPU cache invalidation for test environments without a provider.

Signed-off-by: Srirangan Madhavan <[email protected]>
Assisted-by: LLM
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
[jan: propagate the invalidation result instead of discarding it, so an
absent cache-maintenance provider fails the quiesce rather than reporting a
writeback that never happened; upstream b2f3a17 makes that case return
-ENXIO (Matt Ochs)]
Signed-off-by: Jiandi An <[email protected]>
The per-device PCI reset interface must not reset sibling functions.
Reject cxl_reset and cxl_bus for VFs, multifunction devices, and PFs with
enabled VFs.

Suggested-by: Alex Williamson <[email protected]>
Link: https://lore.kernel.org/linux-cxl/[email protected]/
Link: https://lore.kernel.org/linux-cxl/[email protected]/
Signed-off-by: Srirangan Madhavan <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Richard Cheng <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
Restore the PCI configuration needed for HDM access, followed by cached
HDM decoder and CXL Device DVSEC state. Set Lock On Commit before
recommitting a cleared locked decoder; leave surviving locked state
unchanged.

Stop at the first restoration failure and preserve a disabled PCI command
snapshot. Keep IOMMU exclusion active through restoration and post-reset
cache invalidation.

Program the decoders from built-in CXL code that takes only a mapped
register block, and keep PCI state handling in drivers/pci/cxl.c.

The restore helper structure and diagnostics follow Dave Jiang's
reference implementation on his cxl-type2-reset branch.

Signed-off-by: Srirangan Madhavan <[email protected]>
Assisted-by: LLM
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
Register cxl_reset with the PCI reset-method interface and place it before
FLR, which does not reset CXL.cache or CXL.mem protocol state.

Return -ENOTTY when device capabilities, function scope, cached HDM state,
or required cache synchronization do not permit a safe reset.

Signed-off-by: Srirangan Madhavan <[email protected]>
Reviewed-by: Richard Cheng <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
mmhonap and others added 29 commits November 19, 2026 21:01
…BR masked

A CXL port ignores the Secondary Bus Reset bit in Bridge Control unless
Unmask SBR is set in its CXL Port DVSEC (CXL r4.0 sec 8.1.5.2).
pci_reset_bus_function() already returns -ENOTTY in that case.
pci_reset_bus(), pci_probe_reset_bus() and the slot variants do not, so
they report success for a reset that reached no device below the port.

vfio-pci uses these for VFIO_DEVICE_GET_PCI_HOT_RESET_INFO and
VFIO_DEVICE_PCI_HOT_RESET. A user is then told a hot reset happened while
a CXL device below a masked port kept its state.

Return -ENOTTY from pci_probe_reset_slot() and pci_probe_reset_bus()
when the bridge above the bus is a CXL port with SBR masked.
pci_reset_bus() and pci_try_reset_bridge() probe before they reset, so
they refuse too.

Users see this in three places:
- the vfio hot reset ioctls fail (vfio reports -ENODEV when neither probe
  succeeds),
- the reset_subordinate sysfs attribute returns -ENOTTY,
- vfio-pci groups a device in a hotplug slot below such a port by bus
  instead of by slot.

Every other pci_reset_bus() caller, including the vfio bus reset at
close, is refused the same way. With one device per CXL port both
groupings have the same members.

Leave pci_bus_error_reset() as it is. AER and host bridge error recovery
call it without saving or restoring state and only map its result to
recovered or disconnect. Failing it below a masked port would turn
recovery of every CXL device there, memory expanders included, into a
disconnect; that is a CXL error handling decision, not part of this fix.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
vfio-pci-core must stay free of any CXL header dependency, so CXL Type-2
handling lives in a separate vfio-cxl module that plugs in a set of
callbacks.

Add the registration interface:
- vfio-cxl registers a single struct vfio_cxl_ops at module_init
- vfio-pci-core stores it under an rwsem.

A second registration is refused with -EBUSY.

The owner field will be used to pin vfio-cxl for the lifetime of each
bound CXL device.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
… on demand

A CXL device needs the vfio-cxl callbacks, but pulling vfio-cxl and the
CXL core in unconditionally would bloat every vfio-pci setup. Detect a
CXL Type-2 device at bind and request_module("vfio-cxl") only then, then
hand the device to the registered ops.

Each bound CXL device pins the provider through
vfio_pci_get_cxl_ops() (try_module_get) and drops it with
vfio_pci_put_cxl_ops() at release, so vfio-cxl can unload once no CXL
device is bound.

If the provider is absent the device is bound without the CXL
extensions. A built-in provider whose initcall has not run yet is waited
for with -EPROBE_DEFER; the deferred-probe machinery will retry the bind
once the provider registers.

The provider .init() can return -EPROBE_DEFER when the device is not
ready yet, for example when its CXL port has not enumerated. Propagate
it so the bind is retried later. Any other init failure is non-fatal: a
CXL Type-2 device is also a valid vfio-pci device, so log the error, drop
the provider reference, leave cxl_ops NULL and continue without CXL
support.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
[jan: never load the provider synchronously from probe, and carry a softdep on vfio-cxl so userspace loads it first; pci_call_probe() can run probe on a NUMA locality worker it waits for under an async probe, which current_is_async() cannot detect, and modprobe would then block in async_synchronize_full(). Fall back to binding without CXL instead of deferring, because registering the provider binds no device and so retriggers no deferred probe (Sashiko via Alex Williamson, Jamie Nguyen)]
[jan: release the provider from vfio_pci_core_unregister_device() and make the release idempotent; the vfio_device release op can run after unbind has already freed the devres-owned provider state (Sashiko, via Alex Williamson)]
[jan: also release the provider from the vfio_pci_core_register_device() error path; a registration failure after the cdev is published can leave an open in flight that delays the final release past PCI cleanup (Matt Ochs)]
Signed-off-by: Jiandi An <[email protected]>
A provider such as vfio-cxl needs to keep sub-ranges of a BAR off the
direct guest path and serve them through its own trap. vfio-pci-core
already has one such window, the MSI-X table, open-coded in
vfio_pci_bar_rw().

Add vfio_pci_core_add_excluded_range(). Each BAR has its own list,
sorted by start, and an insert that overlaps a range on the same BAR or
ends past the BAR fails with -EINVAL. Ranges are added only while the
device is being opened and are freed in vfio_pci_core_disable(), so
readers on an open device take no lock.

The MSI-X table is virtualized in vfio_pci_bar_rw() by an open-coded
x_start/x_end window that fills reads with -1 and drops writes. Register
the MSI-X table as a read and write excluded range when the MSI-X
capability is parsed in vfio_pci_core_enable(), and walk the BAR's
ranges in order in vfio_pci_bar_rw(), so an access that spans several
ranges is handled in one pass. Only the part of the table inside its BAR
is registered, so a device whose MSI-X capability points outside the BAR
still opens, as before. The ROM BAR keeps its trailing -1 window,
outside the list.

No behavioral change for an MSI-X table in a standard BAR: an access to
it still reads -1 and drops writes.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
A range excluded from mmap must not be reachable through an mmap of its
BAR. Refuse an mmap that overlaps such a range, and advertise the BAR
with a sparse mmap capability that lists the areas between the excluded
ranges, so a VMM maps those and traps the rest.

mmap is page granular, so each range is rounded out to whole pages, and
ranges that meet after rounding form one hole. The sorted list gives the
areas in two walks: the first counts them and the second fills them.

A BAR without mmap-excluded ranges gets no new capability. The MSI-X
table is excluded from read and write only, so the MSI-X BAR is
unchanged.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
…xcluded ranges

vfio_pci_bar_rw() keeps the excluded ranges of a BAR off the device, but
two other paths reach BAR MMIO without it.

An ioeventfd writes the BAR directly when it fires, through
vfio_pci_core_iowriteN(). Refuse an ioeventfd whose range overlaps a
write-excluded range, as one over the MSI-X table is already refused.

A dma-buf export of a BAR range lets an importer map it for DMA, which
reaches a range that the BAR keeps off mmap. Refuse an export whose
ranges overlap an mmap-excluded range, so the dma-buf follows the same
rule as mmap.

Suggested-by: Alex Williamson <[email protected]>
Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
A CXL Type-2 device is reprogrammable through its CXL DVSEC: a guest could
set Config Lock, toggle CXL.cache and CXL.mem enable, or rewrite the HDM
range registers that govern host memory decode. Virtualize the DVSEC so
the guest sees a shadow it cannot use to reprogram the hardware.

Build a per-device cxl_perm permission map, modeled on msi_perm. When
the device is bound through the CXL provider (e.g. vfio-cxl), the whole
CXL DVSEC is served from the vconfig shadow; only Control and Control2
are guest programmable, while Capability, Status, Lock and the Range
registers keep their firmware snapshot. A vendor DVSEC on the same
device is unaffected: the map is selected by the CXL DVSEC's range,
since every DVSEC has the same ID in the config map and two DVSECs can
be adjacent.

A Type-2 function bound without the provider (the provider is absent,
its init failed, or the extensions are disabled) gets a guard map
instead. The DVSEC reads from hardware, Control and Control2 stay
writable and the RW1C status bits stay clearable, but writes to Lock and
the Range registers are dropped, since they outlive the user. Initiate
CXL Reset uses the same doorbell; a cache write-back goes to the device.

Control2 carries the CXL reset and cache write-back-invalidate initiate
bits as self-clearing doorbells. With the provider, vfio never forwards
them to hardware, so a custom writefn synthesizes their completion in
the shadow: the initiate bit self-clears and the matching Status2 bit
(Cache Invalid or Reset Done) is set, so a guest that writes back its
cache (CXL r4.0 sec 9.6) and then runs CXL Reset (sec 9.7.2) progresses
instead of timing out. Cache Invalid is reported only while Disable
Caching is set, as the spec requires. The host performs the real cache
write-back and reset at the vfio reset points. Until a later patch in
this series runs the real reset from the doorbell, Initiate CXL Reset
completes in the shadow only.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
…ice use

vfio-pci-core frees device regions and excluded ranges on close and on a
failed open, so a CXL provider must set them up at each open.

Add open and close to the CXL ops and call them from the common enable
and close paths. A failed open unwinds the enable in reverse order:
release the device regions, unmap the BARs, drop the excluded ranges,
then free the virtual config.

Factor the device region release and the BAR unmap out of
vfio_pci_core_disable() into helpers so the enable failure path and the
disable path share them.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
A CXL Type-2 device must quiesce its coherent link before any reset and
restore its HDM decoder state afterward, or a reset can leave the device
mastering the bus over decoders that are no longer valid. This has to
happen around every reset the PCI core drives for the device, not only
the ones VFIO issues directly, and around AER and DPC recovery, which
can reset the link without the reset callbacks.

Add:
- reset_prepare
- reset_done
- an optional error_resume to the CXL ops

Export:
- vfio_pci_core_reset_prepare()
- vfio_pci_core_reset_done()
- vfio_pci_core_error_detected()
- vfio_pci_core_error_resume()
which take the vfio device.

vfio-pci calls them from its own pci_error_handlers, which resolve the
driver data it owns. A variant driver that binds CXL devices calls them
from its own handlers the same way; a driver without reset_prepare,
reset_done, error_detected and resume callbacks gets no CXL support.

The provider hooks run with memory_lock held for write: vfio-pci-core
already holds it across its own hot reset, and
vfio_pci_core_reset_prepare() takes it for a reset started anywhere else
until vfio_pci_core_reset_done(). The hot reset records its task, so a
reset that another task starts meanwhile waits for memory_lock instead
of skipping it. pci_dev_lock() blocks user config access, which a
PCI_COMMAND write can be waiting for while it holds memory_lock, so
reset_prepare lets config access through while it waits. reset_done
returns an error when the provider could not restore its device, and
VFIO_DEVICE_PCI_HOT_RESET returns that error; for any other reset the
provider logs it.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
[jan: added an optional reset_flush provider callback, invoked with memory_lock held after every device in the set has had its mappings and dma-bufs revoked and before pci_reset_bus(), so the provider can complete the cache maintenance a raw bus reset skips and refuse the reset if it fails (Jamie Nguyen)]
Signed-off-by: Jiandi An <[email protected]>
…ions

Let an admin or a variant driver keep the CXL Type-2 extensions out of
the path and bind the device without them.

Add a vfio_pci.disable_cxl module parameter, and let a variant driver set
vdev->disable_cxl in its own init callback for per-device control. The
parameter is built only when the CXL provider is configured.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
…helper

A provider such as vfio-cxl must reset its device itself: a CXL Type-2
function must not take an FLR, and its reset changes what the provider
lets the fault path map. vfio-pci-core resets a function at five points:
enable, close, VFIO_DEVICE_RESET, a virtualized PCIe or AF FLR, and the
guest's CXL Reset doorbell in the virtualized CXL DVSEC.

Add a mandatory reset op to the provider ops, and refuse to register ops
without it. Add vfio_pci_try_reset_function(), which keeps the trylock
of pci_try_reset_function(): it returns -EAGAIN when the device lock is
contended, and otherwise runs the provider's reset with the device lock
and memory_lock held. The close path keeps its bridge and device trylock
and calls a locked variant. vfio_pci_try_reset_function() saves the PCI
state first, as pci_try_reset_function() does, for the provider's reset
to restore. The locked variant does not save: on close the reset must
restore the open-time state that vfio_pci_core_disable() has just
loaded. A failed save is returned and the reset is not attempted.

The enable path still fails only on -EAGAIN. A provider checks at bind
that it can reset the device, so reset_works is set for a provider
device whatever the result of the first reset.

The CXL Reset doorbell now runs the reset and reports its result in
Status2: Reset Error on failure, Reset Done on success.

Suggested-by: Alex Williamson <[email protected]>
Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
The BARs of a vfio PCI device follow the memory enable bit: clearing it
zaps their mmaps and revokes their dma-bufs, and setting it re-arms the
dma-bufs. A device-specific region does not have to follow that bit. The
HDM memory region of a CXL Type-2 device follows the committed HDM
decoder, which changes across reset, bus reset and low power, not with
Memory Space Enable. Other device-specific regions, such as nvgrace
coherent memory or the IGD OpRegion, do not depend on it either.

Record the region index of each dma-buf at export. vfio_pci_dma_buf_move()
now moves only the BAR dma-bufs, and vfio_pci_dma_buf_cleanup() still
drains every dma-buf of the device.

Export vfio_pci_core_revoke_region(), which zaps the user mmaps of one
device-specific region and revokes its dma-bufs, and
vfio_pci_core_rearm_region(), which re-arms them. A provider calls them
under memory_lock when the state its region depends on changes. Also
export __vfio_pci_vmf_insert_pfn(), the pfn insert of
vfio_pci_vmf_insert_pfn() without its memory enable and runtime PM
checks, for the fault handler of such a region. Export
vfio_pci_core_clear_memory_enable() for a provider whose failed
operation left Memory Space off in the device: it zaps the BAR mmaps,
revokes the BAR dma-bufs and clears vfio's record of the bit.

Suggested-by: Alex Williamson <[email protected]>
Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
…ansitions

A provider may serve state that does not survive low power. A CXL Type-2
device loses its committed HDM decoder in D3hot or D3cold, and the HDM
memory region must stay out of use until the host restores the decoder.
Without a hook the provider can only keep the device in D0.

Add optional power_down and power_up ops. vfio-pci-core calls power_down
with memory_lock held for write before the device leaves D0: in
vfio_pci_set_power_state() for a lower state, and in runtime suspend
before the PCI core moves the device to low power. It calls power_up
with memory_lock held after the device is back in D0 with its config
space restored: after a guest PM control write returns the device to D0,
and in runtime resume. If a request for a lower state leaves the device
in D0, because the transition failed or a quirk keeps it there,
vfio-pci-core calls power_up at once.

The other paths that return a device to D0 either reset it afterwards
(close, VFIO_DEVICE_RESET and the hot reset ioctl), where the provider
restores its state, or tear it down (unregister).

Suggested-by: Alex Williamson <[email protected]>
Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
Add the vfio-cxl module that vfio-pci-core loads on demand for a CXL
Type-2 device, registering its callbacks at module_init. Its reset op
runs the PCI core's reset methods until vfio-cxl serves the device
memory.

vfio-cxl is a feature of vfio-pci-core rather than a variant driver, so
its Kconfig sources above the variant drivers and its objects link right
after vfio-pci-core while still being loaded on demand:
request_module("vfio-cxl") finds it by module name.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
… bind

At bind, build the CXL memory device for the passed-through Type-2
accelerator so it joins the CXL topology and its HDM region resolves to a
host physical range. A Type-2 device has no mailbox, so there is no
media-ready register to poll: set media ready directly once the component
registers validate (mirroring drivers/net/ethernet/sfc/efx_cxl.c)

As per current vfio-cxl support, reject a device with:
- more than one HDM decoder
- interleaving enabled
- whose reset the host cannot service, including the CPU cache
  invalidation that the reset needs

The CXL-core allocations are grouped with devres, in a helper that
returns on the first error, so a failed bind unwinds them: a failed init
leaves the device bound without CXL support, so devm would otherwise hold
them until unbind.

The device is not kept in D0. Low power loses the committed HDM
decoder, and the host restores the decoder configuration when the device
returns to D0. The contents of device memory across low power are the
user's to keep.

Take the bind-time copy of the cached HDM state with
pci_cxl_hdm_snapshot(), which needs no device lock: probe may run in
a worker on the device's NUMA node that does not own the lock.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
devm_cxl_probe_mem() maps the component registers through the CXL core,
which by default claims each HDM and RAS sub-block. That collides with
the full-BAR request vfio-pci-core makes when the guest opens the device.

After the component registers are discovered, declare the containing BAR
owned with cxl_reg_map_set_owned_resource(). The core then ioremaps the
sub-blocks without requesting them, so vfio-pci-core owns the whole BAR
and the requests do not collide.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
The CXL reset series restores HDM state through a prepared sequence:
pci_cxl_reset_prepare() takes the region quiesce and hands out cache
state that cxl_restore_state_after_pci_reset() must consume, releasing
the quiesce on every exit.

A driver that owns the HDM range can lose the decoder outside that
sequence. vfio-cxl loses it twice over: a low power transition clears
the committed decoder, and VFIO_DEVICE_PCI_HOT_RESET drives a plain
secondary bus reset rather than cxl_reset_bus_function().

Neither path can hold the quiesce across its window. The quiesce is an
exclusive rwsem, and a bus reset runs reset_prepare() for every device
on the bus before resetting any of them, so a second CXL endpoint
behind the same bridge would block on the first. A low power caller
would hold it for as long as the guest keeps the device suspended.

Add cxl_recover_state_after_pci_reset(), which takes and releases the
quiesce within the call. Refresh the decoder settings from the cache
first: the caller's snapshot comes from pci_cxl_hdm_snapshot() at bind,
and a region commit or teardown since then has updated the cache.
Apply the PCI command directly rather than return it, as these callers
have not stopped IOMMU translation and have nothing to defer it for.

Signed-off-by: Jiandi An <[email protected]>
A CXL Type-2 guest maps the device HDM memory to use its coherent
CXL.mem. The HDM memory is a host physical range with no struct page,
so the guest and KVM need a write-back mapping of it.

Register the range as a region under VFIO_REGION_TYPE_PCI_VENDOR_TYPE
with the CXL vendor id rather than a bespoke region type, per open
because vfio-pci-core tears down all dynamic regions on close and on a
failed open. This patch serves read and write on the region fd; mmap
follows.

Own the resolved host physical range exclusively (IORESOURCE_EXCLUSIVE)
so nothing, /dev/mem included, can map a conflicting cacheable alias
that would fault the host once the range is mapped write-back. Release
it in the provider .release op rather than through a devm action on the
PCI device, which could run after vfio-cxl has unloaded. vfio-cxl now
holds the range, so its reset op runs CXL Reset with
pci_cxl_reset_owned().

Host access to the range is safe only while the committed decoder is in
place. Track that in hdm_valid, set at bind once the decoder is verified
committed. Low power loses the decoder, so close the gate in power_down
and restore the decoder with cxl_restore_state_after_pci_reset() in
power_up, reopening the gate on success.

Device memory can stay unavailable for seconds after the decoder is back:
the device clears Memory_Active in DVSEC CXL Range 1 Size Low until the
memory is usable (CXL r4.0 sec 8.1.3.8.2).

At bind, wait up to the Memory_Active_Timeout the device reports for
Memory_Active, since a reset just before the bind also clears it. A device
whose memory then reads active brings it up by itself, and power_up waits
for Memory_Active, up to the same timeout, before it reopens the gate.

A device whose memory stays inactive relies on its driver and is not
waited for.

CXL.mem decode follows the committed decoder and Mem_Enable, not Memory
Space Enable (CXL r4.0 sec 8.2.4.20.2, 8.2.4.20.7 and 8.1.3.2), so the gate
does not check the Command register. Read and write copy through a
page-sized kernel buffer, so memory_lock is never held across a user copy.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
[jan: rebased onto v17: cxl_restore_state_after_pci_reset() became the completion half of v17's prepared reset pair and does nothing without a cache from pci_cxl_reset_prepare(); switched the vfio_cxl_power_up() decoder restore to cxl_recover_state_after_pci_reset(), which keeps the self-contained semantics this path needs because a low power caller cannot hold the region quiesce for as long as the guest stays suspended]
[jan: decide the post-reset Memory_Active wait from Mem_HwInit_Mode in the CXL DVSEC capability instead of polling at bind; the poll classified a hardware-init timeout or a config-read -ENODEV as a driver-initialised device, which skipped the wait on later resets and could reopen HDM that is not there, and it stalled every driver-initialised bind for the full Memory_Active_Timeout (Jamie Nguyen)]
Signed-off-by: Jiandi An <[email protected]>
A CXL Type-2 guest maps the device HDM memory to use its coherent
CXL.mem, so the guest and KVM need a write-back mapping of the HDM
memory region. Make the region mmap-able. The range has no struct page,
so the mapping is VM_PFNMAP and its fault handler inserts the pfn, at
huge-page order where the alignment allows.

The fault handler inserts a pfn only while the decoder is known good and
the media is ready, and returns SIGBUS otherwise. It inserts with
__vfio_pci_vmf_insert_pfn(), so a fault does not depend on memory
enable; low power already closes the gate through power_down. When the
gate closes, in low power and later in reset and bus reset, revoke the
region with vfio_pci_core_revoke_region() so no live mapping outlives
the decoder, and re-arm it once the decoder is restored. The BARs keep
following the memory enable bit; this region does not.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
The HDM memory region is mmap-able, so an fd holder can fault its
struct-page-less device memory in from the host CPU. A memory error on
that range cannot be routed through the normal struct-page path and
would otherwise escalate to a fatal host SError.

Register the range with memory_failure() via
register_pfn_address_space() so such an error is instead contained to a
SIGBUS to each process that maps the poisoned page. Provide a
pfn-to-vma-offset callback so memory_failure() can map a poisoned pfn
back to the file offset of each user mapping; the region is a single
linear range at hpa_range.start, so recover the offset the same way the
fault handler derived the pfn.

register_pfn_address_space() returns -EOPNOTSUPP when
CONFIG_MEMORY_FAILURE is off, in which case expose the region without
containment.  Unregister the range on close.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
…o the guest

A CXL Type-2 guest reads the HDM decoder registers to learn the HDM
region it was handed. Those registers live in the component BAR that
vfio-pci owns.

Map the decoder block at bind: its location comes from the pdev->hdm
enumeration cache, and vfio-pci owns the BAR, so map it without
claiming the block and expose it as a second, read-only region under
VFIO_REGION_TYPE_PCI_VENDOR_TYPE with the CXL vendor id, registered per
open like the HDM memory region.

Serve reads live from the mapped block and absorb writes without
forwarding them to hardware. The block is BAR MMIO, so it decodes only
with Memory Space enabled: serve reads under memory_lock and fail them
with -EIO while memory is disabled, as vfio_pci_bar_rw() does. A failed
decoder restore leaves Memory Space off; clear vfio's record to match.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
…t BAR access

The HDM decoder register block lives in the component BAR that vfio-pci
owns. The guest reads the decoder only through the trapped, read-only
decoder region; it must not reach the physical registers through the BAR
directly, and a write through the BAR could uncommit or move an unlocked
decoder that the host relies on.

Add the block to the generic excluded-range list with
VFIO_PCI_EXCLUDE_MMAP | VFIO_PCI_EXCLUDE_READ | VFIO_PCI_EXCLUDE_WRITE
similar to the MSI-X exclusion.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
The HDM memory fault inserts a PFN only when the decoder is in a
known-good state (cxl->hdm_valid), so the host CPU never faults the
coherent range into a disabled decoder.

VFIO_DEVICE_PCI_HOT_RESET drives a plain secondary bus reset rather than
the CXL reset sequence. A secondary bus reset only reaches a CXL
endpoint when the upstream port has SBR unmasked (CXL r4.0 sec 8.1.5.2).
With SBR masked the PCI core now refuses the bus reset, so the hot reset
fails instead of doing nothing. With SBR unmasked the reset is a Hot
Reset, which returns the decoder's RWL fields, Commit included, to their
defaults and decommits it (CXL r4.0 sec 8.2.4.20.7, Table 8-1).

Take the HDM memory region out of use in reset_prepare. In reset_done,
when the port has SBR unmasked and the decoder is no longer committed,
restore it with cxl_restore_state_after_pci_reset(), the helper the PCI
core's cxl_bus reset method uses, and put the region back. A decoder
that is still committed, after an FLR or a cxl_bus reset that restored
it itself, is left alone. If the restore fails, reset_done returns the
error, the hot reset ioctl fails with it, and the region stays out of
use until a reset succeeds. reset_done also runs after a reset method
that failed and after resets that do not reach the decoder; then put the
region back only if it was in use when reset_prepare ran. Before putting
the region back, reset_done waits for Memory_Active as power_up does, and
returns -ETIMEDOUT if the memory does not come back.

AER and DPC recovery can reset the link without reset_done. The HDM
region is taken out of use when the error is reported and put back when
recovery resumes the device only if it was in use before and the decoder
is still committed; recovery does not restore config space, so otherwise
the region stays out of use until the user resets the device. The
resume path also waits for Memory_Active before it puts the region back.

vfio_cxl_sbr_unmasked() mirrors the cxl_sbr_masked() check the PCI core
uses (drivers/pci/pci.c) for its own CXL bus reset. power_up now also
skips the restore when the decoder is still committed, as after a D3
request that left the device in D0.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
[jan: rebased onto v17: switched the vfio_cxl_reset_done() decoder restore
to cxl_recover_state_after_pci_reset() for the same reason as the power_up
path, and reworded the comment that claimed the cxl_bus reset method uses
the same helper; it now uses the prepared pair, which this path cannot
enter because a bus reset runs reset_prepare() for every device on the bus
before resetting any of them]
[jan: write back and invalidate the host CPU caches over the HDM range
before a raw bus reset, in a reset_flush provider callback that runs under
memory_lock after the mappings are revoked and refuses the reset if the
maintenance fails, since vfio_pci_zap_bars() does not reach the device-
specific HDM region and a revoke alone leaves dirty lines behind a decoder
the reset removes (Jamie Nguyen, Matt Ochs)]
Signed-off-by: Jiandi An <[email protected]>
… to userspace

Advertise the assignment with a device-info flag so a VMM can tell a CXL
Type-2 device apart from a device bound without the CXL extensions.

On the trapped decoder register region, add a capability carrying the BAR
and offset of the HDM decoder block so the VMM can place the trapped
window where the guest expects to find it.

The size of the guest's memory window comes from the HDM memory region.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
A Type-2 accelerator issues ATS-translated DMA to addresses inside its
own HDM window, so that coherent host range must be present in the
guest's IOAS (the iommufd IOAS backing the nested SMMU stage-2). iommufd
maps a struct-page-less range only by fd, via IOMMU_IOAS_MAP_FILE over a
dma-buf; a userspace-VA IOMMU_IOAS_MAP of the HDM mmap is rejected
because the VMA is VM_IO | VM_PFNMAP. Without a dma-buf the range could
only be mapped through an out-of-tree PFNMAP work-around.

vfio-pci already exports BAR memory as a P2P dma-buf, but the exporter
is BAR-only: vfio_pci_core_feature_dma_buf() rejects any region index at
or above the ROM index, and vfio_pci_core_get_dmabuf_phys() resolves the
physical range from a PCI BAR. The HDM memory region is a dynamic
device-specific region, not a BAR.

Let a device-specific region reach the device's get_dmabuf_phys(): a
region index at or above VFIO_PCI_NUM_REGIONS skips the BAR-resource
check and is validated by the driver instead, bounded to the regions
that exist. Install a CXL-aware get_dmabuf_phys() in the vfio-cxl
provider that returns cxl->hpa_range for the HDM memory region and
delegates real BARs to the core, keeping the BAR path unchanged and the
core free of CXL knowledge.

The HDM window is coherent host memory with no p2pdma provider of its
own, so borrow BAR 0's, matching nvgrace-gpu's handling of its non-BAR
device memory. The iommufd importer does not consume the provider; the
scatterlist map path (real peer DMA) is left to a follow-up once
upstream grows a negotiated interconnect for coherent CXL memory. Mark a
device-specific dma-buf so vfio_pci_dma_buf_map() refuses that path,
which would translate the range with the borrowed provider's bus offset.

The HDM dma-buf belongs to its region, not to the BARs: a memory enable
change leaves it alone, and vfio-cxl revokes and re-arms it with the
region when the decoder state changes. A new dma-buf of a
device-specific region starts in the state its region reports through a
new optional revoked() region op, so an HDM export made with memory
disabled starts armed, and one made after a failed reset starts revoked.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
A CXL Type-2 function must not take an FLR in place of CXL Reset: an FLR
leaves CXL.cache and CXL.mem state, the CXL DVSEC and the HDM contents
untouched (CXL r4.0 sec 9.5), so device memory and cache would carry one
user's data to the next. CXL Reset resets that state as well (sec 9.7).
The PCI core orders cxl_reset ahead of flr in pci_reset_fn_methods[],
but falls through to FLR when cxl_reset returns -ENOTTY.

vfio-pci-core routes its reset points through the provider reset op. In
vfio-cxl that op runs pci_cxl_reset_owned() with the HDM range claim.
The reset resets the function, clearing or randomizing volatile device
memory, and restores the HDM decoder and PCI config state, so it is a
complete replacement for pci_try_reset_function() on a CXL device. The
op runs with memory_lock and the PCI device lock held.

Take the HDM memory region out of use for the duration of the reset, so
a fault cannot insert a PFN into a decoder that is being torn down, and
put it back only once the reset has restored the decoder and the device
reports its memory active again. After CXL Reset with Memory Clear the
device can keep Memory_Active clear for seconds (about 3 s on the device
this was tested on), and a host access to the HDM range in that window
raised an SError. A reset whose memory does not come back within the
Memory_Active_Timeout fails like any other. A failed reset
returns its error and leaves the region out of use until a later CXL
Reset succeeds. Neither a decoder restore after low power nor a hot
reset reopens it in between, since device memory may still hold data the
reset was meant to clear. If a failed reset left CXL.cache or CXL.mem
disabled in the DVSEC Control register, which makes cxl_reset refuse the
device, put back the Control value taken at bind before the next reset.
A failed reset leaves Memory Space disabled; clear vfio-pci-core's
record of it to match. AER recovery does not reopen HDM after a failed
CXL Reset either.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
…ssthrough

Describe the vfio-cxl provider module:
- Address model,
- Two regions,
- Live decoder region and the guest commit,
- DVSEC virtualization,
- The dma-buf export for iommufd stage-2 mapping,
- The reset contract, including the hot reset,
- Low power

so the supported topology and the kernel/VMM split are on record.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
[jan: documented the vfio-pci soft dependency on vfio-cxl, the
request_module_nowait() fallback that binds without CXL support when the
provider is not loaded, and why the provider cannot be loaded synchronously
from probe (Jamie Nguyen)]
Signed-off-by: Jiandi An <[email protected]>
Exercise the vfio-cxl contract on a bound Type-2 device: the CXL
device-info flag and the two vendor-type regions, the HDM memory mmap
(including a 2 MB huge fault), the read-only trapped decoder region
against the live host-committed decoder, and the guest's DVSEC reset
doorbell and manual HDM discovery.

Check that the decoder register region reads fail with EIO while Memory
Space is disabled, and that the decoder reads back committed and HDM
access works after low power entry and exit.

Map the HDM memory the way a VMM does: export it as a dma-buf with
VFIO_DEVICE_FEATURE_DMA_BUF and map the fd into the IOAS with
IOMMU_IOAS_MAP_FILE. The struct-page-less range cannot be pinned through
a userspace VA, so the by-fd path is the one that works. Skip when the
kernel has no CXL dma-buf exporter, so the test becomes a real pass once
that support is present. Check that a dma-buf exported with Memory Space
disabled maps once it is enabled, that read and write on the HDM region
span several pages and may target a mapping of the region itself, and
that a multi-dword read of the decoder registers matches single-dword
reads.

Also check that close restores the config state saved at open, and that
a D3hot to D0 cycle restores the decoder, also when the device stays in
D0. The sparse mmap test accepts zero areas when the page-rounded
decoder hole covers the whole BAR. The multi-chunk read and write test
is sized in pages of the running kernel.

Add a partial-mmap path to the vfio selftest library so the trapped
component BAR maps its sparse ranges, and an __iommu_map_file() helper for
the dma-buf mapping.

Assisted-by: LLM
Signed-off-by: Manish Honap <[email protected]>
(backported from https://lore.kernel.org/linux-cxl/[email protected]/)
Signed-off-by: Jiandi An <[email protected]>
…rough

Build the CXL stack in and annotate the Kconfig symbols introduced by
the CXL reset v17, SMCCC cache clean/invalidate v5 and vfio CXL Type-2
passthrough v6 series.

CONFIG_FWCTL, CONFIG_RUST_FWCTL_ABSTRACTIONS and CONFIG_ACPI_APEI_EINJ
follow from CONFIG_CXL_BUS=y rather than being needed directly.

Based on the annotations from the Ubuntu nvidia-7.3-next branch:
commit 984a88b ("NVIDIA: VR: SAUCE: [Config] Add a CXL config for CXL type 3 devices")
commit 4280ec6 ("NVIDIA: VR: SAUCE: [Config] Enable CXL DAX and KMEM built-in for CXL memory access")
commit f8c6367 ("NVIDIA: VR: SAUCE: [Config] CXL config annotations for Type-2 device and RAS support")

Entries that debian.master already satisfies are dropped, as is
CONFIG_PCIEAER_CXL which no longer exists.

Per Matt Ochs's review, the notes are written as "m to y" rather than
"m->y": the packaging annotations parser treats the first '>' after
note< as the end of the note, so an arrow truncates the text when
updateconfigs regenerates the file. The file is serialized with
debian/scripts/misc/annotations so the entries sit in canonical order
and the tool rewrites it unchanged.
Signed-off-by: Jiandi An <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants