summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2026-03-27 08:28:20 +0300
committerDave Jiang <dave.jiang@intel.com>2026-04-01 18:12:18 +0300
commit78b8f1a7a4ab39cecd926d50627db3537e0f2ee9 (patch)
tree902e6cb765dafce59f99923722e3773383372692 /tools/testing
parent059edcc405e46cc10ee65ab2c039aa6bccfbb3a0 (diff)
downloadlinux-78b8f1a7a4ab39cecd926d50627db3537e0f2ee9.tar.xz
tools/testing/cxl: Simulate auto-assembly failure
Add a cxl_test module option to skip setting up one of the members of the default auto-assembled region. This simulates a device failing between firmware setup and OS boot, or region configuration interrupted by an event like kexec. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://patch.msgid.link/20260327052821.440749-9-dan.j.williams@intel.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/cxl/test/cxl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
index 81e2aef3627a..7deeb7ff7bdf 100644
--- a/tools/testing/cxl/test/cxl.c
+++ b/tools/testing/cxl/test/cxl.c
@@ -16,6 +16,7 @@
static int interleave_arithmetic;
static bool extended_linear_cache;
+static bool fail_autoassemble;
#define FAKE_QTG_ID 42
@@ -819,6 +820,12 @@ static void mock_init_hdm_decoder(struct cxl_decoder *cxld)
return;
}
+ /* Simulate missing cxl_mem.4 configuration */
+ if (hb0 && pdev->id == 4 && cxld->id == 0 && fail_autoassemble) {
+ default_mock_decoder(cxld);
+ return;
+ }
+
base = window->base_hpa;
if (extended_linear_cache)
base += mock_auto_region_size;
@@ -1620,6 +1627,8 @@ module_param(interleave_arithmetic, int, 0444);
MODULE_PARM_DESC(interleave_arithmetic, "Modulo:0, XOR:1");
module_param(extended_linear_cache, bool, 0444);
MODULE_PARM_DESC(extended_linear_cache, "Enable extended linear cache support");
+module_param(fail_autoassemble, bool, 0444);
+MODULE_PARM_DESC(fail_autoassemble, "Simulate missing member of an auto-region");
module_init(cxl_test_init);
module_exit(cxl_test_exit);
MODULE_LICENSE("GPL v2");