Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp279338ybb; Tue, 31 Mar 2020 23:16:46 -0700 (PDT) X-Google-Smtp-Source: APiQypICPm40ipSfxnKG1RerZu1ak6bIh8qNiDzQWaoPYK2a3RmRHIGIKbUD72+uX2eOW8PxgOui X-Received: by 2002:a05:6808:18b:: with SMTP id w11mr1688814oic.94.1585721806806; Tue, 31 Mar 2020 23:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585721806; cv=none; d=google.com; s=arc-20160816; b=AJUuKCdJRo2zQkvcbgcGsw8iTvNzrNQQNiTRPwb8PKl8vEZzMdkHGViMv7v/C1fu0E 3tpxJzhte0dnPx+/qL21E5gyR7VlweEGOSfgZ1hr1bqdmTh8/9AcUyexirR/s0XyJRyS Kee/hj8DlOT6SbOAnQvoVHEVpVq0MNg5Vrhu+A3kCGb0HIlajHxx6K94jv6E8QpOAC4m XEDUGCNWiBHzRwLLpB7l9aNraR+n5OysdcegNH2H3VN6dDDg5mvm80ZqvAXIpg0vJ3w2 EZEW92SggRfwgK+9OLz50dd7SFtH4gMR3ySuBT54VjsYOA9TLD4LzJxaQ+FpNjVdjW0G 8pBA== 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 :mime-version:references:in-reply-to:date:subject:cc:to:from; bh=7KzUj/ktZBNlrjUU4lEM+nyxN8rIJXhLWqJSHAlilEE=; b=BKHz+OMTRgPF3Q8xeCOgHkzTbs5QLMbGo8jfwa9nMktYuz0DzFm+rEVrz254QnlGNR QCMjuNS7exmbA5k+4CIl1wVGL8B70O/69DeyEeDDp3LZEM6pJKuLBTw12x5G5dTTLGzA fTtuLBnZ4fvhqJiURgXidXEceM9nl2GHtA7X9q8Z+c/CuebDYZRVXdgSa/p0jxZhtS3F qfg2TrCI+FUJEBYg2uvxCN7Aw1nq0M67tbf3f78pIgiT1Fwkbd8L4KwdS7RBKMM1uDi4 r/6760jz6r68Pl03zvQgBiqvPced/YANszVtMlxpnoMP357bknjfixOG18/grlNSGHo2 tGTw== 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 s15si509278oie.175.2020.03.31.23.16.34; Tue, 31 Mar 2020 23:16:46 -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 S1732018AbgDAGOv (ORCPT + 99 others); Wed, 1 Apr 2020 02:14:51 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57184 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731895AbgDAGOu (ORCPT ); Wed, 1 Apr 2020 02:14:50 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03163KKG033173 for ; Wed, 1 Apr 2020 02:14:49 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 3020700qgf-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 01 Apr 2020 02:14:49 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Apr 2020 07:14:37 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp02.uk.ibm.com (192.168.101.132) 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:14:31 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0316EeUm49152018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Apr 2020 06:14:40 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A9D31A4059; Wed, 1 Apr 2020 06:14:40 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 444F4A4051; Wed, 1 Apr 2020 06:14:37 +0000 (GMT) Received: from bangoria.ibmuc.com (unknown [9.199.48.114]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 1 Apr 2020 06:14:37 +0000 (GMT) From: Ravi Bangoria To: mpe@ellerman.id.au, mikey@neuling.org Cc: 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, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, ravi.bangoria@linux.ibm.com Subject: [PATCH v2 15/16] powerpc/watchpoint/xmon: Don't allow breakpoint overwriting Date: Wed, 1 Apr 2020 11:43:08 +0530 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401061309.92442-1-ravi.bangoria@linux.ibm.com> References: <20200401061309.92442-1-ravi.bangoria@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20040106-0008-0000-0000-0000036848AB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20040106-0009-0000-0000-00004A89CFA8 Message-Id: <20200401061309.92442-16-ravi.bangoria@linux.ibm.com> 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 clxscore=1015 malwarescore=0 spamscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=762 suspectscore=2 bulkscore=0 phishscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004010049 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Xmon allows overwriting breakpoints because it's supported by only one dawr. But with multiple dawrs, overwriting becomes ambiguous or unnecessary complicated. So let's not allow it. Signed-off-by: Ravi Bangoria --- arch/powerpc/xmon/xmon.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 508d353e7f06..a1e36501af25 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -1382,6 +1382,10 @@ bpt_cmds(void) printf("Hardware data breakpoint not supported on this cpu\n"); break; } + if (dabr.enabled) { + printf("Couldn't find free breakpoint register\n"); + break; + } mode = 7; cmd = inchar(); if (cmd == 'r') -- 2.21.1