From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5BFC8C48BF6 for ; Thu, 29 Feb 2024 11:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ufEmjfAzRKO65dl/yrDxDHaYe8YSaGwgwhz+PFGI7kA=; b=15uOIT70V4AxgZ hdbvsrRD0uTy4Uqmtlf9DJtaTDV2XcDZ+7RWQ9DAjKi4THyR7AgrU4BEMBrlu/0tczcOKFe4nLjkC Ox/m4J0QOMut/QEIUu9XuW+cla2wxBFB7YJilaM2ceuNrNlNtLiHagMIq9EKZGBZg21NZ2gHtnp7O sjTbE8u/ab6QjV+4anVhcOqDp/xr93U0fscq6EY14p3CL5FyIPBneI3JUKuDoVHWSX9Gm3japRGQ3 MJBRvnNh+FSJA/b/zjSkP3fX9fU9wYRRClJ8Qv+9w+30tZnjgpuezilyvb7ss+l5T1i1lHnMs7+Ze A5jnF+QE4qjnP3bF+HVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfeAG-0000000DGy5-05Pk; Thu, 29 Feb 2024 11:01:24 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfeAC-0000000DGvt-3xEv for linux-arm-kernel@lists.infradead.org; Thu, 29 Feb 2024 11:01:22 +0000 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240229083431.356578-1-anshuman.khandual@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_030121_045868_50F4932B X-CRM114-Status: GOOD ( 19.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel