Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp242446ybt; Tue, 7 Jul 2020 21:55:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyikIPEmo1Ydbj+DWCHepebcae/u4/eEbOZVwSSUWYqYVnyD00Lzuh9AHMBhaJpbodlV/aN X-Received: by 2002:a17:906:b24d:: with SMTP id ce13mr52796969ejb.546.1594184113189; Tue, 07 Jul 2020 21:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594184113; cv=none; d=google.com; s=arc-20160816; b=idScq8wQVgsqshq2R1K4mYQTOVukMa6+6qOZsvZfNhLiXjmxQOn1eflBQIz3ghH46B I/f1KP8B9OH8ycwGup5dlx+bBn9suKZHk5JqM79uH04ZB3NhR/2156lC3/IYPK+xZJEg 8WL1MEtFR8qW49dQhI1Hl85soSPICHFOjNf+s1tTVNT3+n51C4Zovd65Sq8Ag7CCkQMv rhy7y00GaZI8SYesMhM9jA+6e6/ppVg2Uw9gWY+raaVeOHyLk+pJcQU9JVrPKMYwpTx+ 6CyDlQZ8lsUrJP1zbStrOy7mDpuojQIh1+EJi9RCspJ0oBdJl0FnfaozLgv3py/rdKaq x7uw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=98yGP19rQ7nfUIKLJS7YgcEPRyD0ZG6O/64wOdVkeMk=; b=CMFTQx0PSj/nAW8cIU3Ra06gK5DtN+VL/qk/tCu4h0uAHL4Pa1XedNM50w7mUbXjt0 wB2BXsuHE+Gxm5SjdDpubfdwDdCnF2BR9hn5bweznn8tYx8SPvKWFr5X/Qgs3EigZCe5 pHfg2mIQmwwMuYxXck/4dm7DEN0RzHxKHQsoOG2ehDtRr+UFb3cSbLWDiym/M16QpKoi GAvDLGL7z/Dw6Q4ZuRVZzUGvRH/mir4sT2KX35L9tV5BPEuLxmrpNWdcocIUbmZoAwsL ARXMN/sRB6Q0VG+ZbnOSSbGzBtcTY7cfjOjb1moEBzOkZrBjqxlc/5ZnYpW3nzAs/1v3 H68g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id n17si16250395ejc.193.2020.07.07.21.54.48; Tue, 07 Jul 2020 21:55:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729539AbgGHEwD (ORCPT + 99 others); Wed, 8 Jul 2020 00:52:03 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:26696 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729622AbgGHEvy (ORCPT ); Wed, 8 Jul 2020 00:51:54 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0684XpOi105120; Wed, 8 Jul 2020 00:51:35 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3253d1ncs6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 00:51:34 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0684XqZq105275; Wed, 8 Jul 2020 00:51:34 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3253d1ncrn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 00:51:34 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0684kvfo012667; Wed, 8 Jul 2020 04:51:32 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06ams.nl.ibm.com with ESMTP id 322h1h425b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 04:51:31 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0684o79l52494814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Jul 2020 04:50:07 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0B6E0AE04D; Wed, 8 Jul 2020 04:51:29 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7017EAE051; Wed, 8 Jul 2020 04:51:25 +0000 (GMT) Received: from bangoria.ibmuc.com (unknown [9.199.51.84]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 8 Jul 2020 04:51:25 +0000 (GMT) From: Ravi Bangoria To: mpe@ellerman.id.au, mikey@neuling.org Cc: ravi.bangoria@linux.ibm.com, 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, pedromfc@br.ibm.com, miltonm@us.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 8/9] powerpc/watchpoint: Return available watchpoints dynamically Date: Wed, 8 Jul 2020 10:20:45 +0530 Message-Id: <20200708045046.135702-9-ravi.bangoria@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200708045046.135702-1-ravi.bangoria@linux.ibm.com> References: <20200708045046.135702-1-ravi.bangoria@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-08_01:2020-07-08,2020-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 cotscore=-2147483648 phishscore=0 suspectscore=0 malwarescore=0 priorityscore=1501 spamscore=0 impostorscore=0 mlxscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007080029 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org So far Book3S Powerpc supported only one watchpoint. Power10 is introducing 2nd DAWR. Enable 2nd DAWR support for Power10. Availability of 2nd DAWR will depend on CPU_FTR_DAWR1. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/cputable.h | 4 +++- arch/powerpc/include/asm/hw_breakpoint.h | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h index 3445c86e1f6f..36a0851a7a9b 100644 --- a/arch/powerpc/include/asm/cputable.h +++ b/arch/powerpc/include/asm/cputable.h @@ -633,7 +633,9 @@ enum { * Maximum number of hw breakpoint supported on powerpc. Number of * breakpoints supported by actual hw might be less than this. */ -#define HBP_NUM_MAX 1 +#define HBP_NUM_MAX 2 +#define HBP_NUM_ONE 1 +#define HBP_NUM_TWO 2 #endif /* !__ASSEMBLY__ */ diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch/powerpc/include/asm/hw_breakpoint.h index cb424799da0d..d4eab1694bcd 100644 --- a/arch/powerpc/include/asm/hw_breakpoint.h +++ b/arch/powerpc/include/asm/hw_breakpoint.h @@ -5,10 +5,11 @@ * Copyright 2010, IBM Corporation. * Author: K.Prasad */ - #ifndef _PPC_BOOK3S_64_HW_BREAKPOINT_H #define _PPC_BOOK3S_64_HW_BREAKPOINT_H +#include + #ifdef __KERNEL__ struct arch_hw_breakpoint { unsigned long address; @@ -46,7 +47,7 @@ struct arch_hw_breakpoint { static inline int nr_wp_slots(void) { - return HBP_NUM_MAX; + return cpu_has_feature(CPU_FTR_DAWR1) ? HBP_NUM_TWO : HBP_NUM_ONE; } #ifdef CONFIG_HAVE_HW_BREAKPOINT -- 2.26.2