arm64: ptrace: map SPSR_ELx<->PSR for compat tasks
authorMark Rutland <[email protected]>
Thu, 5 Jul 2018 14:16:51 +0000 (15:16 +0100)
committerWill Deacon <[email protected]>
Thu, 5 Jul 2018 16:24:14 +0000 (17:24 +0100)
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 <[email protected]>
Fixes: 7206dc93a58fb764 ("arm64: Expose Arm v8.4 features")
Cc: Catalin Marinas <[email protected]>
Cc: Suzuki Poulose <[email protected]>
Cc: Will Deacon <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
arch/arm64/kernel/ptrace.c

index 5df75ab6a3c8af516273420a4db9a63b5128fc48..2c4b09f84dd0913e8035648fd766e9df110b4095 100644 (file)
@@ -1076,6 +1076,7 @@ static int compat_gpr_get(struct task_struct *target,
                        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;
@@ -1143,6 +1144,7 @@ static int compat_gpr_set(struct task_struct *target,
                        newregs.pc = reg;
                        break;
                case 16:
+                       reg = compat_psr_to_pstate(reg);
                        newregs.pstate = reg;
                        break;
                case 17: