Re: [NDCTL PATCH 1/5] cxl/test: Add test for extended linear cache support

Alison Schofield
2025-11-15T01:00:10Z

On Fri, Oct 31, 2025 at 10:39:59AM -0700, Dave Jiang wrote:
> Add a unit test that verifies the extended linear cache setup paths
> in the kernel driver. cxl_test provides a mock'd version. The test
> verifies the sysfs attribute that indicates extended linear cache support
> is correctly reported. It also verifies the sizing and offset of the
> regions and decoders.
>
> The expecation is that CFMWS covers the entire extended linear cache
> region. The first part is DRAM and second part is CXL memory in a 1:1
> setup. The start base for hardware decoders should be offsetted by the
> DRAM size.
>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
> test/cxl-elc.sh | 89 ++++++++++++++++++++++++++++++++++++++++++++++++
> test/meson.build | 2 ++
> 2 files changed, 91 insertions(+)
> create mode 100755 test/cxl-elc.sh
>
> diff --git a/test/cxl-elc.sh b/test/cxl-elc.sh
> new file mode 100755
> index 000000000000..632e859c21f3
> --- /dev/null
> +++ b/test/cxl-elc.sh
> @@ -0,0 +1,89 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (C) 2025 Intel Corporation. All rights reserved.
> +
> +. "$(dirname "$0")"/common
> +
> +rc=77
> +
> +set -ex
> +[ -d "/sys/kernel/tracing" ] || do_skip "test requires CONFIG_TRACING"
> +
> +trap 'err $LINENO' ERR
> +
> +check_prereq "jq"
> +
> +modprobe -r cxl_test
> +modprobe cxl_test extended_linear_cache=1

With 6.18, this reports a false pass when it should skip.
Make sure that param exist w something like this:

modprobe cxl_test extended_linear_cache=1
[ -f /sys/module/cxl_test/parameters/extended_linear_cache ] || \
do_skip "extended_linear_cache cxl_test param not available"

snip

> +retrieve_info
> +compare_sizes
> +compare_bases

check_dmesg and remove module before exit.

Please fixup the shellcheck complaints about needing double quotes.

snip to end