diff mbox

qemu-kvm: Fix guest single-stepping

Message ID 4AB277B5.5000105@siemens.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka Sept. 17, 2009, 5:53 p.m. UTC
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>
---

 qemu-kvm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Marcelo Tosatti Sept. 18, 2009, 4:05 p.m. UTC | #1
Applied, thanks.

On Thu, Sep 17, 2009 at 07:53:57PM +0200, Jan Kiszka wrote:
> 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>
> ---
> 
>  qemu-kvm.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/qemu-kvm.c b/qemu-kvm.c
> index 78eeb6f..569397e 100644
> --- a/qemu-kvm.c
> +++ b/qemu-kvm.c
> @@ -2282,6 +2282,10 @@ static void kvm_invoke_set_guest_debug(void *data)
>  {
>      struct kvm_set_guest_debug_data *dbg_data = data;
>  
> +    if (cpu_single_env->kvm_cpu_state.regs_modified) {
> +        kvm_arch_put_registers(cpu_single_env);
> +        cpu_single_env->kvm_cpu_state.regs_modified = 0;
> +    }
>      dbg_data->err =
>          kvm_set_guest_debug(cpu_single_env->kvm_cpu_state.vcpu_ctx,
>                              &dbg_data->dbg);
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/qemu-kvm.c b/qemu-kvm.c
index 78eeb6f..569397e 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -2282,6 +2282,10 @@  static void kvm_invoke_set_guest_debug(void *data)
 {
     struct kvm_set_guest_debug_data *dbg_data = data;
 
+    if (cpu_single_env->kvm_cpu_state.regs_modified) {
+        kvm_arch_put_registers(cpu_single_env);
+        cpu_single_env->kvm_cpu_state.regs_modified = 0;
+    }
     dbg_data->err =
         kvm_set_guest_debug(cpu_single_env->kvm_cpu_state.vcpu_ctx,
                             &dbg_data->dbg);