]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
KVM: VMX: clear vmx_x86_ops.sync_pir_to_irr if APICv is disabled
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 30 Nov 2021 12:36:41 +0000 (07:36 -0500)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:49:23 +0000 (09:49 +0100)
BugLink: https://bugs.launchpad.net/bugs/1956302
[ Upstream commit e90e51d5f01d2baae5dcce280866bbb96816e978 ]

There is nothing to synchronize if APICv is disabled, since neither
other vCPUs nor assigned devices can set PIR.ON.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arch/x86/kvm/vmx/vmx.c

index dacdf2395f01aee964f9829f846e80eb1ebed0a0..4e212f04268bb507c4702cdcf05cf956483e4fd3 100644 (file)
@@ -7776,10 +7776,10 @@ static __init int hardware_setup(void)
                ple_window_shrink = 0;
        }
 
-       if (!cpu_has_vmx_apicv()) {
+       if (!cpu_has_vmx_apicv())
                enable_apicv = 0;
+       if (!enable_apicv)
                vmx_x86_ops.sync_pir_to_irr = NULL;
-       }
 
        if (cpu_has_vmx_tsc_scaling()) {
                kvm_has_tsc_control = true;