• Maxim Levitsky's avatar
    KVM: x86: disable preemption while updating apicv inhibition · 66c768d3
    Maxim Levitsky authored
    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: default avatarMaxim Levitsky <mlevitsk@redhat.com>
    Message-Id: <20220606180829.102503-6-mlevitsk@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    66c768d3
x86.c 344 KB