Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp101126lqb; Thu, 23 May 2024 12:00:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXVZgHrtdX3eKsqUik2Uj5Dx5pcTom5Npmec2qixrdciO2RMSHdh1kdXO+X1mUjjOYrbF0FkPEgZtsUJnIm24Xoxhm90aKMWewW3Crn3w== X-Google-Smtp-Source: AGHT+IFGOiw//IQCcKoQ7dKnV1KtQkzoEacXP9118le6zfQ3f/VIyugxNlZVzOPBgUmsMvAS915y X-Received: by 2002:a05:6512:3710:b0:51e:876d:17d0 with SMTP id 2adb3069b0e04-526c0a68fcdmr5118826e87.52.1716490811653; Thu, 23 May 2024 12:00:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716490811; cv=pass; d=google.com; s=arc-20160816; b=UNLiDCFZBFY9Jyvz/pPQIygtxo+dyWVIOHKshLACPMA9U9VuNU+pr0YfkURxkp9mhQ pIk5N9sUHnQNFAttkRBayj/HYojNb4OHWpWTFh+6AUXNVCbvYKsjy6C/1b/cvrtZU59H kBsYejrUZbO9bI8YSSt96VvKuR7oWn2y2Hq4cXVYpxLeTFms0zL7VQmndp+byNb8wDr+ ldLidyWneJfzCahj7f8aj42tfekmk9C2V+YXcUwgxFFC+ygoJtNAqVpycs4ReDt6Vi9M 7RTFZkDrgL9b38gonDit6LlOfk21H/w+xg9mySP3a0n2335YXISZ4EOCffl+gf9TC8bT UM8g== 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=lnw0HJkLUEFNNeswAMwhIpgPdOdJhrl9aBTNF4oT/qI=; fh=6+/8AxjhYErjwkwC0k1KuhYzxBz8X5pBHpZPGkKKNPM=; b=TDRTknzWn2Aov8yCT5GBIXv++l87ufEh9DedS9/sfL86tWaXBZ6q0BtLlGAp3L7yyy 9mSf9W568MEVOLhaO1dxaHhlszFeJUXVQiZs+qhne4hEI2RoTY43gIjNUOfYgglZXONN YagUgWkLVlLawhgUIIKJmYeSVN2TINKDOw8WjwpCjPVhSjY4ha52lkfLE4ekH6TNOxHN WbYop8YIrZOUmuo/cHIHaJ9ZKuwygX7FMe+dCoBeLiWCmE6h5irISEicPQx5vEqsqIHp coVSPvGvmef/fijFLoQ7jKA8MjKQqUgRusCa6oNT0/hK4a8kh/SZFv6SWqCesEBEQ3Cj ig7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-187901-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187901-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17ba64b9si1655706766b.637.2024.05.23.12.00.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 12:00:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187901-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-187901-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187901-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 502061F2136B for ; Thu, 23 May 2024 19:00:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 801A382863; Thu, 23 May 2024 19:00:06 +0000 (UTC) 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