Re: [PATCH 4/4] selftests/rseq: Add test for rseq+pkeys

From: Dave Hansen
Date: Fri Feb 21 2025 - 12:30:25 EST


On 2/17/25 03:07, Dmitry Vyukov wrote:
> +++ b/tools/testing/selftests/rseq/pkey_test.c

There's also a:

tools/testing/selftests/mm/protection_keys.c

The main thing that will get you is testing with a bunch of different
pkey values and also a few different memory types including huge pages.
It also keeps an eye on PKRU consistency by keeping a shadow. So if, for
instance, the rseq code forgot to restore PKRU, that code would be
likely to catch it. It's caught a few bugs during development for me
when PKRU was getting wrongly-munged.

But, I'm not picky about selftests. Any test is better than no test. So,
whatever you decide to do:

Acked-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>