KVM: x86: Fix guest single-stepping while interruptible
authorJan Kiszka <jan.kiszka@web.de>
Sun, 18 Oct 2009 11:24:44 +0000 (13:24 +0200)
committerAvi Kivity <avi@redhat.com>
Thu, 3 Dec 2009 07:32:19 +0000 (09:32 +0200)
commit94fe45da48f921d01d8ff02a0ad54ee9c326d7f0
tree7bf7482bcbe690313909d5f2770384f853562a2d
parentffde22ac53b6d6b1d7206f1172176a667eead778
KVM: x86: Fix guest single-stepping while interruptible

Commit 705c5323 opened the doors of hell by unconditionally injecting
single-step flags as long as guest_debug signaled this. This doesn't
work when the guest branches into some interrupt or exception handler
and triggers a vmexit with flag reloading.

Fix it by saving cs:rip when user space requests single-stepping and
restricting the trace flag injection to this guest code position.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c