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 E916FC25B75 for ; Thu, 23 May 2024 19:00:29 +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=4D+qP6IcghmrJ0Gb5KFld3Rf5iXDr9FeItGkBAbFGpA=; b=lWi+skQkZX48o0 xPTn3vdOmVebEYQyl8MiKSzOqYYpLZgejIA/2bHYogzHIIIQUTF81wZR1DHni42n/a5GVg3X4mT+0 eWTbkDZ3KYRQCUnouSMKV9Lb7NVZxM5hSRqE//Orkzu8N+Oczh8+G9waOg4d6lxb/zvdo7aNgu+bU Bn8cQHGFWOjJgYecQstDAaB5VxVKpTstPOhITQ7mXtPhKw1fmckxHvH3dTsSvYI/yolexz0Xz0a+m 3Ul5gzQpdziPrIoHDz3RKvyA9XI6F60iZeVeYe9S6hbOlk49COuv2NIrzcTDoW38R3GMIGpO7eDhz ybblbgfi4twQAOx4bjrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sADfg-00000007544-0ACv; Thu, 23 May 2024 19:00:12 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sADfa-0000000750R-2OTw for linux-arm-kernel@lists.infradead.org; Thu, 23 May 2024 19:00:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D57AF62E46; Thu, 23 May 2024 19:00:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FFD1C2BD10; Thu, 23 May 2024 19:00:03 +0000 (UTC) Date: Thu, 23 May 2024 20:00:05 +0100 From: Catalin Marinas To: "Christoph Lameter (Ampere)" Cc: Yang Shi , will@kernel.org, anshuman.khandual@arm.com, scott@os.amperecomputing.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [v2 PATCH] arm64: mm: force write fault for atomic RMW instructions Message-ID: References: <20240520165636.802268-1-yang@os.amperecomputing.com> <640f8606-2757-4e82-721f-9625d48ded65@gentwo.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <640f8606-2757-4e82-721f-9625d48ded65@gentwo.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240523_120006_674785_937E4D59 X-CRM114-Status: GOOD ( 16.10 ) 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, May 23, 2024 at 11:09:11AM -0700, Christoph Lameter (Ampere) wrote: > On Thu, 23 May 2024, Catalin Marinas wrote: > > > On Mon, May 20, 2024 at 09:56:36AM -0700, Yang Shi wrote: > > > diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h > > > index db1aeacd4cd9..1cc73664fc55 100644 > > > --- a/arch/arm64/include/asm/insn.h > > > +++ b/arch/arm64/include/asm/insn.h > > > @@ -319,6 +319,7 @@ static __always_inline u32 aarch64_insn_get_##abbr##_value(void) \ > > > * "-" means "don't care" > > > */ > > > __AARCH64_INSN_FUNCS(class_branch_sys, 0x1c000000, 0x14000000) > > > +__AARCH64_INSN_FUNCS(class_atomic, 0x3b200c00, 0x38200000) > > > > While this class includes all atomics that currently require write > > permission, there's some unallocated space in this range and we don't > > know what future architecture versions may introduce. Unfortunately we > > need to check each individual atomic op in this class (not sure what the > > overhead will be). > > Can you tell us which bits or pattern is not allocated? Maybe we can exclude > that from the pattern. Yes, it may be easier to exclude those patterns. See the Arm ARM K.a section C4.1.94.29 (page 791). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04BE02AD00 for ; Thu, 23 May 2024 19:00:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716490806; cv=none; b=VDVm1YOMCJ3Cgg0BDb8xh7wwlXDUCXqaaRyj+42OFLx+/iDnRm0NZ4Z6TU4lWfUSziz5hSxB9ctQ7QQ+2AAqaUsXBDfDkPw6W6TWgiN++uBem7STkoPJ54OOfJPVjAPtlbJXT59/e+QX810XQyJkmB8PWc+umBjTGkHlU6oaDyc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716490806; c=relaxed/simple; bh=EosZtLydwwPjBlSIxN8KIXivtKpM5s454tQXJ9Q6SBQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u5pJUq0dfuQ8+ECCpFlKR9wMPTrn2yevYQJkJvJTRZg1E3MYsPN2HY0Nazc4S+17HlInXSXu/86ElC5oSD8XN3RXqASZZYlzkrH8YH5/8o3YNuSV8zfTQA5mbip260TItG4SklkTdRb5vF8PZMPWbNEho7rOA1f6E0NbYwzOS3E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FFD1C2BD10; Thu, 23 May 2024 19:00:03 +0000 (UTC) Date: Thu, 23 May 2024 20:00:05 +0100 From: Catalin Marinas To: "Christoph Lameter (Ampere)" Cc: Yang Shi , will@kernel.org, anshuman.khandual@arm.com, scott@os.amperecomputing.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [v2 PATCH] arm64: mm: force write fault for atomic RMW instructions Message-ID: References: <20240520165636.802268-1-yang@os.amperecomputing.com> <640f8606-2757-4e82-721f-9625d48ded65@gentwo.org> 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: <640f8606-2757-4e82-721f-9625d48ded65@gentwo.org> On Thu, May 23, 2024 at 11:09:11AM -0700, Christoph Lameter (Ampere) wrote: > On Thu, 23 May 2024, Catalin Marinas wrote: > > > On Mon, May 20, 2024 at 09:56:36AM -0700, Yang Shi wrote: > > > diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h > > > index db1aeacd4cd9..1cc73664fc55 100644 > > > --- a/arch/arm64/include/asm/insn.h > > > +++ b/arch/arm64/include/asm/insn.h > > > @@ -319,6 +319,7 @@ static __always_inline u32 aarch64_insn_get_##abbr##_value(void) \ > > > * "-" means "don't care" > > > */ > > > __AARCH64_INSN_FUNCS(class_branch_sys, 0x1c000000, 0x14000000) > > > +__AARCH64_INSN_FUNCS(class_atomic, 0x3b200c00, 0x38200000) > > > > While this class includes all atomics that currently require write > > permission, there's some unallocated space in this range and we don't > > know what future architecture versions may introduce. Unfortunately we > > need to check each individual atomic op in this class (not sure what the > > overhead will be). > > Can you tell us which bits or pattern is not allocated? Maybe we can exclude > that from the pattern. Yes, it may be easier to exclude those patterns. See the Arm ARM K.a section C4.1.94.29 (page 791). -- Catalin