1. 前言
Armv9 system register的编码空间由一组参数标识:{op0, op1, CRn, CRm, op2},它们形成了一个编码层次结构,其中:
- op0:定义编码空间的最高类别划分。
- op1:定义了可以访问这个编码空间的最低Exception level。具体如下:
- Accessible at EL0:op1的值为3
- Accessible at EL1:op1的值为0,1,2
- Accessible at Secure EL1:op1的值为7
- Accessible at EL2:op1的值为4,5。其中5是用于在VHE实现和HCR_EL2.E2H为1情况下,EL12编码访问EL1 system registers的。
- Accessible at EL3:op1的值为6
ARM架构里预留了一些IMPLEMENTATION DEFINE的空间,它强烈建立这段空间的op1的值也要符合上述约定。
系统指令类的编码空间里的每条instruction有以下任意特性:
- 转移到system register:这种system instruction具有写的特性;
- 从system register转移。这种system instruction具有读的特性;
执行system instruction就像是对寄存器进行传输一样。
2. op0分类
在AArch64指令集中,system instruction class对{op0, op1, CRn, CRm, op2}的编码结构为:
op0域提供了system instruction类型的最顶层编码分类,它的值有:
- 0b00 These encodings provide:
- Instructions with an immediate field for accessing PSTATE, the current PE state.
- The architectural hint instructions.
- Barriers and the CLREX instruction.
- 0b01 These encodings provide:
- Cache maintenance instructions.
- TLB maintenance instructions.
- Address translation instructions.
- Prediction restriction instructions.
- BRBE instructions.
- 0b10 These encodings provide moves to and from:
- Legacy AArch32 System registers for execution environments, to provide access to these registers from higher Exception levels that are using AArch64.
- Debug and trace registers.
- 0b11 These encodings provide:
- Moves to and from Non-debug System registers. The accessed registers provide system control, and system status information.
- Access to Special-purpose registers.
记忆原则就是43522,4是op1的类别,3522分别对应op1为0,1,,2,3的类别。
3. op0之下的分类
在上面我们看到系统寄存器的分类取决于{op0, op1, CRn, CRm, op2}参数。op0决定大类,在之下的根据op1,op2,CRn,CRm还可以继续细分有:
上述是总体小类别划分的总结。
op0 == 0b00
op0 == 0b01
op0 == 0b10
op0 == 0b11