# 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-ppc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html