diff options
author | Kevin Brodsky <kevin.brodsky@arm.com> | 2024-10-29 17:45:38 +0300 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2024-11-04 19:31:25 +0300 |
commit | 6e182dc9f2680681ffb0b6d9757927f1bd321b38 (patch) | |
tree | 100e788b505662bf02e6eda8bcc3f50a2baba3dc /tools/perf/scripts/python/event_analyzing_sample.py | |
parent | 8edbbfcc1ed3ca2170a2c5e888a76ba3652e62c9 (diff) | |
download | linux-6e182dc9f2680681ffb0b6d9757927f1bd321b38.tar.xz |
selftests/mm: Use generic pkey register manipulation
pkey_sighandler_tests.c currently hardcodes x86 PKRU encodings. The
first step towards running those tests on arm64 is to abstract away
the pkey register values.
Since those tests want to deny access to all keys except a few,
we have each arch define PKEY_REG_ALLOW_NONE, the pkey register value
denying access to all keys. We then use the existing set_pkey_bits()
helper to grant access to specific keys.
Because pkeys may also remove the execute permission on arm64, we
need to be a little careful: all code is mapped with pkey 0, and we
need it to remain executable. pkey_reg_restrictive_default() is
introduced for that purpose: the value it returns prevents RW access
to all pkeys, but retains X permission for pkey 0.
test_pkru_preserved_after_sigusr1() only checks that the pkey
register value remains unchanged after a signal is delivered, so the
particular value is irrelevant. We enable pkey 0 and a few more
arbitrary keys in the smallest range available on all architectures
(8 keys on arm64).
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/r/20241029144539.111155-5-kevin.brodsky@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions