]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 16 Sep 2022 08:53:51 +0000 (10:53 +0200)
commit2f580819074ab09c79f555cff5b229cc1419fe09
tree81fbc805829c764c1347a93b55afbc4073b2dfd5
parent3d3ab97037d682da0566be52a172e704bab67313
KVM: x86: do not set st->preempted when going back to user space

BugLink: https://bugs.launchpad.net/bugs/1989221
[ Upstream commit 54aa83c90198e68eee8b0850c749bc70efb548da ]

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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kvm/x86.c
arch/x86/kvm/xen.h