Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp38765lqb; Thu, 23 May 2024 10:07:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV2arA2f6gX23QB7vBHL0Q9lBA+BDZbE5LEnCaH63rmSHdEGAyj0J69npNull76hH72tuGNX6lPXm5679zxg0ifJTvlskqEO00bE/ZmzQ== X-Google-Smtp-Source: AGHT+IE9soQlkXJYZYUVMj4yR1jQTz8EntLWmw42xCMQookUL14/y6NTX6g78vmy/ObNaZ1wO34v X-Received: by 2002:ac8:7f87:0:b0:43e:404a:890c with SMTP id d75a77b69052e-43f9e0b4630mr53134511cf.19.1716484039330; Thu, 23 May 2024 10:07:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716484039; cv=pass; d=google.com; s=arc-20160816; b=lZN0Z4u6uSEcmgxR1k/r1NdTqAY3InosvtLd3JOxe0Dp/VyIqZyPs0+ImLStIlho+K whoazZqMPcqCEzuDmiGIgD8VRVGfnwatEElZqng2ym5bOfA9cXWvQjmhBxYiMHFNB5q1 ezqU9xe7Z2sL3yGP+IdsSrcTma+gQ/Y59JHtlI5qRphQqjJHkuh1XPjDwD9JuPAPZGll GmTBJg3znSoujvkBDMvleUvPsdV/BoUQCSh3R0q3OQPc8z3IL7hA6OAg+X9LY5Mxg5FF 2r9gNoRAa/Gayg4v0mCA8hOXqp3xz07p6rhUnxj/jmGmXFZsrCnZ+2Zcsy6O2tdHldSJ zQWA== 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=FXvwewQ5TLqdE1FX13NjDhiRxNy9qkrKnYOd23kEerw=; fh=JzT/ol0Ox6RyaTPDQZgxdQTwhqWQI6QsAkqhm+cwAfc=; b=aT5SZmmGKLY1cr14B9VXX1G7+iL326JhBPmRVwEVY0wSOSapQj6ZdR4YtmnJu1oUbU Iw7nNarcihzjn+vC1ocnYUZ4/mbLKNTcN5HyPLCxPYopaYd7HvjQsBQAqyvrsrdkYWt2 Zr6Z0FJx91N5BAXkdqueF0G82M68bZVZ/h4euRxWW9dK1tqkr8d6A3mT0Hc15ZjZ52Ii 8J4e3QZZJt2u+ianaedIqujpUdSQd4YWoJQlGVhDvsPqqgFbns+0AkCKbj4xpQ7D+/xh fZWGooRpla7qXmup46zvpwsoAvpSP+lPps54rlVkqyLOuo+Ox+ICM/uGhky8bjbZqY+D FSUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-187818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187818-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df566f4c8si31143931cf.310.2024.05.23.10.07.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 10:07:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-187818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187818-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 1511E1C214F9 for ; Thu, 23 May 2024 17:07:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3B966EB7C; Thu, 23 May 2024 17:07:12 +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 5A685AD2C for ; Thu, 23 May 2024 17:07:12 +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=1716484032; cv=none; b=CDs2tQc114pBSf+M1YPlLI5Q28X/gWBlQDoHKfS2EAnxcLTgNAYIwOY1B04g8w7YxQh24mYAR+XGpV2nPUrpiEQayhICT2p8bN5lHbFv07GHHKWKIUKetMfFzG6eBhrrjp6WTTg3+fxxEZRP8sSPfAqPQeE85Muo+kGsPZn482E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716484032; c=relaxed/simple; bh=6gSCyEIu5zPIbY9kgFjP5bVY1DREQG7gIcxL+TAUGPI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SmAwlUTrNT2SRqqFJ0ipn/BlsxoDFcvebnA86hUQsjYhukeYDo1zL7mpcggKTxagDPEB2nFPtBwH3bbuSg1GrDQ10Och3d8oHKBSjQWg5k0yLSXIJWZcsNvT13Ah0bpnlMyn98YXX03eacIZp8kN45B0zhvFjpDQtB30caIudmE= 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 757D2C2BD10; Thu, 23 May 2024 17:07:10 +0000 (UTC) Date: Thu, 23 May 2024 18:07:08 +0100 From: Catalin Marinas To: Yang Shi Cc: will@kernel.org, anshuman.khandual@arm.com, scott@os.amperecomputing.com, cl@gentwo.org, 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> 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: <20240520165636.802268-1-yang@os.amperecomputing.com> 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). -- Catalin