]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: arm64: Load VPIDR_EL2 with the VM's MIDR_EL1 value
authorOliver Upton <oliver.upton@linux.dev>
Tue, 25 Feb 2025 00:53:59 +0000 (16:53 -0800)
committerOliver Upton <oliver.upton@linux.dev>
Wed, 26 Feb 2025 09:32:05 +0000 (01:32 -0800)
commitd0d81e03e6292b411452501ef0b3583b5ea884f7
tree3a4baed926fe3aed39f0f18c91537b4bfcfa7b7f
parentb4043e7cb78b96dae07c62d3ac527f84010828cd
KVM: arm64: Load VPIDR_EL2 with the VM's MIDR_EL1 value

Userspace will soon be able to change the value of MIDR_EL1. Prepare by
loading VPIDR_EL2 with the guest value for non-nested VMs.

Since VPIDR_EL2 is set for any VM, get rid of the NV-specific cleanup of
reloading the hardware value on vcpu_put(). And for nVHE, load the
hardware value before switching to the host.

Link: https://lore.kernel.org/r/20250225005401.679536-4-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h
arch/arm64/kvm/hyp/nvhe/sysreg-sr.c
arch/arm64/kvm/hyp/vhe/sysreg-sr.c