aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Fedorov <Alexei.Fedorov@arm.com>2020-12-14 15:18:43 +0000
committerAlexei Fedorov <Alexei.Fedorov@arm.com>2020-12-14 17:16:01 +0000
commite3c33000dcdba44e90bdd657588d7e260c06e14a (patch)
tree20830387ecf21106b84261fee61527a24c04715d
parentca8f3a88cadf66331db97e17c10719c86def03b7 (diff)
downloadtf-a-tests-e3c33000dcdba44e90bdd657588d7e260c06e14a.tar.gz
TFTF: Use MTE instructions in 'test_mte_instructions' test
This patch replaces '.inst' AArch64 machine directives with CPU Memory Tagging Extension instructions in 'test_mte_instructions' function. The test code for executing MTE instructions must be compiled with '-march=armv8.5-memtag' option which is provided by setting 'ARM_ARCH_FEATURE=memtag' and 'ARM_ARCH_MINOR=5' build flags in 'tftf_config/fvp-cpu-extensions' when this CI configuration is built separately. Otherwise this compiler's option must be specified explicitly. Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Change-Id: I90f1381733113798069bf77d3a03fcb284607fe5
-rw-r--r--tftf/tests/extensions/mte/test_mte.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/tftf/tests/extensions/mte/test_mte.c b/tftf/tests/extensions/mte/test_mte.c
index 7dbb9ef7..a2e8d995 100644
--- a/tftf/tests/extensions/mte/test_mte.c
+++ b/tftf/tests/extensions/mte/test_mte.c
@@ -15,13 +15,22 @@ test_result_t test_mte_instructions(void)
#ifdef __aarch64__
SKIP_TEST_IF_MTE_SUPPORT_LESS_THAN(MTE_IMPLEMENTED_EL0);
- /* irg */
- __asm__ volatile (".inst 0xD29BD5A9");
- __asm__ volatile (".inst 0x9ADF1129");
- /* addg */
- __asm__ volatile (".inst 0x91800129");
- /* subg */
- __asm__ volatile (".inst 0xD1800129");
+ /*
+ * This code must be compiled with '-march=armv8.5-memtag' option
+ * by setting 'ARM_ARCH_FEATURE=memtag' and 'ARM_ARCH_MINOR=5'
+ * build flags in tftf_config/fvp-cpu-extensions when this CI
+ * configuration is built separately.
+ * Otherwise this compiler's option must be specified explicitly.
+ *
+ * Execute Memory Tagging Extension instructions.
+ */
+ __asm__ volatile (
+ ".arch armv8.5-a+memtag\n"
+ "mov x0, #0xDEAD\n"
+ "irg x0, x0\n"
+ "addg x0, x0, #0x0, #0x0\n"
+ "subg x0, x0, #0x0, #0x0"
+ );
return TEST_RESULT_SUCCESS;
#endif /* __aarch64__ */