Thread (11 messages) 11 messages, 2 authors, 2025-06-11

Re: [PATCH v5 4/6] kselftest/arm64/mte: preparation for mtefar test

From: Mark Brown <broonie@kernel.org>
Date: 2025-06-10 15:21:44
Also in: linux-doc, lkml

On Tue, Jun 10, 2025 at 04:01:42PM +0100, Yeoreum Yun wrote:
If FEAT_MTE_TAGGED_FAR (Armv8.9) is supported, bits 63:60 of the fault address
are preserved in response to synchronous tag check faults (SEGV_MTESERR).

This patch is preparation for testing FEAT_MTE_TAGGED_FAR.
It shouldn't change the test result.
I'm not clear from the above what the change is intended to do (ie, how
does it prepare for testing FEAT_MTE_TAGGED_FAR).  I think this could
usefully be split out into multiple commits (eg, adding logging of the
additional si_ fields separately, or splitting the renaming MT_CLEAR_TAG
to MT_CLEAR_TAGS), it's kind of hard to review as is.
quoted hunk ↗ jump to hunk
@@ -45,13 +64,18 @@ void mte_default_handler(int signum, siginfo_t *si, void *uc)
 		}
 		/* Compare the context for precise error */
 		else if (si->si_code == SEGV_MTESERR) {
+		 	if ((!mtefar_support && si_atag) || (si_atag != MT_FETCH_ATAG(cur_mte_cxt.trig_addr))) {
+			  ksft_print_msg("Invalid MTE synchronous exception caught for address tag! si_tag=%x, si_atag: %x\n", si_tag, si_atag);
+			  exit(1);
+			}
We should really exit with a kselftest error rather than just a number,
though I see this is just copying the existing style for the file so
*shrug*.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help