Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp71182ybf; Thu, 27 Feb 2020 16:17:08 -0800 (PST) X-Google-Smtp-Source: APXvYqyuxcMWg6w7GMcaFrJUmCBqbpWNZpy7OB1keuY4nTbSteGi2DdCsijHBifieRNa0kZ3cSnt X-Received: by 2002:a9d:1706:: with SMTP id i6mr1253159ota.151.1582849028855; Thu, 27 Feb 2020 16:17:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582849028; cv=none; d=google.com; s=arc-20160816; b=jFI+OO5to0p0aPsDrSgs5AzZwQtt4ZU3IlCDZtEjCgE2gb374/29FQQdnQFXf3i9IW uXoTMVCVut5NFdZ77LvbraBQrcrXBXKS9cVVhfZbbMyK4pvBTTUGanCH2xpMUnaM2/uO 6WLLyNsdbOPc2/J2S/5WXVAPF3SJGIC1QR2ee/AiU16RUPCrBPekW6IF0oskazBJn8sn /BLFmTKTH9rd9B2Z9/M12nKiJb2WTVbzeISMrgcQY1qyatzfpx4KMjjW0K0w4RIZeCrB 2XgimxRZOAZUwJ+960c3zc7wcce/mVjmuDUfEtTj5LKPeQ8eSBY5nLDpJRa1+gFQKI9Z Z8rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=VgMuq2wX8mbn+y/Awc3vwO6firKTtF6E52gAdT5jeTc=; b=GEm6mKoQh093RWDYpnD33ivsq2Shv0mRTCQmVxVY7v1c8DyPf9cAm0X1jlSFGkix4p 67U/SI5Ii7mK1+HG9D+tgeKNoge4WT3kO5AglriiHcaV5Pf+kTnUvaG0Yf8u3QknI1aK cC6eLES+dDFVI/KiMH2ey2l1QlNZaXaa7eDrbIMywmv7m8ZBqIA4J8agUSE1pMMF+Na3 EPT+iy8qAX0RxdtSit5FEzmgK66z2mjNIVVPzMRuSmnLjgErMVWQyaaj+9OgjHcTru5k 5T1qRfh/kCi9FbeQbcOmAjHBGWVUjGZ6KRZZzOG7MKH4Fw8cDLlTUYT6vFJHC5zeg4Rh STZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=sz19UU8U; 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 k16si780372oiw.128.2020.02.27.16.16.57; Thu, 27 Feb 2020 16:17:08 -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=sz19UU8U; 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 S1730140AbgB1AQm (ORCPT + 99 others); Thu, 27 Feb 2020 19:16:42 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:40327 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729966AbgB1AQl (ORCPT ); Thu, 27 Feb 2020 19:16:41 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48T97q5Fx1z9tyJd; Fri, 28 Feb 2020 01:16:39 +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=sz19UU8U; 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 uJf4Od7wpm_Y; Fri, 28 Feb 2020 01:16:39 +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 48T97q3DQBz9tyJg; Fri, 28 Feb 2020 01:16:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1582848999; bh=VgMuq2wX8mbn+y/Awc3vwO6firKTtF6E52gAdT5jeTc=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=sz19UU8UkVIMATYG5vnX/RfjxCA7NCjRJ8yBFSDKxZPyHqb7Dq+aEG/TP5fX6vW12 cwB86ltfUnkTBN1S+IaZT3aQGgmPZleouObZijZe45JW5PcVWl4qVBYtNG7cmCxdHC ofj6set5qtRi3YA35+xep1RBEGdfk7PRx13Ri3TU= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id BED968B883; Fri, 28 Feb 2020 01:16:39 +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 ieTAiVBS7p_k; Fri, 28 Feb 2020 01:16:39 +0100 (CET) Received: from pc16570vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 766B88B886; Fri, 28 Feb 2020 01:16:39 +0100 (CET) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id EF3586540E; Fri, 28 Feb 2020 00:14:49 +0000 (UTC) Message-Id: <8402c516023da1371953a65af7df2008758ea0c4.1582848567.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v5 13/13] powerpc/ptrace: move ptrace_triggered() into hw_breakpoint.c To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , mikey@neuling.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 28 Feb 2020 00:14:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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.. * -- 2.25.0