]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: do not set st->preempted when going back to user space
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 7 Jun 2022 14:07:11 +0000 (10:07 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Aug 2022 11:07:51 +0000 (13:07 +0200)
commit3426aab3a89e9dafe313f3bc79669ed939526d0c
tree5f123290cd1860cadf23e9e389d60f5e1888d13b
parent510ee34cd0656311b04852864847571b38540a19
KVM: x86: do not set st->preempted when going back to user space

[ Upstream commit 309474f127806442361a6eff947d8970218eeeee ]

Similar to the Xen path, only change the vCPU's reported state if the vCPU
was actually preempted.  The reason for KVM's behavior is that for example
optimistic spinning might not be a good idea if the guest is doing repeated
exits to userspace; however, it is confusing and unlikely to make a difference,
because well-tuned guests will hardly ever exit KVM_RUN in the first place.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/x86.c
arch/x86/kvm/xen.h