From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68943C43331 for ; Wed, 1 Apr 2020 06:50:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41542206F6 for ; Wed, 1 Apr 2020 06:50:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731954AbgDAGuS (ORCPT ); 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