From patchwork Tue Apr 8 10:52:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 14042801 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 43CAD269B0E; Tue, 8 Apr 2025 10:52:42 +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=1744109562; cv=none; b=ApDzbHrU0fi3Honf/tr9wWWP9+OsQeUM/jTnB8iGRkjNFO+tTvhJ8v3F7UFMAW7YmmZYCksGIvxhQmLhoeU4X4KsXjzJZ+dkNBQ344OxjDq4ueiQmLfQyRXlUmxNXFuOxxilqZAKdywN8Xfp+05XL84r/v/IlM1tWWCahsSVJg0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744109562; c=relaxed/simple; bh=dFpMDUwZJl4d3Cu1jwOtYwohos+qMJ2+5YSt5qvdaF0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X41aE5aU0HjV0yL5o2WIPHQjFRpXKRSWFITVQu53MKMOFO3SN9m7gL6vvI4qykmLbJp2kpI8JTSx5l0t22PPxO48gaGR366r9ObQ+jnzWwnk1t51+gibpnPG9Mi/zLeQ4Y+KhkjnbTtv4WxdMfDC/UdjgSZUt8hIwY7zkAJsxTM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M/7QpGXj; 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="M/7QpGXj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2723FC4CEEA; Tue, 8 Apr 2025 10:52:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744109562; bh=dFpMDUwZJl4d3Cu1jwOtYwohos+qMJ2+5YSt5qvdaF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M/7QpGXjdRjjn4ws4kBlce3BKMiYS/TBzkHKk2+pSicZ3GpHSRn3zj59s4aLkrSpd AOWz+5Wbll6+UshAb3oZ8pnI5fvrVX6i+pJXpPMaCYf+6GmBAhpTnDKE9U2Yg9PyBm KeEWhME6lDT3Kpqt/8emrjqT4wgx4w/y5eWgGx13X/LGAN61ibaNyl1PVD8GuWRYJD FJhuYfYiuriXEKkl5KDVZhmUHhRqpKMIlhS5tiYSN+pzWl5+EoInB6TOsxnwLFmPwA efrWfKAVAhCB4UbdWW2jvreaU1kx9W6LVmjtKVzQVpcW0ahqMYiJo5x8xOvWqMgCy/ jCrDjRMkEf/SQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1u26ZM-003QX2-B9; Tue, 08 Apr 2025 11:52:40 +0100 From: Marc Zyngier To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Joey Gouly , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Eric Auger Subject: [PATCH v2 17/17] KVM: arm64: Document NV caps and vcpu flags Date: Tue, 8 Apr 2025 11:52:25 +0100 Message-Id: <20250408105225.4002637-18-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20250408105225.4002637-1-maz@kernel.org> References: <20250408105225.4002637-1-maz@kernel.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, joey.gouly@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, eric.auger@redhat.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Describe the two new vcpu flags that control NV, together with the capabilities that advertise them. Reviewed-by: Oliver Upton Reviewed-by: Joey Gouly Signed-off-by: Marc Zyngier --- Documentation/virt/kvm/api.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index 1f8625b7646a2..1258a1fca6678 100644 --- a/Documentation/virt/kvm/api.rst +++ b/Documentation/virt/kvm/api.rst @@ -3460,7 +3460,8 @@ The initial values are defined as: - FPSIMD/NEON registers: set to 0 - SVE registers: set to 0 - System registers: Reset to their architecturally defined - values as for a warm reset to EL1 (resp. SVC) + values as for a warm reset to EL1 (resp. SVC) or EL2 (in the + case of EL2 being enabled). Note that because some registers reflect machine topology, all vcpus should be created before this ioctl is invoked. @@ -3527,6 +3528,17 @@ Possible features: - the KVM_REG_ARM64_SVE_VLS pseudo-register is immutable, and can no longer be written using KVM_SET_ONE_REG. + - KVM_ARM_VCPU_HAS_EL2: Enable Nested Virtualisation support, + booting the guest from EL2 instead of EL1. + Depends on KVM_CAP_ARM_EL2. + The VM is running with HCR_EL2.E2H being RES1 (VHE) unless + KVM_ARM_VCPU_HAS_EL2_E2H0 is also set. + + - KVM_ARM_VCPU_HAS_EL2_E2H0: Restrict Nested Virtualisation + support to HCR_EL2.E2H being RES0 (non-VHE). + Depends on KVM_CAP_ARM_EL2_E2H0. + KVM_ARM_VCPU_HAS_EL2 must also be set. + 4.83 KVM_ARM_PREFERRED_TARGET -----------------------------