Skip to content

Commit

Permalink
[FMV][AArch64] Add runtime test for memtag. (#173)
Browse files Browse the repository at this point in the history
There are no FEAT_MTE2 instructions available at EL0, therefore
this test is expected to UPASS on systems which support FEAT_MTE
but don't support FEAT_MTE2.
  • Loading branch information
labrinea authored Oct 23, 2024
1 parent 07f0e03 commit 9fac4a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions SingleSource/UnitTests/AArch64/acle-fmv-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,15 @@ CHECK(mops, mops, mops, false, {
: : "cc", "memory"
);
})
// We can't use any FEAT_MTE2 instruction in this test since they are undefined
// at EL0. Therefore passing IS_EXEMPT = true here allows the default version to
// UPASS on a system which doesn't have FEAT_MTE2 but has FEAT_MTE.
CHECK(memtag, memtag, memtag, true, {
asm volatile (
"irg x0, sp"
: : : "x0"
);
})

static bool safe_try_feature(bool (*try_feature)(void), bool is_exempt) {
int child = fork();
Expand Down Expand Up @@ -428,6 +437,7 @@ int main(int, const char **) {
check_sme_f64f64();
check_sme_i16i64();
check_mops();
check_memtag();

return any_fails ? -1 : 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ sm4
sme-f64f64
sme-i16i64
mops
memtag
exit 0

0 comments on commit 9fac4a3

Please sign in to comment.