Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp292507ybb; Tue, 31 Mar 2020 23:33:50 -0700 (PDT) X-Google-Smtp-Source: APiQypKuYKPRLLEF9nEolrvO4UKo8q4jHCFAPpz/UTyXlsJkLkZ2MFQtt9c+S0/+1Jqq+f8UnVXw X-Received: by 2002:a05:6808:648:: with SMTP id z8mr1813092oih.72.1585722830664; Tue, 31 Mar 2020 23:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585722830; cv=none; d=google.com; s=arc-20160816; b=Ur8GdvW7a9ezEmRal8CB2YbPMaMCT5xJnCsIsYR4xu6Cu6l9zmWl4WbPHxG7mKVr6q 7Cc9d6ebWqKP8IcyPH9TmHRe1KSKfNoCIYC7/UZxMHUw450POEtfVAx/IMkf85Z8ds5F wTUUSpG+K74llm27icSy43VMEwqVwVkw7Ro87JDMbDHbQsEG8su0qiH70ULJJ/NsR+UY fUSCk0Zj/cehhNr2PabPS+BYq/dC3ikkU+hHECdyCZrE095v6R8gPIJXCigx4phbAvd9 yTj8nsv1idpo/xQ0JrVDZH8CFPjpyLbUacSHsUSDnSbVxrna5niSGy8JCS44R+9FEl44 HeIg== 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:from:references:cc:to:subject:dkim-signature; bh=fz42DDV9ApxpNWS9T44dvSssW81bIergY+V0OGliRCc=; b=rWiUtzuOfKHR5/4FDtI+pU3Zoav/jXhudLD8qrs0lxGBLcKF0iLAOx3thTVPjaI9y4 wAM5jOMuPuxk782YpHkT6errAfjZ5dLDnkKpPe0Ie3tazD+gtzwZLHiW9WtmBbjAcWLQ RHPnTjYw6Zgux+YkvUSc5wbs8CNgYVc3YMDJ0G/qzGmufUp5Psz/sj/UjFlL9LKAOFgE 2IalqgOW3t6Z5q2Ma1VQhZtjztU9oEUgIHin0IoBRIhXuKUoUwafJ7RK/u7PBGDBX0cE QaWfwbth1kdmlzHwnoxkFv4zSgD5GE56udcxBjlcwYvdZyG+d0QCKd9EV9mxfcJ3RQQK FphA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=M2cJ07AQ; 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 j192si511004oih.233.2020.03.31.23.33.38; Tue, 31 Mar 2020 23:33:50 -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=M2cJ07AQ; 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 S1731784AbgDAGcH (ORCPT + 99 others); Wed, 1 Apr 2020 02:32:07 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:31373 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731589AbgDAGcH (ORCPT ); Wed, 1 Apr 2020 02:32:07 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48sbvn111rz9txbS; Wed, 1 Apr 2020 08:32:05 +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=M2cJ07AQ; 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 N82vlwFNG6uA; Wed, 1 Apr 2020 08:32:05 +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 48sbvm6lDrz9txbR; Wed, 1 Apr 2020 08:32:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1585722724; bh=fz42DDV9ApxpNWS9T44dvSssW81bIergY+V0OGliRCc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=M2cJ07AQx+wEWbJgoO7fxKln758xBxks6FjTnnm5oYwoVzyuOkCV216Qwwh5oxJIK 9oTk8dh//opPicmXTptz+XB74i+IwhiG7ij7iZo9c5nnu3Na44QIvaxca3P08EB5RA 2+eZoW8s3LmzBjQlO4IA5//hYNUTkrWB6KqB4rV0= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id BC48E8B7B3; Wed, 1 Apr 2020 08:32:05 +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 G8hXNfMZR6VY; Wed, 1 Apr 2020 08:32:05 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 57F1E8B778; Wed, 1 Apr 2020 08:32:03 +0200 (CEST) Subject: Re: [PATCH v2 07/16] powerpc/watchpoint: Get watchpoint count dynamically while disabling them To: Ravi Bangoria , mpe@ellerman.id.au, mikey@neuling.org Cc: apopple@linux.ibm.com, paulus@samba.org, npiggin@gmail.com, 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 References: <20200401061309.92442-1-ravi.bangoria@linux.ibm.com> <20200401061309.92442-8-ravi.bangoria@linux.ibm.com> From: Christophe Leroy Message-ID: <3c2312bb-9689-830e-3bc8-c828eddf369c@c-s.fr> Date: Wed, 1 Apr 2020 08:32:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200401061309.92442-8-ravi.bangoria@linux.ibm.com> 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 Le 01/04/2020 à 08:13, Ravi Bangoria a écrit : > Instead of disabling only one watchpoint, get num of available > watchpoints dynamically and disable all of them. > > Signed-off-by: Ravi Bangoria > --- > arch/powerpc/include/asm/hw_breakpoint.h | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > > diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch/powerpc/include/asm/hw_breakpoint.h > index 4e4976c3248b..fae33c729ba9 100644 > --- a/arch/powerpc/include/asm/hw_breakpoint.h > +++ b/arch/powerpc/include/asm/hw_breakpoint.h > @@ -78,14 +78,13 @@ extern void ptrace_triggered(struct perf_event *bp, > struct perf_sample_data *data, struct pt_regs *regs); > static inline void hw_breakpoint_disable(void) > { > - struct arch_hw_breakpoint brk; > - > - brk.address = 0; > - brk.type = 0; > - brk.len = 0; > - brk.hw_len = 0; > - if (ppc_breakpoint_available()) > - __set_breakpoint(&brk, 0); > + int i; > + struct arch_hw_breakpoint null_brk = {0}; Those declaration should be in the block unsigned them below. > + > + if (ppc_breakpoint_available()) { > + for (i = 0; i < nr_wp_slots(); i++) > + __set_breakpoint(&null_brk, i); > + } I would have had a preference to the following, but that's detail I guess: int i; struct arch_hw_breakpoint null_brk = {0}; if (!ppc_breakpoint_available()) return; for (i = 0; i < nr_wp_slots(); i++) __set_breakpoint(&null_brk, i); > } > extern void thread_change_pc(struct task_struct *tsk, struct pt_regs *regs); > int hw_breakpoint_handler(struct die_args *args); > Christophe