summaryrefslogtreecommitdiff
path: root/tools/testing/cxl/cxl_port_test.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2022-12-13 08:44:24 -0800
committerDan Williams <dan.j.williams@intel.com>2023-01-05 15:01:45 -0800
commit8c149eb011be23679b3320d3939f4e3c8271969c (patch)
tree97dc644232f49ba3a64c893eeddabe42a55075c5 /tools/testing/cxl/cxl_port_test.c
parente520d52d7cabf6817b2c56d2681e9618bc5540ae (diff)
tools/testing/cxl: Prevent cxl_test from confusing production modules
The cxl_test machinery builds modified versions of the modules in drivers/cxl/ and intercepts some of their calls to allow cxl_test to inject mock CXL topologies for test. However, if cxl_test attempts the same with production modules, fireworks ensue as Luis discovered [1]. Prevent that scenario by arranging for cxl_test to check for a "watermark" symbol in each of the modules it expects to be modified before the test can run. This turns undefined runtime behavior or crashes into a safer failure to load the cxl_test module. Link: http://lore.kernel.org/r/20221209062919.1096779-1-mcgrof@kernel.org [1] Reported-by: Luis Chamberlain <mcgrof@kernel.org> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'tools/testing/cxl/cxl_port_test.c')
-rw-r--r--tools/testing/cxl/cxl_port_test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/cxl/cxl_port_test.c b/tools/testing/cxl/cxl_port_test.c
new file mode 100644
index 000000000000..be183917a9f6
--- /dev/null
+++ b/tools/testing/cxl/cxl_port_test.c
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright(c) 2022 Intel Corporation. All rights reserved. */
+
+#include "watermark.h"
+
+cxl_test_watermark(cxl_port);