Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3448667ybd; Fri, 28 Jun 2019 08:48:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzx6XMeHc3tHgejgV06s74YE9XplG7KMW0ysfpoBsJ9tUTOapVBvgSf8f1Dsa3dCLYJdkuG X-Received: by 2002:a63:7a4f:: with SMTP id j15mr10156403pgn.427.1561736937530; Fri, 28 Jun 2019 08:48:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561736937; cv=none; d=google.com; s=arc-20160816; b=XX0SU9ufTnBm8t8JYTfQaQeCHXHwPbh3Sp6ejNTAq0YDdaXo5XAz2wTif8w+nlxR4t T7vPmE2a139+9dr702haQrVh0aMyXa88l6pjuSopskPUmDkUCnXy30CzlA/6S+ob3oZx wWCw0f5Is28cTRU4BkzgrDUhTLIoDxQhroekL+vQmqdEwSxb7wpbpsBvbIfZwIOwGMnb 5h9kFenzS/Vi+ov7YB5HpB7JiMBruCM2UdIAzNEHad/z8Fm6YvZzi38Fje7pYXS8l4Er Liie6BerjUEyxQ8g2iPd7fczlU9ae4tPNjl+uI4Y5fRd7rur/+CLhu35eNq6fgqRYGOo lnRw== 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=Ln7ZZvZ0SHqaIWGo6RTPChz1diaojm7DgP9hQPaJ4hI=; b=S592u91GgjQHxMl+OT4p3PqRKXYIdkKpbMt8VOc8JiHVe0MRCJFp1uanymKYt25I+H Z2yojPsCF3BrEfR1tGgedyXkuyW7fnwnazaZrZ7PGz3jBqWqivIN1hVjMBymug68Ja79 FtQO3xe86XErZ6f8jNSwEKScFJEne1HPBQqsWZnpNBuZivplpsx3XoeWHkhxJRvd4Pd9 Qqqg299xcyl//r09n3zbGJo2e5JISZve16PKvogZJxBm8xROzWSj3ZHJqsV4YJ66ejUl py7u+qpeJNMbW/oqVzGc55qClRe0hE9sKfDVY7ZTgQKUg4ZhTI/HXC2m8qunQulqQ/AP /tTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=E4SDiSUQ; 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 f9si2346895pgg.450.2019.06.28.08.48.41; Fri, 28 Jun 2019 08:48:57 -0700 (PDT) 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=E4SDiSUQ; 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 S1727295AbfF1PsK (ORCPT + 99 others); Fri, 28 Jun 2019 11:48:10 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:21601 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727263AbfF1PsF (ORCPT ); Fri, 28 Jun 2019 11:48:05 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 45b1PY3sZXzB09ZR; Fri, 28 Jun 2019 17:48:01 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=E4SDiSUQ; 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 S_b1aa8KGd-v; Fri, 28 Jun 2019 17:48:01 +0200 (CEST) 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 45b1PY2q4KzB09ZN; Fri, 28 Jun 2019 17:48:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1561736881; bh=Ln7ZZvZ0SHqaIWGo6RTPChz1diaojm7DgP9hQPaJ4hI=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=E4SDiSUQfXeWBIbBngiOU8xY3zmDpfb236Gt7IMdVRpJY8lF51S+5xnqFVEhlOb6y 0DnMgGuHlY8VP4y3+rI3gt64JJkX/KubWSA3jrmaQdLHiSgzZ4+lVgu4jRamKETkKC tXHt7Lr+2vDa8dk5rFTu1rJ9j2IfftxQ4dWQG1lg= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 623CA8B975; Fri, 28 Jun 2019 17:48:02 +0200 (CEST) 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 BWMLVdrpWH_2; Fri, 28 Jun 2019 17:48:02 +0200 (CEST) Received: from localhost.localdomain (po15451.idsi0.si.c-s.fr [172.25.230.101]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2917A8B955; Fri, 28 Jun 2019 17:48:02 +0200 (CEST) Received: by localhost.localdomain (Postfix, from userid 0) id 0DABC68DBC; Fri, 28 Jun 2019 15:48:02 +0000 (UTC) Message-Id: <91218c7e0ea432e188c6d164097d383360f3c2e0.1561735588.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [RFC PATCH v2 12/12] 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 Jun 2019 15:48:02 +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 --- arch/powerpc/kernel/hw_breakpoint.c | 16 ++++++++++++++++ arch/powerpc/kernel/ptrace/ptrace.c | 18 ------------------ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c index a293a53b4365..b71d3837d673 100644 --- a/arch/powerpc/kernel/hw_breakpoint.c +++ b/arch/powerpc/kernel/hw_breakpoint.c @@ -367,6 +367,22 @@ 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); +} + bool dawr_force_enable; EXPORT_SYMBOL_GPL(dawr_force_enable); diff --git a/arch/powerpc/kernel/ptrace/ptrace.c b/arch/powerpc/kernel/ptrace/ptrace.c index 31e8c5a9171e..b85998b159d7 100644 --- a/arch/powerpc/kernel/ptrace/ptrace.c +++ b/arch/powerpc/kernel/ptrace/ptrace.c @@ -50,24 +50,6 @@ #include -#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.13.3