From: Dan Williams Date: Fri, 27 Mar 2026 05:28:20 +0000 (-0700) Subject: tools/testing/cxl: Simulate auto-assembly failure X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=78b8f1a7a4ab39cecd926d50627db3537e0f2ee9;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Ira Weiny Reviewed-by: Alison Schofield Reviewed-by: Dave Jiang Link: https://patch.msgid.link/20260327052821.440749-9-dan.j.williams@intel.com Signed-off-by: Dave Jiang --- diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c index 81e2aef3627a4..7deeb7ff7bdfd 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");