Re: [ndctl PATCH] test/cxl-topology.sh: test zero-sized decoders

From: Alison Schofield

Date: Thu Jul 30 2026 - 21:37:14 EST


On Thu, Jul 09, 2026 at 10:28:57AM +0800, Richard Cheng wrote:
> The kernel series [1] teaches the CXL core to enumerate committed
> zero-sized HDM decoders and adds the opt-in mock_zero_size_decoders
> cxl_test topology. Since the param defaults off, the existing ndctl
> suite never exercises that path, leaving the series without userspace
> regression coverage.
>
> After the existing default-topology checks, detect the module param with
> modinfo. When available, reload cxl_test with mock_zero_size_decoders=1,
> discover both endpoint decoders through the auto-region mapping, and
> verify that decoder IDs 1 and 2 exist with size 0 and locked set.
> Unsupported kernels retain the existing baseline coverage.
>
> Tested on arm64. The focused test passed. The full CXL suite passed and 1
> unrelated cxl-security skip. Four zero-sized endpoint decoders were
> validated, cxl_test unloaded cleanly, and no relevant dmesg errors were
> shown.
>
> [1]:
> https://lore.kernel.org/linux-cxl/20260708104024.68029-1-icheng@xxxxxxxxxx/
> Signed-off-by: Richard Cheng <icheng@xxxxxxxxxx>

Applied w some minor edits:
[as: move new work to a function and add code comments]
https://github.com/pmem/ndctl/commit/02754b5c4b60

Richard - This got me thinking about how we display these with
'cxl list'. Please take a look at my follow patches.