Skip to contentSkip to conversation

Initialize kvm qemu enviroment breakpoints for PowerPC

PATCH Applied Jerone Young 3 participants 5 messages Jun 9, 2008 – Jun 18, 2008 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Initialize kvm qemu enviroment breakpoints for PowerPC

2 files changed, 3 insertions(+)
qemu/gdbstub.c          |    2 ++
qemu/qemu-kvm-powerpc.c |    1 +

This patch initilizes breakpoints in the cpu enviroment for PowerPC for kvm qemu.
It also adds places into gdb stub for commands that change env->nip, and load kvm registers with the new program counter.

qemu/gdbstub.c +2 -0
@@ -983,6 +983,7 @@ static int gdb_handle_packet(GDBState *s
             kvm_load_registers(env);
 #elif defined (TARGET_PPC)
             env->nip = addr;
+            kvm_load_registers(env);
 #elif defined (TARGET_SPARC)
             env->pc = addr;
             env->npc = addr + 4;
@@ -1021,6 +1022,7 @@ static int gdb_handle_packet(GDBState *s
             kvm_load_registers(env);
 #elif defined (TARGET_PPC)
             env->nip = addr;
+            kvm_load_registers(env);
 #elif defined (TARGET_SPARC)
             env->pc = addr;
             env->npc = addr + 4;
qemu/qemu-kvm-powerpc.c +1 -0
@@ -31,6 +31,7 @@ extern kvm_context_t kvm_context;
 
 void cpu_reset(CPUState *env)
 {
+	memset(env->breakpoints, 0, sizeof(env->breakpoints));
 	cpu_ppc_reset(env);
 }
 
#1 lore raw
Quoted 12 lines · Jerone Young
qemu/gdbstub.c +1 -0
@@ -983,6 +983,7 @@ static int gdb_handle_packet(GDBState *s
             kvm_load_registers(env);
 #elif defined (TARGET_PPC)
             env->nip = addr;
+            kvm_load_registers(env);
 #elif defined (TARGET_SPARC)
             env->pc = addr;
             env->npc = addr + 4;

qemu/gdbstub.c static int gdb_handle_packet(GDBState *s · line 1028

Quoted 7 lines
qemu/gdbstub.c +1 -0
@@ -1021,6 +1022,7 @@ static int gdb_handle_packet(GDBState *s
             kvm_load_registers(env);
 #elif defined (TARGET_PPC)
             env->nip = addr;
+            kvm_load_registers(env);
 #elif defined (TARGET_SPARC)
             env->pc = addr;
             env->npc = addr + 4;

These should be protected by a kvm_enabled() test, just like you see for x86 four lines earlier.

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
#2 lore raw
Quoted 15 lines · Hollis Blanchard
Quoted 14 lines · Jerone Young
qemu/gdbstub.c +1 -0
@@ -983,6 +983,7 @@ static int gdb_handle_packet(GDBState *s
             kvm_load_registers(env);
 #elif defined (TARGET_PPC)
             env->nip = addr;
+            kvm_load_registers(env);
 #elif defined (TARGET_SPARC)
             env->pc = addr;
             env->npc = addr + 4;
@@ -1021,6 +1022,7 @@ static int gdb_handle_packet(GDBState *s
             kvm_load_registers(env);
 #elif defined (TARGET_PPC)
Quoted 8 lines

qemu/gdbstub.c static int gdb_handle_packet(GDBState *s · line 989

Quoted 5 lines
qemu/gdbstub.c +1 -0
             env->nip = addr;
+            kvm_load_registers(env);
 #elif defined (TARGET_SPARC)
             env->pc = addr;
             env->npc = addr + 4;

These should be protected by a kvm_enabled() test, just like you see for x86 four lines earlier.A

Actually the line above is x86 and it is not using kvm_enabled() before calling kvm_load_registers().

Quoted 1 line
#3 lore raw
Quoted 28 lines · Jerone Young
Quoted 16 lines · Hollis Blanchard
Quoted 14 lines · Jerone Young
qemu/gdbstub.c +1 -0
@@ -983,6 +983,7 @@ static int gdb_handle_packet(GDBState *s
             kvm_load_registers(env);
 #elif defined (TARGET_PPC)
             env->nip = addr;
+            kvm_load_registers(env);
 #elif defined (TARGET_SPARC)
             env->pc = addr;
             env->npc = addr + 4;
@@ -1021,6 +1022,7 @@ static int gdb_handle_packet(GDBState *s
             kvm_load_registers(env);
 #elif defined (TARGET_PPC)
Quoted 9 lines

qemu/gdbstub.c static int gdb_handle_packet(GDBState *s · line 989

Quoted 6 lines
qemu/gdbstub.c +1 -0
             env->nip = addr;
+            kvm_load_registers(env);
 #elif defined (TARGET_SPARC)
             env->pc = addr;
             env->npc = addr + 4;

These should be protected by a kvm_enabled() test, just like you see for x86 four lines earlier.A

Quoted 4 lines

Actually the line above is x86 and it is not using kvm_enabled() before calling kvm_load_registers().

Yes, kvm_load_registers() has a built-in kvm_enabled() test.

Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
Applied
#4 lore raw
In reply to Jerone Young
Quoted 3 lines · Jerone Young

This patch initilizes breakpoints in the cpu enviroment for PowerPC for kvm qemu.
It also adds places into gdb stub for commands that change env->nip, and load kvm registers with the new program counter.

Applied, thanks.

Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.