Skip to content

Commit b229b46

Browse files
author
Marc Zyngier
committed
arm64: Add system register encoding for PSTATE.PAN
Although we already have the primitives to set PSTATE.PAN with an immediate, we don't have a way to read the current state nor set it ot an arbitrary value (i.e. we can generally save/restore it). Thankfully, all that is missing for this is the definition for the PAN pseudo system register, here named SYS_PSTATE_PAN. Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent 6dcd2ac commit b229b46

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/arm64/include/asm/sysreg.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@
109109
#define set_pstate_ssbs(x) asm volatile(SET_PSTATE_SSBS(x))
110110
#define set_pstate_dit(x) asm volatile(SET_PSTATE_DIT(x))
111111

112+
/* Register-based PAN access, for save/restore purposes */
113+
#define SYS_PSTATE_PAN sys_reg(3, 0, 4, 2, 3)
114+
112115
#define __SYS_BARRIER_INSN(CRm, op2, Rt) \
113116
__emit_inst(0xd5000000 | sys_insn(0, 3, 3, (CRm), (op2)) | ((Rt) & 0x1f))
114117

0 commit comments

Comments
 (0)