aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/arm64/kvm/nested.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2025-05-14 11:34:51 +0100
committerMarc Zyngier <maz@kernel.org>2025-05-19 07:59:46 +0100
commit6fb75733f148ecd6c1898df0098b37f70a80f002 (patch)
tree9568db12c327ed917f93fb7ca56ad79f8badd680 /arch/arm64/kvm/nested.c
parentKVM: arm64: nv: Add pseudo-TLB backing VNCR_EL2 (diff)
downloadwireguard-linux-6fb75733f148ecd6c1898df0098b37f70a80f002.tar.xz
wireguard-linux-6fb75733f148ecd6c1898df0098b37f70a80f002.zip
KVM: arm64: nv: Add userspace and guest handling of VNCR_EL2
Plug VNCR_EL2 in the vcpu_sysreg enum, define its RES0/RES1 bits, and make it accessible to userspace when the VM is configured to support FEAT_NV2. Reviewed-by: Oliver Upton <oliver.upton@linux.dev> Link: https://lore.kernel.org/r/20250514103501.2225951-9-maz@kernel.org Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/kvm/nested.c')
-rw-r--r--arch/arm64/kvm/nested.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
index 806e9cf6049a..32ea6e362bab 100644
--- a/arch/arm64/kvm/nested.c
+++ b/arch/arm64/kvm/nested.c
@@ -1400,6 +1400,9 @@ int kvm_init_nv_sysregs(struct kvm_vcpu *vcpu)
res0 |= ICH_HCR_EL2_DVIM | ICH_HCR_EL2_vSGIEOICount;
set_sysreg_masks(kvm, ICH_HCR_EL2, res0, res1);
+ /* VNCR_EL2 */
+ set_sysreg_masks(kvm, VNCR_EL2, VNCR_EL2_RES0, VNCR_EL2_RES1);
+
out:
for (enum vcpu_sysreg sr = __SANITISED_REG_START__; sr < NR_SYS_REGS; sr++)
(void)__vcpu_sys_reg(vcpu, sr);