Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp329630lqo; Thu, 16 May 2024 07:32:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWZrTtqCmV+EOc3peZM1XJ9nFzhGijqQ0Df2Qwyc5lvTn9NuHpMxAwAwg5ZINZvWdHY5O0JO5F/uLMBwvo4gRRwmtAlae2iuQvaC9peA== X-Google-Smtp-Source: AGHT+IGcvHTQPx2EEbMxGkM5ptFUC/otnFo4ex89TZDGBqa2HSVBkYD3vxRfHsSeMAopbK1/NU2/ X-Received: by 2002:a37:f504:0:b0:790:ed57:1354 with SMTP id af79cd13be357-792c7577606mr1965351185a.6.1715869952642; Thu, 16 May 2024 07:32:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715869952; cv=pass; d=google.com; s=arc-20160816; b=nmryukainncmErfOciUzGvGKqTpm09hsXv6bYnQkqDkghPaVv1gtbjWrN8mUxTGTNt t8seMi3PSWS0fmLlpbSiBd0GFY77jPqo4yFK/IP0JW7MfXOYla7cIIXLjYVpa7OCvz7r uZxA8cwZSprv2F/plWiIsVfEJuhqIiTyrNXYK2e1XnXLGxrVqUC19wzg7+Jf9kDDEhOV 7CSKgWoW4qc18Is1xk9Kx6hJK7lgsSHfR9jO8LEwpt7sUuZhdOd1dIa4pSRPDiaRoXSh vD7rOp/jyCi+0U50Gnn5OTUs6jZNOuJLX9Bq/Gw9EP0MatupGBYpB8OlBMZuoV4016NQ MqMw== 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=y1rVnHnYym31blYv3F0Uj/10hX5YTGalYy712ZWBiNM=; fh=G29TNm1SPKOdkPiMgR4lPdfuvE1iCuUApv97m/oVJCw=; b=mD/hrROsQMeoP30Ad8/NotcWqoRVS9czB54dJsgLKDStpodLltd0f1n2Re6h5Pk/a4 gsoijs+jyLDcjr8BsbVN45BtXNCViImYqDFFk00V1kPoPAGqoOCsGJnzcTGM5n18Acvj zGpQ1gtBU/wCH9QpypklQOLfgQFbY4MZ4fKMUKOmW6DjHyYkV98jPOQJWjT16FBeawkM jcQbq33dIIRMLtZbxPUu9YZkYNxnSP6SaqCNKG2yDna5M+DEGA/Sv3sWl1ftLNwBqt/R sCE4cREDwZxwcMb/DwDWnaWEJ+icgEJDHO/UIIryw0Ijtws4w0gFGOksUuAd7J8kwC3Q vVfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-181174-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181174-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. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792bf27733fsi235080085a.139.2024.05.16.07.32.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 07:32:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181174-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-181174-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181174-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 4E4B11C20A7F for ; Thu, 16 May 2024 14:32:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6100814B971; Thu, 16 May 2024 14:32:14 +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 CE9A414B942; Thu, 16 May 2024 14:32:13 +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=1715869933; cv=none; b=JbvSohfD0s1H2A5q8gZpJ3L2C6WF2AaQv5O4CtxxUEshLYx18Lv4JO1vbw4Bh2BUExckeZqO951bMHG8pGNwU/yUH1cNq8yyzfEv1g8h/xj0QcLRWllX8AL0kGlm0RIvSFdYkNWIGZA84MGKV95W7xtjScDhpRK2tL/auadfNQk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715869933; c=relaxed/simple; bh=bAPoVDfL5WvnkkSsUVS3M8XyJ++r3/L577PAoucEi6g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fhWzOA9zdH/HQYEH23tjkOGNw8ha/X3HdaJ+5NDHTVSXMafT9uTeAguAYwBSZ8AMYXJ2C4odcT90/OMnunMb9EqnfKTqaBAZPzyT3VK4rqwLOB+CfGK/THEBzPSb9vV2akFOdIZGoJ5V53VScn5E7p+nba/wAhEtd8L58vdRc70= 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 6E2A8C113CC; Thu, 16 May 2024 14:32:10 +0000 (UTC) Date: Thu, 16 May 2024 15:32:08 +0100 From: Catalin Marinas To: Suzuki K Poulose Cc: Steven Price , kvm@vger.kernel.org, kvmarm@lists.linux.dev, Marc Zyngier , Will Deacon , James Morse , Oliver Upton , 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 v2 02/14] arm64: Detect if in a realm and set RIPAS RAM Message-ID: References: <20240412084213.1733764-1-steven.price@arm.com> <20240412084213.1733764-3-steven.price@arm.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: On Tue, May 14, 2024 at 11:18:13AM +0100, Suzuki K Poulose wrote: > On 10/05/2024 18:35, Catalin Marinas wrote: > > On Fri, Apr 12, 2024 at 09:42:01AM +0100, Steven Price wrote: > > > +void arm64_setup_memory(void) > > > > I would give this function a better name, something to resemble the RSI > > setup. Similarly for others like set_memory_range_protected/shared(). > > Some of the functions have 'rsi' in the name like arm64_rsi_init() but > > others don't and at a first look they'd seem like some generic memory > > setup on arm64, not RSI-specific. > > Ack. arm64_rsi_setup_memory() ? I agree, we should "rsi" fy the names. This should work. We also have rsi_*() functions without any 'arm64' but those are strictly about communicating with the RMM, so that's fine. > > > @@ -293,6 +294,8 @@ void __init __no_sanitize_address setup_arch(char **cmdline_p) > > > * cpufeature code and early parameters. > > > */ > > > jump_label_init(); > > > + /* Init RSI after jump_labels are active */ > > > + arm64_rsi_init(); > > > parse_early_param(); > > > > Does it need to be this early? It's fine for now but I wonder whether we > > may have some early parameter at some point that could influence what we > > do in the arm64_rsi_init(). I'd move it after or maybe even as part of > > the arm64_setup_memory(), though I haven't read the following patches if > > they update this function. > > We must do this before we setup the "earlycon", so that the console > is accessed using shared alias and that happens via parse_early_param() :-(. Ah, ok, makes sense. -- Catalin