Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp351689lqb; Thu, 29 Feb 2024 03:01:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVtZ4NcquASwUqpnXhQh11WP6r/tnuNhBg+0TGEf2yRjKqi8Qgh+hPXPiCMAhT/ZnTsHz6GsKq3gw/Bi4L2rI04N3UheeQIiAWQAyPXeQ== X-Google-Smtp-Source: AGHT+IHjpyUf9yNwhcEDbn24hyZUra4GtiIW2wozfjravpuFMzKcR8fveIudC/dzPRQ2727Qs6eG X-Received: by 2002:a05:6871:48b:b0:21e:6505:6348 with SMTP id f11-20020a056871048b00b0021e65056348mr2053564oaj.9.1709204480119; Thu, 29 Feb 2024 03:01:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709204480; cv=pass; d=google.com; s=arc-20160816; b=RyX6Xurbmw3ldXngptXz+g3px3OWzVimZr776MszocevqtiMW4Kq9JAsbUZ+sC5wL6 r9LSELbJkAkpCF8rALjNVFZuceXZYzb5//x+p6dX+XRmpMdBVunByGBt4ne6sC6OE/oq 6RFWzNOx3wWv1MRBfvkj2TxsB1RCsJZ9fhhZQYjRyGpBlet5EAPFTcmPUSN9dPLV/PFH 9MPHR9j4uLz8p1msM4T4Ijm5bmGK26FLBp9qB0U7JmC8udieACWUkSTPdp8SRyhOi21z BV6pIa29ZCY/nezdojl/DSd+I+HBHR/ox2FuHVTJGuUqqGT9YWq+BDW733LAZ/7eOboh z3rw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=d6LKgb/B5vNX69OBrunxtFkHH3XWfEuZEaTY78XHXAQ=; fh=bE9v/Z30j+0npZLu9jeHxKgwYySRRTmdoTZBC2PeiZc=; b=b+XoMIpmAx7a8KaUnKiwsPb08k1mLNBY5Cq8AJ88TQR3BdkCkPbkNW2fftmswJVB6r lxP/oWaWrUkRPB85BLml9wHsSMiV0jMs01+EbjmyGkNuAV/gK6zbAQP6Yh5Y2k/WeO0x gcS900yz+fCD3lm2Lcfc4HWflfQ8JQn5t+LhDtRFelffD0AqwuRIOoyR/Vo3O+/my+2K 8mJ4k+Ibp04e4cjRdLa6FHLTFSut4AVTKs0ppWIPFXJB3jBgiL2gVoTotpVVFD8dD1Jh AnNUXporgdYWDemZyvzPGXrSYvx37yun+XvDlZM2dneYa0SBF7x5Dn/46fgBIfA6PtE/ a6Bw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-86600-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id po26-20020a05620a385a00b00787a705add2si1133447qkn.210.2024.02.29.03.01.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 03:01:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86600-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-86600-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CF7F31C22FF5 for ; Thu, 29 Feb 2024 11:01:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D9767A73E; Thu, 29 Feb 2024 11:01:17 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3CDE865194 for ; Thu, 29 Feb 2024 11:01:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709204476; cv=none; b=IPMWtSHBXAGn8TUUm5yV9UlcYTzghlGjMYtwYiYqln5mDC964Hi7pGdl9NgXAmpR36oPxfAGhSTaWIyYfR9/3bUzYuN2DVAdQ+I0vu+qkWjaOs2ISLX+/rzdWi96t3hrpMNCWhfl/HiB8Wn4MopQZzfQg/fp4c43e92giR7GQRY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709204476; c=relaxed/simple; bh=Jk/YXrLELPDA8NUIr7K8YZn7C3zRBGDzJ3JNfUDio2U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BO/k5isjCD3EPCVVL8GIlYBZMyokRPB7ZVM8ynPYewZLtOvzKLF3O8KzkQPOzmR13zuWP4Otqx9NZT4q21n1m60A4yHigNT1G7rycnZcPdGp+hcqNeIDwngelSwmICow7qQCpINlvU4fF7tD0j65vbi9aLhlaPPGCq/w1K0dAMM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 18D7A1FB; Thu, 29 Feb 2024 03:01:51 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.67.138]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0A10D3F762; Thu, 29 Feb 2024 03:01:10 -0800 (PST) Date: Thu, 29 Feb 2024 10:59:46 +0000 From: Mark Rutland To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, Will Deacon , linux-kernel@vger.kernel.org, Mark Brown Subject: Re: [PATCH V2] arm64/hw_breakpoint: Directly use ESR_ELx_WNR for an watchpoint exception Message-ID: References: <20240229083431.356578-1-anshuman.khandual@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240229083431.356578-1-anshuman.khandual@arm.com> On Thu, Feb 29, 2024 at 02:04:31PM +0530, Anshuman Khandual wrote: > Let's use existing ISS encoding for an watchpoint exception i.e ESR_ELx_WNR > This represents an instruction's either writing to or reading from a memory > location during an watchpoint exception. While here this drops non-standard > macro AARCH64_ESR_ACCESS_MASK. > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Mark Rutland > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Reviewed-by: Mark Brown > Signed-off-by: Anshuman Khandual This looks like a sensible cleanup, so: Acked-by: Mark Rutland Mark. > --- > This applies on v6.8-rc5 > > Changes in V2: > > - Dropped new ISS encoding details ESR_ELx_WnR and ESR_ELx_WnR_SHIFT > - Directly used existing ESR_ELx_WNR per Catalin > - Updated the commit message as required > > Changes in V1: > > https://lore.kernel.org/all/20240223094615.3977323-1-anshuman.khandual@arm.com/ > > arch/arm64/include/asm/hw_breakpoint.h | 1 - > arch/arm64/kernel/hw_breakpoint.c | 3 ++- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/include/asm/hw_breakpoint.h b/arch/arm64/include/asm/hw_breakpoint.h > index 84055329cd8b..bd81cf17744a 100644 > --- a/arch/arm64/include/asm/hw_breakpoint.h > +++ b/arch/arm64/include/asm/hw_breakpoint.h > @@ -59,7 +59,6 @@ static inline void decode_ctrl_reg(u32 reg, > /* Watchpoints */ > #define ARM_BREAKPOINT_LOAD 1 > #define ARM_BREAKPOINT_STORE 2 > -#define AARCH64_ESR_ACCESS_MASK (1 << 6) > > /* Lengths */ > #define ARM_BREAKPOINT_LEN_1 0x1 > diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c > index 35225632d70a..2f5755192c2b 100644 > --- a/arch/arm64/kernel/hw_breakpoint.c > +++ b/arch/arm64/kernel/hw_breakpoint.c > @@ -21,6 +21,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -779,7 +780,7 @@ static int watchpoint_handler(unsigned long addr, unsigned long esr, > * Check that the access type matches. > * 0 => load, otherwise => store > */ > - access = (esr & AARCH64_ESR_ACCESS_MASK) ? HW_BREAKPOINT_W : > + access = (esr & ESR_ELx_WNR) ? HW_BREAKPOINT_W : > HW_BREAKPOINT_R; > if (!(access & hw_breakpoint_type(wp))) > continue; > -- > 2.25.1 >