]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: call avic_vcpu_load/avic_vcpu_put when enabling/disabling AVIC
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 10 Aug 2021 20:52:50 +0000 (23:52 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 20 Aug 2021 20:06:30 +0000 (16:06 -0400)
commitb0941c5a85f3a153c0e1956b68b0bc68d0e58e9c
treec1ba4d2372f98fb0301e21561456a6dcd004f523
parent6692c8acfa4697dfe4c50881da8986e32d53349b
KVM: SVM: call avic_vcpu_load/avic_vcpu_put when enabling/disabling AVIC

Currently it is possible to have the following scenario:

1. AVIC is disabled by svm_refresh_apicv_exec_ctrl
2. svm_vcpu_blocking calls avic_vcpu_put which does nothing
3. svm_vcpu_unblocking enables the AVIC (due to KVM_REQ_APICV_UPDATE)
   and then calls avic_vcpu_load
4. warning is triggered in avic_vcpu_load since
   AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK was never cleared

While it is possible to just remove the warning, it seems to be more robust
to fully disable/enable AVIC in svm_refresh_apicv_exec_ctrl by calling the
avic_vcpu_load/avic_vcpu_put

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