Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp277810ybb; Tue, 31 Mar 2020 23:15:30 -0700 (PDT) X-Google-Smtp-Source: APiQypIIr3n2bFQzuSmd0Mpi4ragzSTOSK/A723pzCjdgK3w9WhlmxXmM9/N1DW/ktnvDJ1PgeUz X-Received: by 2002:a05:6808:8cb:: with SMTP id k11mr1643742oij.48.1585721730804; Tue, 31 Mar 2020 23:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585721730; cv=none; d=google.com; s=arc-20160816; b=LKAPayOSCcChfG9L8nacRxnttNjoP8hlOO0WF4xwf55QV2c/7QXvJOFtBHwPAELG4I jQBH+2Gq8VXKaCLB0laEA1qInQT6mqJtj3CBA8LdFWq64aWLMzuZaS4gNTY1HfTXdDDF mMQb7KkZStFnKOI4USdyV4y1nR1iTbsjcmbYD7uKPK/RAJrsJzf8BW6cWy/IxtYDDK3m aYr4melqK3wdsVuR1YTpg+zCUynemXIlZbhMX7oIPgtpfPqqo53CwJOU/Tw2a6fb7Vrv vWuI0Tr0vOSn0NovHE1+p0ihxRdxKbfSPn+c4PbjmnKI0+JD/LhZt5srNskErPpT/Ttx D/tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from; bh=QcTosUEXH/i2vDMKE+CItuGrG/i/4Vt6VXMyLn+toEY=; b=fR7ygEFkxwf2fFspbuvK6CV0mRwMDDmdyBGnZiXI7biA/nGfYlFm/U4aLWJjZ0HQAc uKL4UBaqt0Pfz3HnehB10reJklQHkCDkXC3hge2CjXIZXjj8Grn2/IU4rgksu2gR5ahu pGZNzTwBEYwD5HegqL9oPbZR6wVpoRhmVVvgR/lrmE61Th9aO9K5nG541Dt5u6/gU88z NCQWwf1SJKTC2K7x2DyGzvsT/KzZ5XEXBiFIG4UkwB9JKr40tik1dao885K3jp752A+f 3j4D2eUtBDgo93tg3gl3d/3CegqS5JlAYoQp37vkqO8Y9BVpdHTlLFptVJVe5KUibKpr HDrA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si520335oif.63.2020.03.31.23.15.18; Tue, 31 Mar 2020 23:15:30 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731968AbgDAGOe (ORCPT + 99 others); Wed, 1 Apr 2020 02:14:34 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57626 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731895AbgDAGOd (ORCPT ); Wed, 1 Apr 2020 02:14:33 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03163qO0099598 for ; Wed, 1 Apr 2020 02:14:32 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 3043g7x88w-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 01 Apr 2020 02:14:32 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Apr 2020 07:14:23 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 1 Apr 2020 07:14:19 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0316EPPo42860674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Apr 2020 06:14:25 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 098ACA4040; Wed, 1 Apr 2020 06:14:25 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6C3E3A404D; Wed, 1 Apr 2020 06:14:21 +0000 (GMT) Received: from bangoria.ibmuc.com (unknown [9.199.48.114]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 1 Apr 2020 06:14:21 +0000 (GMT) From: Ravi Bangoria To: mpe@ellerman.id.au, mikey@neuling.org Cc: apopple@linux.ibm.com, paulus@samba.org, npiggin@gmail.com, christophe.leroy@c-s.fr, naveen.n.rao@linux.vnet.ibm.com, peterz@infradead.org, jolsa@kernel.org, oleg@redhat.com, fweisbec@gmail.com, mingo@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, ravi.bangoria@linux.ibm.com Subject: [PATCH v2 11/16] powerpc/watchpoint: Introduce is_ptrace_bp() function Date: Wed, 1 Apr 2020 11:43:04 +0530 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401061309.92442-1-ravi.bangoria@linux.ibm.com> References: <20200401061309.92442-1-ravi.bangoria@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20040106-0012-0000-0000-0000039C1A6D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20040106-0013-0000-0000-000021D928E9 Message-Id: <20200401061309.92442-12-ravi.bangoria@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-03-31_07:2020-03-31,2020-03-31 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 malwarescore=0 mlxlogscore=772 impostorscore=0 clxscore=1015 phishscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004010049 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce is_ptrace_bp() function and move the check inside the function. We will utilize it more in later set of patches. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c index 6daa95b8bb88..8d3f7d87d790 100644 --- a/arch/powerpc/kernel/hw_breakpoint.c +++ b/arch/powerpc/kernel/hw_breakpoint.c @@ -90,6 +90,11 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp) hw_breakpoint_disable(); } +static bool is_ptrace_bp(struct perf_event *bp) +{ + return bp->overflow_handler == ptrace_triggered; +} + /* * Perform cleanup of arch-specific counters during unregistration * of the perf-event @@ -324,7 +329,7 @@ int hw_breakpoint_handler(struct die_args *args) * one-shot mode. The ptrace-ed process will receive the SIGTRAP signal * generated in do_dabr(). */ - if (bp->overflow_handler == ptrace_triggered) { + if (is_ptrace_bp(bp)) { perf_bp_event(bp, regs); rc = NOTIFY_DONE; goto out; -- 2.21.1