Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: arm64: Don't skip per-vcpu NV initialisation

Some GICv5-related rework have resulted in the NV sanitisation of
registers being skipped for secondary vcpus, which is a pretty bad
idea.

Hoist the NV init early so that it is always executed.

Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Fixes: cbd8c958be54a ("KVM: arm64: Return early from kvm_finalize_sys_regs() if guest has run")
Link: https://sashiko.dev/#/patchset/20260319154937.3619520-1-sascha.bischoff%40arm.com
Link: https://patch.msgid.link/20260401103611.357092-3-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>

+6 -6
+6 -6
arch/arm64/kvm/sys_regs.c
··· 5772 5772 5773 5773 guard(mutex)(&kvm->arch.config_lock); 5774 5774 5775 + if (vcpu_has_nv(vcpu)) { 5776 + int ret = kvm_init_nv_sysregs(vcpu); 5777 + if (ret) 5778 + return ret; 5779 + } 5780 + 5775 5781 if (kvm_vm_has_ran_once(kvm)) 5776 5782 return 0; 5777 5783 ··· 5824 5818 * problem for GICv5-based guests in the future. 5825 5819 */ 5826 5820 kvm_vgic_finalize_idregs(kvm); 5827 - } 5828 - 5829 - if (vcpu_has_nv(vcpu)) { 5830 - int ret = kvm_init_nv_sysregs(vcpu); 5831 - if (ret) 5832 - return ret; 5833 5821 } 5834 5822 5835 5823 return 0;