Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp293286ybb; Tue, 31 Mar 2020 23:35:09 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuWYL8pC9rcHbynzzmUu3fpBDYTYGL+w/nFRLcTFqE7xucAqBQnKvxJQkEtKAE/xMKBZfRn X-Received: by 2002:a05:6830:22e8:: with SMTP id t8mr6396781otc.48.1585722908869; Tue, 31 Mar 2020 23:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585722908; cv=none; d=google.com; s=arc-20160816; b=Bq7cuWbmTkYf6zSMOu0JyBURMTQS0IjAQxpXx8UoHVluh6NbBpUIUcjJALzgYPr2hQ lwquottKy9+vsWgrIrsl6EaVQxKL434G2bbBnDaSowO2Uc9qvVEzroCLjY/Lr2DshhRW fGu0xrpOl10d3HEg8LX5JQbSLtCvk7SypMzs+3JngNCr70lndxfUtSA9LCq5Pz/Gqz7Y qFSEsiwOUmSI4s2fS+uUZOGcultUlYSDE+zp/eIgOJp1jcsU2xg9VynYJWr4RizrGBZx Mfu/Ar53/5fVpq0F/AP8BJN3oEzglHjS8LkjVKXNsB6lZxGdlqfcAIeMRUPb2DRm0s6N /eQA== 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=Wu7Hf+9jIPkGojr6+lEuEJG5F/BNn5V9Djrlob/oB1k=; b=GPotaOa1BYGxo4ANgxOUDf6s37SYc1X9ek85lDURMHe6rkxA06YNI4M7kuBRycMohP WFOhKFacIh/Z7ZMm6ZMXyyz6FohlEBzNun+uneqheufW73h9bXHV2OKd4r5Tcu34krs6 8mu5w1s1T1KCy2BqyCqXj89vo+DTeJDr/bvbjxu7Iv+9HrFaYd1aj5uw+vRSL3USoxpS Z9IzOZg5gCXSHE80G/kg7PG0d4vtOkzhnZ92HJweqTvY/xGL66pPq23rNAdeazJy13SI Xzu02yV0CEiGrThhMm17NSaeaaRQIkrF4+0IS1X5bDpGmSeDLNSRUfCnVhw8VuVWP7Bw Zz9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=Cb5oyV75; 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 s15si516036oie.175.2020.03.31.23.34.56; Tue, 31 Mar 2020 23:35:08 -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=Cb5oyV75; 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 S1731903AbgDAGdk (ORCPT + 99 others); Wed, 1 Apr 2020 02:33:40 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:25085 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731735AbgDAGdk (ORCPT ); Wed, 1 Apr 2020 02:33:40 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48sbxY6r4Xz9txbT; Wed, 1 Apr 2020 08:33:37 +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=Cb5oyV75; 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 zYu6vhpDCY0H; Wed, 1 Apr 2020 08:33:37 +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 48sbxY5JsVz9txbR; Wed, 1 Apr 2020 08:33:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1585722817; bh=Wu7Hf+9jIPkGojr6+lEuEJG5F/BNn5V9Djrlob/oB1k=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Cb5oyV75n6MwS+iynLK6NifEgmf7iS8oiMbsGzDJYP6M+CimG8gcDwmrXaVQnkBR5 0NkTyWqUYmOsih9w2j8opcqOzvtsvYWWAleV2te74sxesizpoeUi0wDuLkvBc0LC+5 xAF9u4BTnHvt7mSwR3hZdmDXf2UB/vKuTo0XJulI= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 878D78B7B3; Wed, 1 Apr 2020 08:33:38 +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 9DYyir0Z_bBL; Wed, 1 Apr 2020 08:33:38 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1AEAA8B778; Wed, 1 Apr 2020 08:33:36 +0200 (CEST) Subject: Re: [PATCH v2 08/16] powerpc/watchpoint: Disable all available watchpoints when !dawr_force_enable 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-9-ravi.bangoria@linux.ibm.com> From: Christophe Leroy Message-ID: <1bef7056-b862-3b20-c3b8-8b161511c60a@c-s.fr> Date: Wed, 1 Apr 2020 08:33:33 +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-9-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 first watchpoint, disable all available > watchpoints while clearing dawr_force_enable. Can you also explain why you change the function name ? > > Signed-off-by: Ravi Bangoria > --- > arch/powerpc/kernel/dawr.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/arch/powerpc/kernel/dawr.c b/arch/powerpc/kernel/dawr.c > index 311e51ee09f4..5c882f07ac7d 100644 > --- a/arch/powerpc/kernel/dawr.c > +++ b/arch/powerpc/kernel/dawr.c > @@ -50,9 +50,13 @@ int set_dawr(struct arch_hw_breakpoint *brk, int nr) > return 0; > } > > -static void set_dawr_cb(void *info) > +static void disable_dawrs(void *info) Wouldn't it be better to keep _cb at the end of the function ? > { > - set_dawr(info, 0); > + struct arch_hw_breakpoint null_brk = {0}; > + int i; > + > + for (i = 0; i < nr_wp_slots(); i++) > + set_dawr(&null_brk, i); > } > > static ssize_t dawr_write_file_bool(struct file *file, > @@ -74,7 +78,7 @@ static ssize_t dawr_write_file_bool(struct file *file, > > /* If we are clearing, make sure all CPUs have the DAWR cleared */ > if (!dawr_force_enable) > - smp_call_function(set_dawr_cb, &null_brk, 0); > + smp_call_function(disable_dawrs, NULL, 0); > > return rc; > } > Christophe