Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3617270ybd; Tue, 25 Jun 2019 05:49:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxpnQ7nB66TpBmM4BSjd1vDR9LZfRJ8hgVtOHjgfl2N9ADxul9o3NJLpKeHRGOP5aIIrJh X-Received: by 2002:a17:902:ba8e:: with SMTP id k14mr90233565pls.256.1561466956284; Tue, 25 Jun 2019 05:49:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561466956; cv=none; d=google.com; s=arc-20160816; b=sQlFlfDSLNFW09pqyPyLD/0GFRyfr9TswHTM0JXtphtxYiUe/2SJowrM+x3ozhqcCA nfTyZBSdVL9NXvRSZSriDRbZvi26R0xejF8XSkdlpOJ2UeypKz613Bo42sx5IdZG2nqE dm/3mv2m922YuRFbrUX7sVvb+esf7rWiF6LxU83T8lym89tyUYstEL6+CaF7tR/PzOS8 OWfWYvSNLaFV1FyF5xARcY3iNvhp8GLH98lUgpuJZzzJQw6o5QHzcq8+lbxrpt634Q5v Iq1kYxTHdiaFvG3J/Je4VX5eWfV2onhnsmmza88GqDSa2D0PdRcG4B7+ewDUTMBSGa4U K0KA== 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=ePu4eMNIxoLVbLZH+6OKgENhUiu5iCsuhsRzxfdRWUBK9iBeqGtBqbFIh+wPlBn0iB LpDG/6CgrzUQ3egYU2peMsNgl4wH3pJqn+7gIKBzejifs58a346Eo+8PY1ozZv2IMZL2 cSYWEF/tsr4e3EyaOmjS90gdosK0gdxYyIMWVTXvcC3ShoGtcBjmu5IiQHD0hiuSmug6 jGedsQWqgj/nqWCspcj9HAT5IoWFRahVPSPGrgI0KTL/daU464R3XcbBruc2uZhTRo/5 alpFmcPnKua4D+BTNAeTaGIyWxHHG4DUnW9csqSBlzC4LNBE9iacHz6zCd26NJjjB9fI hA9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=m6AeNSdB; 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 d135si12986017pga.557.2019.06.25.05.48.58; Tue, 25 Jun 2019 05:49:16 -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=m6AeNSdB; 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 S1732336AbfFYK6c (ORCPT + 99 others); Tue, 25 Jun 2019 06:58:32 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:44347 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732283AbfFYK6U (ORCPT ); Tue, 25 Jun 2019 06:58:20 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 45Y36d3J6Qz9v17r; Tue, 25 Jun 2019 12:58:17 +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=m6AeNSdB; 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 OxWGqRaCTz10; Tue, 25 Jun 2019 12:58:17 +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 45Y36d2Cqkz9v17h; Tue, 25 Jun 2019 12:58:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1561460297; bh=Ln7ZZvZ0SHqaIWGo6RTPChz1diaojm7DgP9hQPaJ4hI=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=m6AeNSdB2WQHYLtqGVPNi0D1ESANBRJsS7ipJ9Uu3W4UG8gZ/3G33QgngMBBLWHZ0 tXpn0MPM75DHIQ4qs9ClFdaoVfIhipb/YoHrZbTsVXTIgEWb9tH0H0ULYXxCUchilJ 93/BlBfvGrcR5J+0RXXbZq8AyWRSi+fqWA/6oPfk= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 83B948B879; Tue, 25 Jun 2019 12:58:18 +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 AuMgIBkSsmSb; Tue, 25 Jun 2019 12:58:18 +0200 (CEST) Received: from pc17473vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 56C0E8B874; Tue, 25 Jun 2019 12:58:18 +0200 (CEST) Received: by pc17473vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 3028D68E1B; Tue, 25 Jun 2019 10:58:18 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [RFC PATCH v1 12/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: Tue, 25 Jun 2019 10:58:18 +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