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 0F562CE8E96 for ; Thu, 24 Oct 2024 16:47:53 +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:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID: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=S2UH7lLkcaR0NIUgcvJNpnbInglx4dpr+MpuC3ByMBw=; b=2heUAh/fRQ2ROtB0YbTzx4cda8 H3FLm6RT9Ea4eFJPAw5mOXz/659kYfACpb8nm0lbP+LPROwXTJWY0OB87VN+116U7wXxFXWHVnR4Q KrVnMyvxokH3rWSIGkzJGXOJKlfOcB5K5zftniwyMW2UJKDEn8r3kPzGxVIXu/8//lcdPRTteVS1A 2MG6iZui7nxGka8TAGyii0IYOykhr/ojmyNjxDpgexTOm22ZhxF1de5XwnyTzJzHbRLTDt6K1vHN4 HJ+Q1vpj8j7ZFp4OOQRSpsKrXXSydrfMBMYh5+uOxFusqbxUzTBrkCq4ifRG5HojDgupXN03x1R0l KuBOVYaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t40zu-000000019WX-0W4M; Thu, 24 Oct 2024 16:47:42 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t40wD-000000018aj-0eLu for linux-arm-kernel@lists.infradead.org; Thu, 24 Oct 2024 16:43:54 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id F08C5A4571D; Thu, 24 Oct 2024 16:43:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0652C4CEC7; Thu, 24 Oct 2024 16:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729788231; bh=377I+7D8IjfExa36QBMKaFHOg3N+KTIoHiUVOFHMH5g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DJBjYl30R3t7fBTQSOitfIFiLJJvl6ueAJbL00FIACZ/xTf8eSlRm9qimkg8dBEVE ZAPuVZZCNmuEsiPYfH0UzDbpb6Tc/csouPYD1aApS7kNvHjYIfn+JtesaK7LBgsbGH qKgdQGk/LKlXYfsxMOfYSCX9AlB6GPQAu9u2KEbqjEbJbkEmnfbgpxBjxxmcxsNPSi nEMQfvm/zkbjWDLNfc/6YY1jKhNZVsa1yEaF9EmsHmzj5B0Ifbg80q6zqL5bXhNTSl 19OLQeeWpBiu4SILm0/pFmdUgcO+1ri4ypkB9HY2Wt9Lu+8RcwAwYPiYGwezg1gbZZ N9tC4vpsD8Z1A== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t40w9-006WaQ-QL; Thu, 24 Oct 2024 17:43:49 +0100 Date: Thu, 24 Oct 2024 17:43:49 +0100 Message-ID: <86o73930ze.wl-maz@kernel.org> From: Marc Zyngier To: Mostafa Saleh Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, corbet@lwn.net, Will Deacon Subject: Re: [PATCH v2] Documentation: Update the behaviour of "kvm-arm.mode" In-Reply-To: <20241024160614.1894599-1-smostafa@google.com> References: <20241024160614.1894599-1-smostafa@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: smostafa@google.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, corbet@lwn.net, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_094353_359930_8AE0E8D0 X-CRM114-Status: GOOD ( 26.63 ) 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 Hi Mostafa, On Thu, 24 Oct 2024 17:06:14 +0100, Mostafa Saleh wrote: > > Commit 5053c3f0519c ("KVM: arm64: Use hVHE in pKVM by default on CPUs with > VHE support") modified the behaviour of "kvm-arm.mode=protected" without > the updating the kernel parameters doc. > > Update it to match the current implementation. > > Also, update required architecture version for nested virtualization as > suggested by Marc. > > Cc: Will Deacon > Cc: Marc Zyngier > > Signed-off-by: Mostafa Saleh > > --- > v2: Update nested value also Thanks for that. However... > --- > Documentation/admin-guide/kernel-parameters.txt | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 1518343bbe22..d5b771e5cb5b 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -2740,12 +2740,16 @@ > nvhe: Standard nVHE-based mode, without support for > protected guests. > > - protected: nVHE-based mode with support for guests whose > + protected: hVHE-based mode with support for guests whose > state is kept private from the host. > + In case hVHE is not supported in hardware, it will > + boot with protected nVHE. > + nVHE protected mode can still be forced on VHE systems > + using "kvm_arm.mode=protected arm64_sw.hvhe=0 id_aa64mmfr1.vh=0" I probably didn't explain myself very well. I would like to avoid mentioning hVHE at all, because this is pretty confusing (and really an implementation detail). Instead, we can talk about VHE/nVHE, which are real architectural features. Also, I just realised that we can use your command-line magic for downgrading from VHE to nVHE in all cases, so I'd be suggesting something like this: diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 1518343bbe223..2bb19f1331fed 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2740,8 +2740,9 @@ nvhe: Standard nVHE-based mode, without support for protected guests. - protected: nVHE-based mode with support for guests whose - state is kept private from the host. + protected: Mode with support for guests whose state is + kept private from the host, using VHE or + nVHE depending on HW support. nested: VHE-based mode with support for nested virtualization. Requires at least ARMv8.3 @@ -2749,8 +2750,11 @@ Defaults to VHE/nVHE based on hardware support. Setting mode to "protected" will disable kexec and hibernation - for the host. "nested" is experimental and should be - used with extreme caution. + for the host. To force nVHE on VHE hardware, add + "arm64_sw.hvhe=0 id_aa64mmfr1.vh=0" to the + command-line. + "nested" is experimental and should be used with + extreme caution. kvm-arm.vgic_v3_group0_trap= [KVM,ARM,EARLY] Trap guest accesses to GICv3 group-0 > > nested: VHE-based mode with support for nested > - virtualization. Requires at least ARMv8.3 > - hardware. > + virtualization. Requires at least ARMv8.4 > + hardware (with FEAT_NV2). That part looks good! Thanks, M. -- Without deviation from the norm, progress is not possible.