Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Dan Williams and committed by
Dave Jiang
78b8f1a7 059edcc4

+9
+9
tools/testing/cxl/test/cxl.c
··· 16 16 17 17 static int interleave_arithmetic; 18 18 static bool extended_linear_cache; 19 + static bool fail_autoassemble; 19 20 20 21 #define FAKE_QTG_ID 42 21 22 ··· 816 815 * See 'cxl list -BMPu -m cxl_mem.0,cxl_mem.4' 817 816 */ 818 817 if (!hb0 || pdev->id % 4 || pdev->id > 4 || cxld->id > 0) { 818 + default_mock_decoder(cxld); 819 + return; 820 + } 821 + 822 + /* Simulate missing cxl_mem.4 configuration */ 823 + if (hb0 && pdev->id == 4 && cxld->id == 0 && fail_autoassemble) { 819 824 default_mock_decoder(cxld); 820 825 return; 821 826 } ··· 1627 1620 MODULE_PARM_DESC(interleave_arithmetic, "Modulo:0, XOR:1"); 1628 1621 module_param(extended_linear_cache, bool, 0444); 1629 1622 MODULE_PARM_DESC(extended_linear_cache, "Enable extended linear cache support"); 1623 + module_param(fail_autoassemble, bool, 0444); 1624 + MODULE_PARM_DESC(fail_autoassemble, "Simulate missing member of an auto-region"); 1630 1625 module_init(cxl_test_init); 1631 1626 module_exit(cxl_test_exit); 1632 1627 MODULE_LICENSE("GPL v2");