kselftest/arm64: Log unexpected asynchronous MTE faults
authorMark Brown <broonie@kernel.org>
Tue, 19 Apr 2022 10:32:41 +0000 (11:32 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 28 Apr 2022 16:57:10 +0000 (17:57 +0100)
Help people figure out problems by printing a diagnostic when we get an
unexpected asynchronous fault.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20220419103243.24774-3-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
tools/testing/selftests/arm64/mte/mte_common_util.c

index 0328a1e08f65925a580e9a35b02aba76500399db..5327aa95817137e780a6da2437a203e396bf07e4 100644 (file)
@@ -37,6 +37,10 @@ void mte_default_handler(int signum, siginfo_t *si, void *uc)
                if (si->si_code == SEGV_MTEAERR) {
                        if (cur_mte_cxt.trig_si_code == si->si_code)
                                cur_mte_cxt.fault_valid = true;
+                       else
+                               ksft_print_msg("Got unexpected SEGV_MTEAERR at pc=$lx, fault addr=%lx\n",
+                                              ((ucontext_t *)uc)->uc_mcontext.pc,
+                                              addr);
                        return;
                }
                /* Compare the context for precise error */