setpan

Set Privileged Access Never (A32)

SETPAN #<imm>

Enables/Disables PAN (Prevents kernel accessing user memory).

Details

Set Privileged Access Never enables or disables the PAN (Privileged Access Never) control bit, which prevents privileged software from accessing user-mode memory. When PAN is enabled (imm=1), privileged accesses to user memory are trapped; when disabled (imm=0), such accesses are permitted. This instruction is available in A32 and requires appropriate privilege level. No condition flags are modified.

Pseudocode Operation

PSTATE.PAN ← imm;

Example

SETPAN #16

Encoding

Binary Layout
111100010001
0
0
0
0
0
0
0
0
0
0
imm1
0
0000
0
0
0
0
 
Format System
Opcode 0xF1100000
Extension A32 (System)

Operands

  • imm
    0/1

Reference (Arm AArch32 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0xF1100000 SETPAN{<q>} #<imm> A32 111100010001 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | imm1 | 0 | 0000 | 0 | 0 | 0 | 0
0xB610 SETPAN{<q>} #<imm> T32 10110110000 | 1 | imm1 | 0 | 0 | 0

Description

Set Privileged Access Never writes a new value to PSTATE.PAN. This instruction is available only in privileged mode and it is a NOP when executed in User mode.

Operation

EncodingSpecificOperations();
if PSTATE.EL != EL0 then
    PSTATE.PAN = value;