KVM: VMX: clear vmx_x86_ops.sync_pir_to_irr if APICv is disabled
Subsystems (4)
Paolo Bonzini
maintainerPATCH 1/1 KVM: VMX: clear vmx_x86_ops.sync_pir_to_irr if APICv is disabled
commit e90e51d5f01d2baae5dcce280866bbb96816e978 upstream.
There is nothing to synchronize if APICv is disabled, since neither other vCPUs nor assigned devices can set PIR.ON.
After the patch was committed to Linus's tree, it was observed that this fixes an issue with commit 7e1901f6c86c ("KVM: VMX: prepare sync_pir_to_irr for running with APICv disabled", backported to stable as e.g. commit 70a37e04c08a for the 5.15 tree). Without this patch, vmx_sync_pir_to_irr can be reached with enable_apicv == false, triggering
if (KVM_BUG_ON(!enable_apicv, vcpu->kvm))
--- arch/x86/kvm/vmx/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/vmx/vmx.c +2 -2
@@ -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;
Signature · 1 line
2.33.1
Greg KH
maintainerQuoted 11 lines · Paolo Bonzini
commit
e90e51d5f01d2baae5dcce280866bbb96816e978upstream.There is nothing to synchronize if APICv is disabled, since neither other vCPUs nor assigned devices can set PIR.ON.
After the patch was committed to Linus's tree, it was observed that this fixes an issue with commit
7e1901f6c86c("KVM: VMX: preparesync_pir_to_irrfor running with APICv disabled", backported to stable as e.g. commit70a37e04c08afor the 5.15 tree). Without this patch,vmx_sync_pir_to_irrcan be reached withenable_apicv== false, triggering
Quoted 8 lines
if (
KVM_BUG_ON(!enable_apicv, vcpu->kvm))Fixes 7e1901f6c86c ("KVM: VMX: prepare sync_pir_to_irr for running with APICv disabled")Signed-off-by Paolo Bonzini <[email protected]>--- arch/x86/kvm/vmx/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Looks like it is already queued up, thanks.
greg k-h