Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1698478ybh; Thu, 16 Jul 2020 21:13:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTNOqzLn5CQbzL2KWZIDfIWn9Ir+A+TtUtky4MJ57eUQ+3FZBz8JvW5fuoBoIzTCM30MpL X-Received: by 2002:a17:906:194b:: with SMTP id b11mr6801817eje.28.1594959204520; Thu, 16 Jul 2020 21:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594959204; cv=none; d=google.com; s=arc-20160816; b=xIlWH9PlEWcELPmuO9vbBwKGPr4DPyJ1MjNcqwFEzHm93n2Bc6VX7UURX2XRDnz1he X2De/5rvmlXVLpJVaFeI3upp9LbjnoDN4z6LtmOixIuICEIbwFkG26fJR+lo9nRG637U vaP0Ifw/jycEiPfXWGxscjuvM0PLbxYAfMOe04zlAOlbGhYnDSYc2LGOhSAw3doi8GEW FRcmoa9YJuEjw+IpiT30Kn1zb0DJD7S3Bl0UNuc16GLgb8C797wfq+NwcqoE5W0ZUeFX Stdw3/2kD5QfwRX4hWiRmJrGknSaffTPHh1vgxg7VKepWGGGEcxwBWL9WYpuG/Xshh9S MjaA== 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=03LnKAMZKW3rRJH+N/R4dh+DZaoODETddSc3ROvh2MCBHXCSh1BhItYKkOg0C/NiXy 5YR68RZmFlmXPtAdqn49eHIAjXE/eLdK0zFMHXfQRw2DKjph/1bzq6S9KDiYqqBmCKR/ WeNP5UdxQmAb+Ag4KtE1hDBC5VLAZO/hdwTrPyB1py0w+bulbdx+M1bdU2bWE0K3/bpW 8On4pvDfl6Z+zNJre4h399vg2o9RiJhHBcmCdaUUDjaHpH0qGhN40TXPlb40zVHIS1U8 Op1li3fKMOy0DxmyOvlaRrZhm5PStSJwnQP21TcTYQy3bPLWTd+o9hSJYaIwdZW4HMIG PwMQ== 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 i23si4448351edx.261.2020.07.16.21.13.02; Thu, 16 Jul 2020 21:13:24 -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 S1727105AbgGQEL3 (ORCPT + 99 others); Fri, 17 Jul 2020 00:11:29 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:51876 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725300AbgGQEL2 (ORCPT ); Fri, 17 Jul 2020 00:11:28 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06H429pV073480; Fri, 17 Jul 2020 00:11:10 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 32axd20mfy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Jul 2020 00:11:10 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06H43HX9076962; Fri, 17 Jul 2020 00:11:09 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 32axd20mew-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Jul 2020 00:11:09 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06H4AmxX003955; Fri, 17 Jul 2020 04:11:06 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma04ams.nl.ibm.com with ESMTP id 329nmyjfvf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Jul 2020 04:11:06 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06H4B4us2818308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Jul 2020 04:11:04 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E2F5CAE053; Fri, 17 Jul 2020 04:11:03 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C9EB1AE045; Fri, 17 Jul 2020 04:10:59 +0000 (GMT) Received: from bangoria.ibmuc.com (unknown [9.199.41.4]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 17 Jul 2020 04:10:59 +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, jniethe5@gmail.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 09/10] powerpc/watchpoint: Return available watchpoints dynamically Date: Fri, 17 Jul 2020 09:39:57 +0530 Message-Id: <20200717040958.70561-10-ravi.bangoria@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200717040958.70561-1-ravi.bangoria@linux.ibm.com> References: <20200717040958.70561-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-16_11:2020-07-16,2020-07-16 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_definite policy=outbound score=100 lowpriorityscore=0 adultscore=0 clxscore=1015 mlxscore=100 malwarescore=0 impostorscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 phishscore=0 spamscore=100 mlxlogscore=-1000 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007170025 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