Skip to content

Commit de1702f

Browse files
mrutland-armwilldeacon
authored andcommitted
arm64: move PAC masks to <asm/pointer_auth.h>
Now that we use XPACLRI to strip PACs within the kernel, the ptrauth_user_pac_mask() and ptrauth_kernel_pac_mask() definitions no longer need to live in <asm/compiler.h>. Move them to <asm/pointer_auth.h>, and ensure that this header is included where they are used. Signed-off-by: Mark Rutland <[email protected]> Cc: Amit Daniel Kachhap <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: James Morse <[email protected]> Cc: Kristina Martsenko <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent ca70859 commit de1702f

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

arch/arm64/include/asm/compiler.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
#define ARM64_ASM_PREAMBLE
99
#endif
1010

11-
/*
12-
* The EL0/EL1 pointer bits used by a pointer authentication code.
13-
* This is dependent on TBI0/TBI1 being enabled, or bits 63:56 would also apply.
14-
*/
15-
#define ptrauth_user_pac_mask() GENMASK_ULL(54, vabits_actual)
16-
#define ptrauth_kernel_pac_mask() GENMASK_ULL(63, vabits_actual)
17-
1811
#define xpaclri(ptr) \
1912
({ \
2013
register unsigned long __xpaclri_ptr asm("x30") = (ptr); \

arch/arm64/include/asm/pointer_auth.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
#include <asm/memory.h>
1111
#include <asm/sysreg.h>
1212

13+
/*
14+
* The EL0/EL1 pointer bits used by a pointer authentication code.
15+
* This is dependent on TBI0/TBI1 being enabled, or bits 63:56 would also apply.
16+
*/
17+
#define ptrauth_user_pac_mask() GENMASK_ULL(54, vabits_actual)
18+
#define ptrauth_kernel_pac_mask() GENMASK_ULL(63, vabits_actual)
19+
1320
#define PR_PAC_ENABLED_KEYS_MASK \
1421
(PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY | PR_PAC_APDBKEY)
1522

arch/arm64/kernel/crash_core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <asm/cpufeature.h>
99
#include <asm/memory.h>
1010
#include <asm/pgtable-hwdef.h>
11+
#include <asm/pointer_auth.h>
1112

1213
static inline u64 get_tcr_el1_t1sz(void);
1314

0 commit comments

Comments
 (0)