KVM: x86: Take KVM's SRCU lock only if steal time update is needed
authorSean Christopherson <seanjc@google.com>
Sat, 23 Jan 2021 00:03:34 +0000 (16:03 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Feb 2021 10:27:14 +0000 (05:27 -0500)
commit15b51dc08a349f2f0832606c900b638a3dd19839
tree2333c9a496b81bcfd5247b425a313eea321e3a63
parent19979fba9bfaeab427a8e106d915f0627c952828
KVM: x86: Take KVM's SRCU lock only if steal time update is needed

Enter a SRCU critical section for a memslots lookup during steal time
update if and only if a steal time update is actually needed.  Taking
the lock can be avoided if steal time is disabled by the guest, or if
KVM knows it has already flagged the vCPU as being preempted.

Reword the comment to be more precise as to exactly why memslots will
be queried.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210123000334.3123628-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c