提交 521c6461 编写于 作者: M Mark Rutland 提交者: Will Deacon

arm64: cpufeature: correctly handle MRS to XZR

In emulate_mrs() we may erroneously write back to the user SP rather
than XZR if we trap an MRS instruction where Xt == 31.

Use the new pt_regs_write_reg() helper to handle this correctly.
Signed-off-by: NMark Rutland <mark.rutland@arm.com>
Fixes: 77c97b4e ("arm64: cpufeature: Expose CPUID registers by emulation")
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 8b6e70fc
......@@ -1214,7 +1214,7 @@ static int emulate_mrs(struct pt_regs *regs, u32 insn)
rc = emulate_sys_reg(sys_reg, &val);
if (!rc) {
dst = aarch64_insn_decode_register(AARCH64_INSN_REGTYPE_RT, insn);
regs->user_regs.regs[dst] = val;
pt_regs_write_reg(regs, dst, val);
regs->pc += 4;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册