@@ -885,6 +885,11 @@ static struct aarch64_insn_decoder ld_st_decoder[] = {
.value = 0b001100010000010,
.decode_func = arm_decode_ld_st_regs_off,
},
+ {
+ .mask = 0b001101010000001,
+ .value = 0b001100010000001,
+ .decode_func = arm_decode_ld_st_regs_pac,
+ },
{
.mask = 0b001101000000000,
.value = 0b001101000000000,
@@ -1981,3 +1986,49 @@ int arm_decode_ld_st_regs_pair_pre(u32 instr, enum insn_type *type,
return 0;
}
+
+int arm_decode_ld_st_regs_pac(u32 instr, enum insn_type *type,
+ unsigned long *immediate,
+ struct list_head *ops_list)
+{
+ unsigned char size = 0, V = 0, W = 0, S = 0;
+ unsigned char rn = 0, rt = 0;
+ struct stack_op *op;
+ u32 imm9 = 0, s10 = 0;
+
+ size = (instr >> 30) & ONES(2);
+ V = EXTRACT_BIT(instr, 26);
+ W = EXTRACT_BIT(instr, 11);
+
+ if (size != 3 || V == 1)
+ return arm_decode_unknown(instr, type, immediate, ops_list);
+
+ rn = (instr >> 5) & ONES(5);
+
+ if (!stack_related_reg(rn)) {
+ *type = INSN_OTHER;
+ return 0;
+ }
+
+ S = EXTRACT_BIT(instr, 22);
+ s10 = (S << 9) | imm9;
+
+ *type = INSN_STACK;
+
+ op = calloc(1, sizeof(*op));
+ list_add_tail(&op->list, ops_list);
+
+ op->dest.reg = rt;
+ op->dest.type = OP_DEST_REG;
+ op->dest.offset = 0;
+ op->src.offset = (SIGN_EXTEND(s10, 9) << 3);
+ if (W) { /* pre-indexed/writeback */
+ op->src.type = OP_SRC_POP;
+ op->src.reg = rn;
+ } else {
+ op->src.type = OP_SRC_REG_INDIRECT;
+ op->src.reg = rn;
+ }
+
+ return 0;
+}
@@ -135,6 +135,9 @@ int arm_decode_atomic(u32 instr, enum insn_type *type,
int arm_decode_ld_st_regs_off(u32 instr, enum insn_type *type,
unsigned long *immediate,
struct list_head *ops_list);
+int arm_decode_ld_st_regs_pac(u32 instr, enum insn_type *type,
+ unsigned long *immediate,
+ struct list_head *ops_list);
int arm_decode_ld_st_regs_unsigned(u32 instr, enum insn_type *type,
unsigned long *immediate,
struct list_head *ops_list);
Decode load/store instruction provided by the v8.3 pointer authentication architecture extension. Suggested-by: Raphael Gault <raphael.gault@arm.com> Signed-off-by: Julien Thierry <jthierry@redhat.com> --- tools/objtool/arch/arm64/decode.c | 51 +++++++++++++++++++ .../objtool/arch/arm64/include/insn_decode.h | 3 ++ 2 files changed, 54 insertions(+)