diff options
author | Boyan Karatotev <boyan.karatotev@arm.com> | 2020-09-18 11:47:13 +0100 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2020-09-18 14:07:20 +0100 |
commit | 766d95b1ed93ebdd07ac87490e60e442342f5dc4 (patch) | |
tree | d291ee57f1e0b0ec7a1d1b429685ba5970f1daf8 /tools/testing/selftests/arm64/pauth/helper.h | |
parent | kselftests/arm64: add a basic Pointer Authentication test (diff) | |
download | linux-dev-766d95b1ed93ebdd07ac87490e60e442342f5dc4.tar.xz linux-dev-766d95b1ed93ebdd07ac87490e60e442342f5dc4.zip |
kselftests/arm64: add nop checks for PAuth tests
PAuth adds sign/verify controls to enable and disable groups of
instructions in hardware for compatibility with libraries that do not
implement PAuth. The kernel always enables them if it detects PAuth.
Add a test that checks that each group of instructions is enabled, if the
kernel reports PAuth as detected.
Note: For groups, for the purpose of this patch, we intend instructions
that use a certain key.
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Reviewed-by: Vincenzo Frascino <Vincenzo.Frascino@arm.com>
Reviewed-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20200918104715.182310-3-boian4o1@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'tools/testing/selftests/arm64/pauth/helper.h')
-rw-r--r-- | tools/testing/selftests/arm64/pauth/helper.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/testing/selftests/arm64/pauth/helper.h b/tools/testing/selftests/arm64/pauth/helper.h index 3e0a2a404bf4..35c4f3357ae3 100644 --- a/tools/testing/selftests/arm64/pauth/helper.h +++ b/tools/testing/selftests/arm64/pauth/helper.h @@ -4,6 +4,15 @@ #ifndef _HELPER_H_ #define _HELPER_H_ +#include <stdlib.h> + void pac_corruptor(void); +/* PAuth sign a value with key ia and modifier value 0 */ +size_t keyia_sign(size_t val); +size_t keyib_sign(size_t val); +size_t keyda_sign(size_t val); +size_t keydb_sign(size_t val); +size_t keyg_sign(size_t val); + #endif |