Commit 76fc52bd authored by Mark Rutland's avatar Mark Rutland Committed by Will Deacon

arm64: ptrace: map SPSR_ELx<->PSR for compat tasks

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: default avatarMark Rutland <mark.rutland@arm.com>
Fixes: 7206dc93 ("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: default avatarWill Deacon <will.deacon@arm.com>
parent 25dc2c80
...@@ -1076,6 +1076,7 @@ static int compat_gpr_get(struct task_struct *target, ...@@ -1076,6 +1076,7 @@ static int compat_gpr_get(struct task_struct *target,
break; break;
case 16: case 16:
reg = task_pt_regs(target)->pstate; reg = task_pt_regs(target)->pstate;
reg = pstate_to_compat_psr(reg);
break; break;
case 17: case 17:
reg = task_pt_regs(target)->orig_x0; reg = task_pt_regs(target)->orig_x0;
...@@ -1143,6 +1144,7 @@ static int compat_gpr_set(struct task_struct *target, ...@@ -1143,6 +1144,7 @@ static int compat_gpr_set(struct task_struct *target,
newregs.pc = reg; newregs.pc = reg;
break; break;
case 16: case 16:
reg = compat_psr_to_pstate(reg);
newregs.pstate = reg; newregs.pstate = reg;
break; break;
case 17: case 17:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment