From mboxrd@z Thu Jan 1 00:00:00 1970 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 2F3E5226177; Mon, 4 Aug 2025 17:45:03 +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=1754329503; cv=none; b=PQTEDwQnyoLbc+Zr+9PnHp6QbH4GGV9fXCRYTU7FeN3T/AdjGKi2wgIbb0qLeOw4gR6b/xIaKoIFKVARg3P6jDEPaypW9t5G0rwMM/HDoxY7E2sKYmRdjvny3ppE+S8On8/RP/YS2x9ncIclwBf8+Y4sE/5mu7CEx41pdLv1Uwg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754329503; c=relaxed/simple; bh=+6983uikn0yjZmMwTznyxyuaz/i87Agap+CKdQcLC8U=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=U/KoJNWhJmNqmVrE7/d3fdxg5B3PyfH6uXFe/CrqC9iJqxh/Tu1eYnAErfnY+TsldCXSOKHJziEwkJEEFaUV7At9lAWH8BNzMjA7S1XxKe5J3MUgMUYLEXt/EgH//cCKDk8eyOrr2FbaIe5iw7kVkX2V34Ri4Zf4KsoWGlBR/cQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F5JV3ymW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F5JV3ymW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03D2CC4CEF0; Mon, 4 Aug 2025 17:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1754329503; bh=+6983uikn0yjZmMwTznyxyuaz/i87Agap+CKdQcLC8U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=F5JV3ymWjmg3Ea3MlkksddkwxF+nE7Z/km3GsIUCNhZM3MqqJWA9Q9h55Sj9Ot8Ce 8+tQO2nmRdklfetbKCfJ1XKgKUx4Z99ag2mSu2oXnEBP0EYEaUQBSJV/nCe6+V15Nf zjZoSzlgRFFoQFJO8Rqtim/WumXcl0Q52iSQgR3SH/IJM0/MPF3Eu+vyfkjJeIHOil G1DoxiYeLdS5b8aJQAxGLC78cENi9ZIB1pztra4JsBndzBS7fx15BiMA/vcWRH28qF 8y8drtqmjQAxC4ns4el4kdLDYXapxQKSLG8WTiqLoYbwHLKZfBz6CEdGuMZ5dAfRi8 JbOKNpvQ9oWIw== Received: from sofa.misterjones.org ([185.219.108.64] helo=lobster-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 1uizF6-003stC-SL; Mon, 04 Aug 2025 18:45:01 +0100 Date: Mon, 04 Aug 2025 18:45:00 +0100 Message-ID: <87ectrt203.wl-maz@kernel.org> From: Marc Zyngier To: Alexandru Elisei Cc: Andre Przywara , Will Deacon , Julien Thierry , kvm@vger.kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH kvmtool v3 2/6] arm64: Initial nested virt support In-Reply-To: References: <20250729095745.3148294-1-andre.przywara@arm.com> <20250729095745.3148294-3-andre.przywara@arm.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/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: alexandru.elisei@arm.com, andre.przywara@arm.com, will@kernel.org, julien.thierry.kdev@gmail.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Mon, 04 Aug 2025 15:41:48 +0100, Alexandru Elisei wrote: > > Hi Andre, > > On Tue, Jul 29, 2025 at 10:57:41AM +0100, Andre Przywara wrote: > > The ARMv8.3 architecture update includes support for nested > > virtualization. Allow the user to specify "--nested" to start a guest in > > (virtual) EL2 instead of EL1. > > This will also change the PSCI conduit from HVC to SMC in the device > > tree. > > > > Signed-off-by: Andre Przywara > > --- > > arm64/fdt.c | 5 ++++- > > arm64/include/kvm/kvm-config-arch.h | 5 ++++- > > arm64/kvm-cpu.c | 12 +++++++++++- > > 3 files changed, 19 insertions(+), 3 deletions(-) > > > > diff --git a/arm64/fdt.c b/arm64/fdt.c > > index df7775876..98f1dd9d4 100644 > > --- a/arm64/fdt.c > > +++ b/arm64/fdt.c > > @@ -205,7 +205,10 @@ static int setup_fdt(struct kvm *kvm) > > _FDT(fdt_property_string(fdt, "compatible", "arm,psci")); > > fns = &psci_0_1_fns; > > } > > - _FDT(fdt_property_string(fdt, "method", "hvc")); > > + if (kvm->cfg.arch.nested_virt) > > + _FDT(fdt_property_string(fdt, "method", "smc")); > > + else > > + _FDT(fdt_property_string(fdt, "method", "hvc")); > > _FDT(fdt_property_cell(fdt, "cpu_suspend", fns->cpu_suspend)); > > _FDT(fdt_property_cell(fdt, "cpu_off", fns->cpu_off)); > > _FDT(fdt_property_cell(fdt, "cpu_on", fns->cpu_on)); > > diff --git a/arm64/include/kvm/kvm-config-arch.h b/arm64/include/kvm/kvm-config-arch.h > > index ee031f010..a1dac28e6 100644 > > --- a/arm64/include/kvm/kvm-config-arch.h > > +++ b/arm64/include/kvm/kvm-config-arch.h > > @@ -10,6 +10,7 @@ struct kvm_config_arch { > > bool aarch32_guest; > > bool has_pmuv3; > > bool mte_disabled; > > + bool nested_virt; > > u64 kaslr_seed; > > enum irqchip_type irqchip; > > u64 fw_addr; > > @@ -57,6 +58,8 @@ int sve_vl_parser(const struct option *opt, const char *arg, int unset); > > "Type of interrupt controller to emulate in the guest", \ > > irqchip_parser, NULL), \ > > OPT_U64('\0', "firmware-address", &(cfg)->fw_addr, \ > > - "Address where firmware should be loaded"), > > + "Address where firmware should be loaded"), \ > > + OPT_BOOLEAN('\0', "nested", &(cfg)->nested_virt, \ > > --nested sounds a bit vague (what if KVM decides to nest something else in the > future?) and the variable that keeps track of the parameter is called > 'nested_virt'. Is it too late to rename --nested to --nested-virt for > consistency and better clarity? I disagree. 'nested' is pretty much unambiguous in the context of virtualisation. 'nested-virt' is only an overstatement of an idiom that anyone playing with kvmtool will understand. M. -- Jazz isn't dead. It just smells funny.