mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	mikey@neuling.org, Russell Currey <ruscur@russell.cc>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v4 13/13] powerpc/ptrace: move ptrace_triggered() into hw_breakpoint.c
Date: Thu, 27 Feb 2020 18:09:20 +0100	[thread overview]
Message-ID: <4e528bf2-2b53-ae93-cdcc-0c80953f40f2@c-s.fr> (raw)
In-Reply-To: <d45c91cf5f83424b8f3989b7ead28c50d8d765a9.1582803998.git.christophe.leroy@c-s.fr>

Russel,

Le 27/02/2020 à 12:49, Christophe Leroy a écrit :
> ptrace_triggered() is declared in asm/hw_breakpoint.h and
> only needed when CONFIG_HW_BREAKPOINT is set, so move it
> into hw_breakpoint.c

My series v4 is definitely buggy (I included ptrace_decl.h instead 
instead of ptrace-decl.h), how can Snowpatch say build succeeded 
(https://patchwork.ozlabs.org/patch/1245807/) ?

It fails at least on pmac32_defconfig and ppc64_defconfig, see:

http://kisskb.ellerman.id.au/kisskb/head/d45c91cf5f83424b8f3989b7ead28c50d8d765a9/

Christophe

> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
> v4: removing inclusing of hw_breakpoint.h now. Previously it was done too early.
> ---
>   arch/powerpc/kernel/hw_breakpoint.c | 16 ++++++++++++++++
>   arch/powerpc/kernel/ptrace/ptrace.c | 19 -------------------
>   2 files changed, 16 insertions(+), 19 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
> index 2462cd7c565c..2c0be9d941cf 100644
> --- a/arch/powerpc/kernel/hw_breakpoint.c
> +++ b/arch/powerpc/kernel/hw_breakpoint.c
> @@ -427,3 +427,19 @@ void hw_breakpoint_pmu_read(struct perf_event *bp)
>   {
>   	/* TODO */
>   }
> +
> +void ptrace_triggered(struct perf_event *bp,
> +		      struct perf_sample_data *data, struct pt_regs *regs)
> +{
> +	struct perf_event_attr attr;
> +
> +	/*
> +	 * Disable the breakpoint request here since ptrace has defined a
> +	 * one-shot behaviour for breakpoint exceptions in PPC64.
> +	 * The SIGTRAP signal is generated automatically for us in do_dabr().
> +	 * We don't have to do anything about that here
> +	 */
> +	attr = bp->attr;
> +	attr.disabled = true;
> +	modify_user_hw_breakpoint(bp, &attr);
> +}
> diff --git a/arch/powerpc/kernel/ptrace/ptrace.c b/arch/powerpc/kernel/ptrace/ptrace.c
> index a44f6e5e05ff..f6e51be47c6e 100644
> --- a/arch/powerpc/kernel/ptrace/ptrace.c
> +++ b/arch/powerpc/kernel/ptrace/ptrace.c
> @@ -18,7 +18,6 @@
>   #include <linux/regset.h>
>   #include <linux/tracehook.h>
>   #include <linux/audit.h>
> -#include <linux/hw_breakpoint.h>
>   #include <linux/context_tracking.h>
>   #include <linux/syscalls.h>
>   
> @@ -31,24 +30,6 @@
>   
>   #include "ptrace-decl.h"
>   
> -#ifdef CONFIG_HAVE_HW_BREAKPOINT
> -void ptrace_triggered(struct perf_event *bp,
> -		      struct perf_sample_data *data, struct pt_regs *regs)
> -{
> -	struct perf_event_attr attr;
> -
> -	/*
> -	 * Disable the breakpoint request here since ptrace has defined a
> -	 * one-shot behaviour for breakpoint exceptions in PPC64.
> -	 * The SIGTRAP signal is generated automatically for us in do_dabr().
> -	 * We don't have to do anything about that here
> -	 */
> -	attr = bp->attr;
> -	attr.disabled = true;
> -	modify_user_hw_breakpoint(bp, &attr);
> -}
> -#endif /* CONFIG_HAVE_HW_BREAKPOINT */
> -
>   /*
>    * Called by kernel/ptrace.c when detaching..
>    *
> 

  reply	other threads:[~2020-02-27 17:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 11:48 [PATCH v4 00/13] Reduce ifdef mess in ptrace Christophe Leroy
2020-02-27 11:48 ` [PATCH v4 01/13] powerpc: move ptrace into a subdirectory Christophe Leroy
2020-02-27 11:48 ` [PATCH v4 02/13] powerpc/ptrace: remove unused header includes Christophe Leroy
2020-02-27 11:48 ` [PATCH v4 03/13] powerpc/ptrace: drop unnecessary #ifdefs CONFIG_PPC64 Christophe Leroy
2020-02-27 11:49 ` [PATCH v4 04/13] powerpc/ptrace: drop PARAMETER_SAVE_AREA_OFFSET Christophe Leroy
2020-02-27 11:49 ` [PATCH v4 05/13] powerpc/ptrace: split out VSX related functions Christophe Leroy
2020-02-27 11:49 ` [PATCH v4 06/13] powerpc/ptrace: split out ALTIVEC " Christophe Leroy
2020-02-28  4:08   ` kbuild test robot
2020-02-27 11:49 ` [PATCH v4 07/13] powerpc/ptrace: split out SPE " Christophe Leroy
2020-02-27 11:49 ` [PATCH v4 08/13] powerpc/ptrace: split out TRANSACTIONAL_MEM " Christophe Leroy
2020-02-27 11:49 ` [PATCH v4 09/13] powerpc/ptrace: move register viewing functions out of ptrace.c Christophe Leroy
2020-02-27 11:49 ` [PATCH v4 10/13] powerpc/ptrace: split out ADV_DEBUG_REGS related functions Christophe Leroy
2020-02-27 11:49 ` [PATCH v4 11/13] powerpc/ptrace: create ptrace_get_debugreg() Christophe Leroy
2020-02-27 11:49 ` [PATCH v4 12/13] powerpc/ptrace: create ppc_gethwdinfo() Christophe Leroy
2020-02-27 11:49 ` [PATCH v4 13/13] powerpc/ptrace: move ptrace_triggered() into hw_breakpoint.c Christophe Leroy
2020-02-27 17:09   ` Christophe Leroy [this message]
2020-02-27 22:16     ` Michael Ellerman
2020-02-28  3:59       ` Andrew Donnellan
2020-02-28  4:02         ` Russell Currey

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=4e528bf2-2b53-ae93-cdcc-0c80953f40f2@c-s.fr \
    --to=christophe.leroy@c-s.fr \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=ruscur@russell.cc \
    /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

all inboxes | Powered by JetHome®