Re: [PATCH 3 of 3] [PATCH] kvm-userspace: fix gdbstub kvm integration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

I was trying to debug my patch that is not working and noticed this
crash in current kvm git.

The patch below makes kvm not crash when gdb is attched to gdbserver
so it certainly improves things.

Thanks

Michal

PS if you want further input from me add me to CC

On 16/12/2008, Christian Ehrhardt <ehrhardt@xxxxxxxxxxxxxxxxxx> wrote:
> # HG changeset patch
>  # User Christian Ehrhardt <ehrhardt@xxxxxxxxxxxxxxxxxx>
>  # Date 1228989958 -3600
>  # Node ID f80fb35de91fe69dae889c70948c9a53212ee444
>  # Parent  6f228c807ad0b239b7342d2974debfc66418d784
>  [PATCH] kvm-userspace: fix gdbstub kvm integration
>
>  From: Christian Ehrhardt <ehrhardt@xxxxxxxxxxxxxxxxxx>
>
>  Some recent qemu upstream merges brought in a new concept to not use "env" as
>  current cpu in gdb_handle_packet anymore. But the kvm calls still do, this
>  leads to SIGDEV's as env is not initialized when calling the functions like
>  kvm_save_registers.
>
>  Insted there is now a gdbstate structure holding current cpu for
>  step/continue and "other" ops splitted.
>
>  This patch changes the kvm_save_registers calls to use the right CPUState
>  variable for the kvm calls in gdb_handle_packet.
>
>  Signed-off-by: Christian Ehrhardt <ehrhardt@xxxxxxxxxxxxxxxxxx>
>  ---
>
>  [diffstat]
>   gdbstub.c |    8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
>  [diff]
>
>  diff --git a/qemu/gdbstub.c b/qemu/gdbstub.c
>  --- a/qemu/gdbstub.c
>  +++ b/qemu/gdbstub.c
>  @@ -1348,7 +1348,7 @@ static int gdb_handle_packet(GDBState *s
>          }
>          break;
>      case 'g':
>  -        kvm_save_registers(env);
>  +        kvm_save_registers(s->g_cpu);
>          len = 0;
>          for (addr = 0; addr < num_g_regs; addr++) {
>              reg_size = gdb_read_register(s->g_cpu, mem_buf + len, addr);
>  @@ -1366,7 +1366,7 @@ static int gdb_handle_packet(GDBState *s
>              len -= reg_size;
>              registers += reg_size;
>          }
>  -        kvm_load_registers(env);
>  +        kvm_load_registers(s->g_cpu);
>          put_packet(s, "OK");
>          break;
>      case 'm':
>
> --
>  To unsubscribe from this list: send the line "unsubscribe kvm" in
>  the body of a message to majordomo@xxxxxxxxxxxxxxx
>  More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux