Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2247071ybh; Mon, 9 Mar 2020 02:00:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtRUqaWj2af/8wpqmd3y1r/GAQTR4O9FmgmAab63fW/jsGOOQcDp0dLy6A70dJCouZohgbH X-Received: by 2002:aca:ef08:: with SMTP id n8mr138482oih.115.1583744430807; Mon, 09 Mar 2020 02:00:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583744430; cv=none; d=google.com; s=arc-20160816; b=z4X2AA4iTPzljtzW1FKlVHJRozrWG44Xy8/wsw6bS3oz0Yx6jDQewAslB2B1sfIEqR iCzjgnlNHLP2v1867bs2CXj9ijyq5vnBbw0ZhY3s18f77x0VW35qwXmBJOaL9Qi/MFKV viLrFaa7e664tDKumRy+22G+pdzj+kk9aTrnvmLcbbXC6ZlRlIJtsy/beC6J/5CFODDg y7xO+6orDvvAF78ExRBwT/fbtRTcbechSBxoCSEIlyzw3CMN9XIP5KeBvd5QUFVWTNEA d+jMBJSG4TdLh7MkoRvjHGKSerQndWsGVyanhTE/8N7CzQS4m/f9SaCG1jz2ilS9SfwR PAdw== 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=RKAxdUZXWEFX/+la9oiEb2bdz2Xx8mQhtoPfFav6rkg=; b=ppyTGsCfh5+2lUSXCPkD4Q4EBO9WFFEUheUEGxlx6grZ76pZ1QNIYJC49YPrWN9DxL Gw090zJyfzThPzWxQ7bh9/9ACOhe+4jllWR+sn1P51YSIo0J2lb8/LMynMrWHhZ4PU6b j4RwoSn6BPS5uSDImqHA5lThPIZ6p28RDzW8M4i2kR2tbzBzaqB//Ctne3Q8bLx7clAu Zizu6PUtn0TnjBOjn14zaV/d9cE3x+IaQmR0L35s+ljYw6q4cM46HKXBhJW4oNvsAAZf Gjsxpvtwy7+0gORDKJl6vWIoDrG1SJ+yZbGWid+oEVFu/tvONnS/dhlIsfrorIFWukJi N9RQ== 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 q126si3976421oia.8.2020.03.09.02.00.19; Mon, 09 Mar 2020 02:00:30 -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 S1726759AbgCII7P (ORCPT + 99 others); Mon, 9 Mar 2020 04:59:15 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:2738 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726705AbgCII7M (ORCPT ); Mon, 9 Mar 2020 04:59:12 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0298pVmH084575 for ; Mon, 9 Mar 2020 04:59:10 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ym5e1rrry-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 09 Mar 2020 04:59:10 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Mar 2020 08:59:09 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 9 Mar 2020 08:59:04 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0298x3Pj33489016 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Mar 2020 08:59:03 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1C3BFA4040; Mon, 9 Mar 2020 08:59:03 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9819DA405D; Mon, 9 Mar 2020 08:59:00 +0000 (GMT) Received: from bangoria.in.ibm.com (unknown [9.124.31.44]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 9 Mar 2020 08:59:00 +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 Subject: [PATCH 08/15] powerpc/watchpoint: Disable all available watchpoints when !dawr_force_enable Date: Mon, 9 Mar 2020 14:27:59 +0530 X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200309085806.155823-1-ravi.bangoria@linux.ibm.com> References: <20200309085806.155823-1-ravi.bangoria@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20030908-4275-0000-0000-000003A9B430 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20030908-4276-0000-0000-000038BEC9E8 Message-Id: <20200309085806.155823-9-ravi.bangoria@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-03-09_02:2020-03-06,2020-03-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 priorityscore=1501 adultscore=0 malwarescore=0 phishscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 mlxscore=0 mlxlogscore=619 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003090066 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of disabling only first watchpoint, disable all available watchpoints while clearing dawr_force_enable. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/dawr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/dawr.c b/arch/powerpc/kernel/dawr.c index 311e51ee09f4..5c882f07ac7d 100644 --- a/arch/powerpc/kernel/dawr.c +++ b/arch/powerpc/kernel/dawr.c @@ -50,9 +50,13 @@ int set_dawr(struct arch_hw_breakpoint *brk, int nr) return 0; } -static void set_dawr_cb(void *info) +static void disable_dawrs(void *info) { - set_dawr(info, 0); + struct arch_hw_breakpoint null_brk = {0}; + int i; + + for (i = 0; i < nr_wp_slots(); i++) + set_dawr(&null_brk, i); } static ssize_t dawr_write_file_bool(struct file *file, @@ -74,7 +78,7 @@ static ssize_t dawr_write_file_bool(struct file *file, /* If we are clearing, make sure all CPUs have the DAWR cleared */ if (!dawr_force_enable) - smp_call_function(set_dawr_cb, &null_brk, 0); + smp_call_function(disable_dawrs, NULL, 0); return rc; } -- 2.21.1