Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp303053ybb; Tue, 31 Mar 2020 23:52:26 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtNswr8V3CLCc6yrddpu0M9OPCsdQZs87mlkgbA7/wQ0N/+iGUz76421a+SwXPfuCssbwlV X-Received: by 2002:a9d:412:: with SMTP id 18mr15567200otc.134.1585723945953; Tue, 31 Mar 2020 23:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585723945; cv=none; d=google.com; s=arc-20160816; b=fb+fJCFKpVFJq+KMkPoZQ9v6OnDdPZf/rHNc2s1gPeXbIn0m7TMaMDeoHnW2USlR3p l/vist5+SR/PoT3GVNyOXgtsfsacJXZzH+Xj/+Mlk7HSfWPRQC53pGOk3rw+LYCW93bi MIfa1+MnkBnjkmkm7ol5NjDwpK1kUGEPsauhmP4lBaoYXAQgQLFbab1VETt37Fcw1a/R DTEMirdj8mg1avZb5Ml5PyNGzSwbtOF2D8q5tBXsc7SPOST/oeCjOXXnMzTNCywhnSSf /doFyWbX5qvG6RHrmvigf5yFUcmM8uthaZ/Xw1vWScBdOXSnQ0UN9Msf/IBIi8ocLLcn IR2A== 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 :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject; bh=AMoWY02vuVNrW6Bai3AOrA9I4R4SNqJO9I/6ITKHAg8=; b=TpizFISsJX0lvHUB/AcAu0/1VQmlK0oHXhsiOL19PSIvTZS/4CccF2UOSiTvFTPsZW Hs3f1GKQfNwYxSlY+6XzqVLSfF6Kz7ZUk2iO4nbWE/FKLYL6wYB5Sq/PoufJoDevndW7 805pp1YfAYMTIX+Y+bNYR8ISK1D82hRN7ADHg9K60johsT06ppb+lssdhzCwAXtG6dbe ei3bPGkFH6yxATC1b2AKCx61RPWDkqQwzNR64twyiFduOT8GgRA5SRVLxeikUBm3kP1w r6BpGF4S+MXo97QvmYBe0RO/utT6XLUR2Skdf8aYr5FjFT5zo3XAK6i7weOsAIZX41mM 4HNA== 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 110si395710otu.45.2020.03.31.23.52.13; Tue, 31 Mar 2020 23:52:25 -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 S1731945AbgDAGuS (ORCPT + 99 others); Wed, 1 Apr 2020 02:50:18 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52142 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731741AbgDAGuR (ORCPT ); Wed, 1 Apr 2020 02:50:17 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0316YNLY065196 for ; Wed, 1 Apr 2020 02:50:16 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 304h3vxx6t-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 01 Apr 2020 02:50:16 -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:50:07 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) 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:50:01 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0316o7kV63242476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Apr 2020 06:50:07 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6F0214204B; Wed, 1 Apr 2020 06:50:07 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3210642049; Wed, 1 Apr 2020 06:50:04 +0000 (GMT) Received: from [9.199.48.114] (unknown [9.199.48.114]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 1 Apr 2020 06:50:03 +0000 (GMT) Subject: Re: [PATCH v2 03/16] powerpc/watchpoint: Introduce function to get nr watchpoints dynamically To: Christophe Leroy Cc: mpe@ellerman.id.au, mikey@neuling.org, 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, Ravi Bangoria References: <20200401061309.92442-1-ravi.bangoria@linux.ibm.com> <20200401061309.92442-4-ravi.bangoria@linux.ibm.com> <7851b702-8a93-11a8-6553-e0a51967dfc0@c-s.fr> From: Ravi Bangoria Date: Wed, 1 Apr 2020 12:20:03 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <7851b702-8a93-11a8-6553-e0a51967dfc0@c-s.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20040106-0012-0000-0000-0000039C1E7B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20040106-0013-0000-0000-000021D92D0A Message-Id: 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 malwarescore=0 bulkscore=0 phishscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 clxscore=1015 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004010059 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/1/20 11:59 AM, Christophe Leroy wrote: > > > Le 01/04/2020 à 08:12, Ravi Bangoria a écrit : >> So far we had only one watchpoint, so we have hardcoded HBP_NUM to 1. >> But future Power architecture is introducing 2nd DAWR and thus kernel >> should be able to dynamically find actual number of watchpoints >> supported by hw it's running on. Introduce function for the same. >> Also convert HBP_NUM macro to HBP_NUM_MAX, which will now represent >> maximum number of watchpoints supported by Powerpc. > > > Everywhere else in the code, it is called 'breakpoint', not 'watchpoint'. > > Wouldn't it be more consistent to call the function nr_bp_slots() instead of nr_wp_slots() ? > > Especially as we are likely going to extend your changes to support DABR2 in addition to DABR on BOOK3S/32. Sure. I don't have strong onion for nr_wp_slots() and I can rename it to nr_bp_slots(). but... Even though existing code uses breakpoint and watchpoint interchangeably, I'm using wp/watchpoint to represent data-breakpoint, to distinguish it from instruction-breakpoint (CIABR). So IMHO, nr_wp_slots() should return number DAWRs/DABRs and nr_bp_slots() should return number of CIABRs. Is that okay? Ravi