Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1343405ybf; Thu, 27 Feb 2020 09:10:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzm9w8E4yQ1nJXya6ebSt9UKRouWMrkw+wD4YhsBMdKPzajcB9bl9JM3XxH/G8LJudOAQlA X-Received: by 2002:a9d:1706:: with SMTP id i6mr613713ota.151.1582823403790; Thu, 27 Feb 2020 09:10:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582823403; cv=none; d=google.com; s=arc-20160816; b=cCuXKeC7XC8xirp7RHVA0witWHMA5Byp4nedW3c9ETvDqIT2Nm7oYRfD5rj9AMzsaJ CtbyTomO+jWjJnCg/fBZPtY+iIJrNa4I8aU6a9mEPzJ7xAPo095GWbKH36n+f9exHJSo kCiEhZH6JK3HfF/QpmoxmaMmZUj/sASGkjxPfJ6qa28SL2qdTRcN4Q0LwJTMLREp7jUm iMtjYQcLiqYstSrU551X+8rwJptihN7y4iJ9u6rKNQ/JIB5HXCoULO0EmFupW6gwnQzv Spp/atUC8Q4WK75CLXR+OVvK1A6Nybbij2eyKArokgUaOnP+j6lSyJfA+2MSzXs1Qk/K rYJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature; bh=FcXtMozaz5aKjR+MsTQyybTO/Ns9vbTusP0TC2E6/Rc=; b=DFBgvwf4lPdfl0uEgSp7XOBR2jlRTlvhRXn3pfShKZ4uWnslLCidnc3Bss5lHhk6aD 2A2FsOEZ7msN20EuZwRNj7RwsQe25aymGOwMcAO5ESF9V0zK6YxLWfiWryUrdgRpwg80 QyiBQHerqchDghdrPEBcFI+OWMvCwnTII/9xMx3+COW91Xc/obzPRPBXIRqus5HldYbB 9q9GMe25ysv1+Fa1Tz0a87Uwq9xzUGYayaaxvO23VmuVcQnyVNQiwBbgBgFm0NP6sZS+ 9+IEMaZwR7RlgNR8fzYu5loqbTBuQ3Dqee9D0V9Ka7SLLRLd9iGRLnF25phx2Mx+0FzV NcmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=wR2VozWe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d19si2173943ote.3.2020.02.27.09.09.50; Thu, 27 Feb 2020 09:10:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=wR2VozWe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729675AbgB0RJp (ORCPT + 99 others); Thu, 27 Feb 2020 12:09:45 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:61978 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726460AbgB0RJo (ORCPT ); Thu, 27 Feb 2020 12:09:44 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48Szg86mjrz9tyl9; Thu, 27 Feb 2020 18:09:40 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=wR2VozWe; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id sWRTNANo0VvI; Thu, 27 Feb 2020 18:09:40 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48Szg85cnNz9tyl6; Thu, 27 Feb 2020 18:09:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1582823380; bh=FcXtMozaz5aKjR+MsTQyybTO/Ns9vbTusP0TC2E6/Rc=; h=Subject:From:To:Cc:References:Date:In-Reply-To:From; b=wR2VozWeQBdMWkmwLMTgbQha488lPIfS8dqydiYIMk0CxSwz4qFGTKE/7UFBGBAnV IvaNU5MzUmAnCSmvKoWvANls5L8e6TnpWVZNMd96+Ty+THmb62qEG/gAjyt5/APY+P UW+vQh0rV6A8qEbCbqtzd6QAtLVyhTz67sRrwubo= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6C2528B880; Thu, 27 Feb 2020 18:09:42 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id fDbqYkuli0hU; Thu, 27 Feb 2020 18:09:42 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 803598B799; Thu, 27 Feb 2020 18:09:40 +0100 (CET) Subject: Re: [PATCH v4 13/13] powerpc/ptrace: move ptrace_triggered() into hw_breakpoint.c From: Christophe Leroy To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , mikey@neuling.org, Russell Currey Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: Message-ID: <4e528bf2-2b53-ae93-cdcc-0c80953f40f2@c-s.fr> Date: Thu, 27 Feb 2020 18:09:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 > #include > #include > -#include > #include > #include > > @@ -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.. > * >