aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/multiarch/Makefile.target
diff options
context:
space:
mode:
authorPierrick Bouvier <pierrick.bouvier@linaro.org>2024-09-16 09:53:51 +0100
committerAlex Bennée <alex.bennee@linaro.org>2024-09-19 15:58:01 +0100
commit354b5c19b33d4a31f09022b22c1fef54f3931336 (patch)
treee117f9e128f68d494bedd03312be4672f557a197 /tests/tcg/multiarch/Makefile.target
parent7fd9ff76cccd5a5a701e462c8f2b487cba52d407 (diff)
tests/tcg/multiarch: add test for plugin memory access
Add an explicit test to check expected memory values are read/written. 8,16,32 load/store are tested for all arch. 64,128 load/store are tested for aarch64/x64. atomic operations (8,16,32,64) are tested for x64 only. By default, atomic accesses are non atomic if a single cpu is running, so we force creation of a second one by creating a new thread first. load/store helpers code path can't be triggered easily in user mode (no softmmu), so we can't test it here. Output of test-plugin-mem-access.c is the list of expected patterns in plugin output. By reading stdout, we can compare to plugins output and have a multiarch test. Can be run with: make -C build/tests/tcg/$ARCH-linux-user run-plugin-test-plugin-mem-access-with-libmem.so Tested-by: Xingtao Yao <yaoxt.fnst@fujitsu.com> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20240910172033.1427812-7-pierrick.bouvier@linaro.org> Message-Id: <20240916085400.1046925-10-alex.bennee@linaro.org>
Diffstat (limited to 'tests/tcg/multiarch/Makefile.target')
-rw-r--r--tests/tcg/multiarch/Makefile.target11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target
index 5e3391ec9d..78b83d5575 100644
--- a/tests/tcg/multiarch/Makefile.target
+++ b/tests/tcg/multiarch/Makefile.target
@@ -170,5 +170,16 @@ run-plugin-semiconsole-with-%:
TESTS += semihosting semiconsole
endif
+# Test plugin memory access instrumentation
+run-plugin-test-plugin-mem-access-with-libmem.so: \
+ PLUGIN_ARGS=$(COMMA)print-accesses=true
+run-plugin-test-plugin-mem-access-with-libmem.so: \
+ CHECK_PLUGIN_OUTPUT_COMMAND= \
+ $(SRC_PATH)/tests/tcg/multiarch/check-plugin-output.sh \
+ $(QEMU) $<
+
+test-plugin-mem-access: CFLAGS+=-pthread -O0
+test-plugin-mem-access: LDFLAGS+=-pthread -O0
+
# Update TESTS
TESTS += $(MULTIARCH_TESTS)