]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Move SVM's APICv sanity check to common x86
authorSean Christopherson <seanjc@google.com>
Fri, 22 Oct 2021 00:49:25 +0000 (17:49 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 22 Oct 2021 15:20:16 +0000 (11:20 -0400)
commit3abdf8fbb784ec1412da4423ff1ce6d8a0919568
treee025f67475e4086433168561d5c09a7596920a6a
parent6cc36b088e4a3556352c67c2e3a27ccb67e9cf1d
KVM: x86: Move SVM's APICv sanity check to common x86

Move SVM's assertion that vCPU's APICv state is consistent with its VM's
state out of svm_vcpu_run() and into x86's common inner run loop.  The
assertion and underlying logic is not unique to SVM, it's just that SVM
has more inhibiting conditions and thus is more likely to run headfirst
into any KVM bugs.

Add relevant comments to document exactly why the update path has unusual
ordering between the update the kick, why said ordering is safe, and also
the basic rules behind the assertion in the run loop.

Cc: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211022004927.1448382-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c
arch/x86/kvm/x86.c