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 9C7DFC2BD09 for ; Tue, 9 Jul 2024 10:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iWKIVafFG1snfq/QIcET2Iyc7o770h7EtzIW69u5UAw=; b=DZBYIWjHLGFasiM1iHCO3lqMcK OwnGlzOLRimlsA6get8R1aP7F748ZnqkQyB30isL6a9nURuceFmWiqcVqd/0PrUPxcHFetSgudrn2 k5zD7kIPqKVJ4QDyOq55t63GgXxmr+YRdtPnEYb9rGEGybqLx6AWfD6lFWosjC5Ur90i5oY3yS+ZS 9YaES1ghdpPquHr9jHJvKAttK+DRojHDcbnVEi6Rf+DbNIIahar5hpaqIO1qKOH4tRTbYZrNk6soE WBNa1iaPFXyK6ogNlswZdyZx0bzz5YzaKJyDuuyxuDlp0VOyyuMcfjaP2ZqZqRlhseeZDITs9H6sw Kx+3CtpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sR8Tn-00000006tWT-1yqH; Tue, 09 Jul 2024 10:53:51 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sR8TW-00000006tRl-39fi for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2024 10:53:36 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 11D38CE0BA8; Tue, 9 Jul 2024 10:53:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B2CBC3277B; Tue, 9 Jul 2024 10:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720522412; bh=jB14DSl2Zk4On6QHfLrBh2maI9p5JkZn/BI6ssDCVwo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kZ3sOT2Vc/2HFPrIXm8vo7fe9W5xKNJCoeTHX/jYOlj7cYyMeSbi7YF8PtpyjB2j4 uAYPz9m3YOmhojvX8dtTqdMKZAwpQsBlyCwbPHnVy3t63jSc66PoToqUVfCnG872Wk SRY/erI94F/9zj5C7NKHAVLbQkBpPgocQsGnoeZ5iKDpHGq7ITjI389yXrzdbmZY/Q IDIbQMcaNBfe620F7II89RBrLQiSe7QofOe/8uVcZoC1nl4o33dJC+2SrGl8WzvLJu hmQT5CMCwRPBY0OZANnfFzYxcCSu+y9tGlmdVBYpDEIaDDa/k5dodwwdlrn6HkIEn1 kT5RBKKFozFlA== Date: Tue, 9 Jul 2024 11:53:25 +0100 From: Will Deacon To: Steven Price Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, Catalin Marinas , Marc Zyngier , James Morse , Oliver Upton , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni Subject: Re: [PATCH v4 04/15] arm64: realm: Query IPA size from the RMM Message-ID: <20240709105325.GF12978@willie-the-truck> References: <20240701095505.165383-1-steven.price@arm.com> <20240701095505.165383-5-steven.price@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240701095505.165383-5-steven.price@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240709_035334_982528_5B5EE1D7 X-CRM114-Status: GOOD ( 16.71 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 01, 2024 at 10:54:54AM +0100, Steven Price wrote: > The top bit of the configured IPA size is used as an attribute to > control whether the address is protected or shared. Query the > configuration from the RMM to assertain which bit this is. > > Co-developed-by: Suzuki K Poulose > Signed-off-by: Suzuki K Poulose > Signed-off-by: Steven Price > --- > Changes since v2: > * Drop unneeded extra brackets from PROT_NS_SHARED. > * Drop the explicit alignment from 'config' as struct realm_config now > specifies the alignment. > --- > arch/arm64/include/asm/pgtable-prot.h | 3 +++ > arch/arm64/kernel/rsi.c | 8 ++++++++ > 2 files changed, 11 insertions(+) > > diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h > index b11cfb9fdd37..6c29f3b32eba 100644 > --- a/arch/arm64/include/asm/pgtable-prot.h > +++ b/arch/arm64/include/asm/pgtable-prot.h > @@ -70,6 +70,9 @@ > #include > > extern bool arm64_use_ng_mappings; > +extern unsigned long prot_ns_shared; > + > +#define PROT_NS_SHARED (prot_ns_shared) Since the _vast_ majority of Linux systems won't be running in a realm, can we use a static key to avoid loading a constant each time? Will