public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] arm64: kprobes: WARN if attempting to step with PSTATE.D=1
Date: Tue, 19 Jul 2016 15:37:16 +0100	[thread overview]
Message-ID: <20160719143716.GB22473@leverpostej> (raw)
In-Reply-To: <1468937260-23988-3-git-send-email-will.deacon@arm.com>

On Tue, Jul 19, 2016 at 03:07:39PM +0100, Will Deacon wrote:
> Stepping with PSTATE.D=1 is bad news. The step won't generate a debug
> exception and we'll likely walk off into random data structures. This
> should never happen, but when it does, it's a PITA to debug. Add a
> WARN_ON to shout if we realise this is about to take place.
> 
> Signed-off-by: Will Deacon <will.deacon@arm.com>

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.

> ---
>  arch/arm64/kernel/probes/kprobes.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> index 9c70e8812ea9..c89811d1e294 100644
> --- a/arch/arm64/kernel/probes/kprobes.c
> +++ b/arch/arm64/kernel/probes/kprobes.c
> @@ -254,6 +254,8 @@ static void __kprobes setup_singlestep(struct kprobe *p,
>  
>  		if (kcb->kprobe_status == KPROBE_REENTER)
>  			spsr_set_debug_flag(regs, 0);
> +		else
> +			WARN_ON(regs->pstate & PSR_D_BIT);
>  
>  		/* IRQs and single stepping do not mix well. */
>  		kprobes_save_local_irqflag(kcb, regs);
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

  reply	other threads:[~2016-07-19 14:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19 14:07 [PATCH 1/4] arm64: debug: unmask PSTATE.D earlier Will Deacon
2016-07-19 14:07 ` [PATCH 2/4] arm64: debug: remove redundant spsr manipulation Will Deacon
2016-07-19 14:36   ` Mark Rutland
2016-07-19 14:07 ` [PATCH 3/4] arm64: kprobes: WARN if attempting to step with PSTATE.D=1 Will Deacon
2016-07-19 14:37   ` Mark Rutland [this message]
2016-08-03 12:22   ` Pratyush Anand
2016-08-09 12:48     ` Will Deacon
2016-08-10  8:01       ` Pratyush Anand
2016-08-10 12:04         ` Masami Hiramatsu
2016-08-12 12:46           ` Pratyush Anand
2016-08-15 12:56             ` Pratyush Anand
2016-07-19 14:07 ` [PATCH 4/4] arm64: debug: remove unused local_dbg_{enable, disable} macros Will Deacon
2016-07-19 14:38   ` Mark Rutland
2016-07-19 14:23 ` [PATCH 1/4] arm64: debug: unmask PSTATE.D earlier Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160719143716.GB22473@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox