From: Mark Rutland mark.rutland@arm.com
commit 76fc52bd07d3e9cb708f1a50b60c825c96acd606 upstream.
The SPSR_ELx format for exceptions taken from AArch32 is slightly different to the AArch32 PSR format.
Map between the two in the compat ptrace code.
Signed-off-by: Mark Rutland mark.rutland@arm.com Fixes: 7206dc93a58fb764 ("arm64: Expose Arm v8.4 features") Cc: Catalin Marinas catalin.marinas@arm.com Cc: Suzuki Poulose suzuki.poulose@arm.com Cc: Will Deacon will.deacon@arm.com Signed-off-by: Will Deacon will.deacon@arm.com Cc: Guenter Roeck linux@roeck-us.net Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
--- arch/arm64/kernel/ptrace.c | 2 ++ 1 file changed, 2 insertions(+)
--- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -833,6 +833,7 @@ static int compat_gpr_get(struct task_st break; case 16: reg = task_pt_regs(target)->pstate; + reg = pstate_to_compat_psr(reg); break; case 17: reg = task_pt_regs(target)->orig_x0; @@ -900,6 +901,7 @@ static int compat_gpr_set(struct task_st newregs.pc = reg; break; case 16: + reg = compat_psr_to_pstate(reg); newregs.pstate = reg; break; case 17: