mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
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>
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user