]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: disable preemption while updating apicv inhibition
authorMaxim Levitsky <mlevitsk@redhat.com>
Mon, 6 Jun 2022 18:08:27 +0000 (21:08 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 9 Jun 2022 14:52:19 +0000 (10:52 -0400)
commit6b841ca0b03a7f6c71b2de17736631231870bb4a
treeb07f1f5adf70b878c68c481c75984a0f56d0fa87
parent7714f95f7204635436f4b5cdac7ad17681516e1b
KVM: x86: disable preemption while updating apicv inhibition

Currently nothing prevents preemption in kvm_vcpu_update_apicv.

On SVM, If the preemption happens after we update the
vcpu->arch.apicv_active, the preemption itself will
'update' the inhibition since the AVIC will be first disabled
on vCPU unload and then enabled, when the current task
is loaded again.

Then we will try to update it again, which will lead to a warning
in __avic_vcpu_load, that the AVIC is already enabled.

Fix this by disabling preemption in this code.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20220606180829.102503-6-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c