KVM: SVM: avoid refreshing avic if its state didn't change
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 10 Aug 2021 20:52:48 +0000 (23:52 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 20 Aug 2021 20:06:27 +0000 (16:06 -0400)
commit06ef813466c63ff1a61b5f99592e58d049c2c1ac
tree023eddbabb04e5234ec3bf81d1726e1620e7509c
parent30eed56a7e1cbefe933a33d661827e5c72cd136f
KVM: SVM: avoid refreshing avic if its state didn't change

Since AVIC can be inhibited and uninhibited rapidly it is possible that
we have nothing to do by the time the svm_refresh_apicv_exec_ctrl
is called.

Detect and avoid this, which will be useful when we will start calling
avic_vcpu_load/avic_vcpu_put when the avic inhibition state changes.

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