summaryrefslogtreecommitdiff
path: root/kvm-all.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-09-17 20:05:58 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:45 -0500
commit582e66de3585e69bd88dc5615411977fb073b4aa (patch)
tree00cbc6f07d556ef53fcb47e223054387387183a2 /kvm-all.c
parent609e2a741665e72703a792fe864b61457fb68c42 (diff)
downloadqemu-582e66de3585e69bd88dc5615411977fb073b4aa.tar.gz
qemu-582e66de3585e69bd88dc5615411977fb073b4aa.tar.bz2
qemu-582e66de3585e69bd88dc5615411977fb073b4aa.zip
kvm: Fix guest single-stepping
Hopefully the last regression of 4c0960c0: KVM_SET_GUEST_DEBUG requires properly synchronized guest registers (on x86: eflags) on entry. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/kvm-all.c b/kvm-all.c
index 7dcc55319c..f50c31c643 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -938,7 +938,13 @@ struct kvm_set_guest_debug_data {
static void kvm_invoke_set_guest_debug(void *data)
{
struct kvm_set_guest_debug_data *dbg_data = data;
- dbg_data->err = kvm_vcpu_ioctl(dbg_data->env, KVM_SET_GUEST_DEBUG, &dbg_data->dbg);
+ CPUState *env = dbg_data->env;
+
+ if (env->kvm_state->regs_modified) {
+ kvm_arch_put_registers(env);
+ env->kvm_state->regs_modified = 0;
+ }
+ dbg_data->err = kvm_vcpu_ioctl(env, KVM_SET_GUEST_DEBUG, &dbg_data->dbg);
}
int kvm_update_guest_debug(CPUState *env, unsigned long reinject_trap)