Re: [PATCH v4 08/12] arm64: unify native/compat instruction skipping

From: Catalin Marinas
Date: Mon Jan 13 2020 - 11:43:20 EST


On Wed, Dec 11, 2019 at 03:42:02PM +0000, Mark Brown wrote:
> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> index 84c7a88dd617..de01e5041d4d 100644
> --- a/arch/arm64/kernel/traps.c
> +++ b/arch/arm64/kernel/traps.c
> @@ -269,6 +269,8 @@ void arm64_notify_die(const char *str, struct pt_regs *regs,
> }
> }
>
> +static void advance_itstate(struct pt_regs *regs);
> +
> void arm64_skip_faulting_instruction(struct pt_regs *regs, unsigned long size)
> {
> regs->pc += size;
> @@ -279,6 +281,9 @@ void arm64_skip_faulting_instruction(struct pt_regs *regs, unsigned long size)
> */
> if (user_mode(regs))
> user_fastforward_single_step(current);
> +
> + if (regs->pstate & PSR_MODE32_BIT)
> + advance_itstate(regs);

Nitpick: we have a compat_user_mode(regs) you can use here.

--
Catalin