diff mbox series

[v1,3/7] kselftest/arm64: mte: user_mem: add test with mte tag inside a page

Message ID 20220125150920.23955-4-joey.gouly@arm.com (mailing list archive)
State New, archived
Headers show
Series add more tests to MTE kselftests | expand

Commit Message

Joey Gouly Jan. 25, 2022, 3:09 p.m. UTC
This new test has a tag that is only a single MT_GRANULE_SIZE large.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 tools/testing/selftests/arm64/mte/check_user_mem.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/arm64/mte/check_user_mem.c b/tools/testing/selftests/arm64/mte/check_user_mem.c
index d33b262ccdb0..3497960851a9 100644
--- a/tools/testing/selftests/arm64/mte/check_user_mem.c
+++ b/tools/testing/selftests/arm64/mte/check_user_mem.c
@@ -107,7 +107,7 @@  int main(int argc, char *argv[])
 	mte_register_signal(SIGSEGV, mte_default_handler);
 
 	/* Set test plan */
-	ksft_set_plan(8);
+	ksft_set_plan(9);
 
 	evaluate_test(check_usermem_access_fault(USE_MMAP, MTE_SYNC_ERR, MAP_PRIVATE, page_sz),
 		"Check memory access from kernel in sync mode, private mapping and mmap memory (tag_offset: page_sz)\n");
@@ -129,6 +129,10 @@  int main(int argc, char *argv[])
 	evaluate_test(check_usermem_access_fault(USE_MMAP, MTE_ASYNC_ERR, MAP_SHARED, MT_GRANULE_SIZE),
 		"Check memory access from kernel in async mode, shared mapping and mmap memory (tag_offset: MT_GRANULE_SIZE)\n");
 
+	// In this test, the tag only covers MT_GRANULE_SIZE.
+	evaluate_test(check_usermem_access_fault_helper(USE_MMAP, MTE_SYNC_ERR, MAP_PRIVATE, MT_GRANULE_SIZE, MT_GRANULE_SIZE),
+		"Check memory access from kernel in sync mode, private mapping and mmap memory (tag_offset: MT_GRANULE_SIZE, tag_len: MT_GRANULE_SIZE)\n");
+
 	mte_restore_setup();
 	ksft_print_cnts();
 	return ksft_get_fail_cnt() == 0 ? KSFT_PASS : KSFT_FAIL;