Skip to contentSkip to conversation

temporary fix for on_vcpu

PATCH In review Glauber Costa 2 participants 6 messages Sep 11, 2009 – Sep 17, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 temporary fix for on_vcpu

Recent changes made on_vcpu hit the abort() path, even with the IO thread disabled. This is because cpu_single_env is no longer set when we call this function. Although the correct fix is a little bit more complicated that that, the recent thread in which I proposed qemu_queue_work (which fixes that, btw), is likely to go on a quite different direction.

So for the benefit of those using guest debugging, I'm proposing this simple fix in the interim.

---
 kvm-all.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
kvm-all.c +4 -0
index df4e849..2c24440 100644
@@ -902,11 +902,15 @@ void kvm_setup_guest_memory(void *start, size_t size)
 #ifdef KVM_CAP_SET_GUEST_DEBUG
 static void on_vcpu(CPUState *env, void (*func)(void *data), void *data)
 {
+#ifdef CONFIG_IOTHREAD
     if (env == cpu_single_env) {
         func(data);
         return;
     }
     abort();
+#else
+   func(data);
+#endif
 }
 
 struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *env,
Signature · 1 line
1.6.2.5
#1 lore raw
Quoted 20 lines · Glauber Costa

Recent changes made on_vcpu hit the abort() path, even with the IO thread disabled. This is because cpu_single_env is no longer set when we call this function. Although the correct fix is a little bit more complicated that that, the recent thread in which I proposed qemu_queue_work (which fixes that, btw), is likely to go on a quite different direction.

So for the benefit of those using guest debugging, I'm proposing this simple fix in the interim.

---
 kvm-all.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
kvm-all.c +0 -0
index df4e849..2c24440 100644
@@ -902,11 +902,15 @@ void kvm_setup_guest_memory(void *start, size_t size)
 #ifdef KVM_CAP_SET_GUEST_DEBUG

kvm-all.c void kvm_setup_guest_memory(void *start, size_t size) · line 912

Quoted 10 lines
kvm-all.c +3 -0
 static void on_vcpu(CPUState *env, void (*func)(void *data), void *data)
 {
+#ifdef CONFIG_IOTHREAD
     if (env == cpu_single_env) {
         func(data);
         return;
     }
     abort();
+#else
+   func(data);

spaces++ :) But the workaround works.

kvm-all.c void kvm_setup_guest_memory(void *start, size_t size) · line 916

Quoted 4 lines
kvm-all.c +1 -0
+#endif
 }
 
 struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *env,

Unless there is hope to fix kvm in iothread mode soon, we should issue a warning or even disable kvm support in that setup. That is particularly important for 0.11-stable.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#2 lore raw
Quoted 34 lines · Jan Kiszka
Quoted 20 lines · Glauber Costa

Recent changes made on_vcpu hit the abort() path, even with the IO thread disabled. This is because cpu_single_env is no longer set when we call this function. Although the correct fix is a little bit more complicated that that, the recent thread in which I proposed qemu_queue_work (which fixes that, btw), is likely to go on a quite different direction.

So for the benefit of those using guest debugging, I'm proposing this simple fix in the interim.

---
 kvm-all.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
kvm-all.c +0 -0
index df4e849..2c24440 100644
@@ -902,11 +902,15 @@ void kvm_setup_guest_memory(void *start, size_t size)
 #ifdef KVM_CAP_SET_GUEST_DEBUG

kvm-all.c void kvm_setup_guest_memory(void *start, size_t size) · line 912

Quoted 10 lines
kvm-all.c +3 -0
 static void on_vcpu(CPUState *env, void (*func)(void *data), void *data)
 {
+#ifdef CONFIG_IOTHREAD
     if (env == cpu_single_env) {
         func(data);
         return;
     }
     abort();
+#else
+   func(data);

spaces++ :) But the workaround works.

Quoted 8 lines

kvm-all.c void kvm_setup_guest_memory(void *start, size_t size) · line 916

Quoted 4 lines
kvm-all.c +1 -0
+#endif
 }
 
 struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *env,

Unless there is hope to fix kvm in iothread mode soon, we should issue a warning or even disable kvm support in that setup. That is particularly important for 0.11-stable.

As I said, with the fixes I sent recently, it should work pretty well.

#3 lore raw
Quoted 34 lines · Glauber Costa
Quoted 33 lines · Jan Kiszka
Quoted 20 lines · Glauber Costa

Recent changes made on_vcpu hit the abort() path, even with the IO thread disabled. This is because cpu_single_env is no longer set when we call this function. Although the correct fix is a little bit more complicated that that, the recent thread in which I proposed qemu_queue_work (which fixes that, btw), is likely to go on a quite different direction.

So for the benefit of those using guest debugging, I'm proposing this simple fix in the interim.

---
 kvm-all.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
kvm-all.c +0 -0
index df4e849..2c24440 100644
@@ -902,11 +902,15 @@ void kvm_setup_guest_memory(void *start, size_t size)
 #ifdef KVM_CAP_SET_GUEST_DEBUG

kvm-all.c void kvm_setup_guest_memory(void *start, size_t size) · line 912

Quoted 10 lines
kvm-all.c +3 -0
 static void on_vcpu(CPUState *env, void (*func)(void *data), void *data)
 {
+#ifdef CONFIG_IOTHREAD
     if (env == cpu_single_env) {
         func(data);
         return;
     }
     abort();
+#else
+   func(data);

spaces++ :) But the workaround works.

Quoted 8 lines
Quoted 7 lines

kvm-all.c void kvm_setup_guest_memory(void *start, size_t size) · line 916

Quoted 4 lines
kvm-all.c +1 -0
+#endif
 }
 
 struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *env,

Unless there is hope to fix kvm in iothread mode soon, we should issue a warning or even disable kvm support in that setup. That is particularly important for 0.11-stable.

As I said, with the fixes I sent recently, it should work pretty well.

You are referring to the workqueue things? Or "do proper cpu_self check" and the corresponding 2/2 (which I do not find in the archives)?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#4 lore raw
Quoted 38 lines · Jan Kiszka
Quoted 37 lines · Glauber Costa
Quoted 36 lines · Jan Kiszka
Quoted 20 lines · Glauber Costa

Recent changes made on_vcpu hit the abort() path, even with the IO thread disabled. This is because cpu_single_env is no longer set when we call this function. Although the correct fix is a little bit more complicated that that, the recent thread in which I proposed qemu_queue_work (which fixes that, btw), is likely to go on a quite different direction.

So for the benefit of those using guest debugging, I'm proposing this simple fix in the interim.

---
 kvm-all.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
kvm-all.c +0 -0
index df4e849..2c24440 100644
@@ -902,11 +902,15 @@ void kvm_setup_guest_memory(void *start, size_t size)
 #ifdef KVM_CAP_SET_GUEST_DEBUG

kvm-all.c void kvm_setup_guest_memory(void *start, size_t size) · line 912

Quoted 10 lines
kvm-all.c +3 -0
 static void on_vcpu(CPUState *env, void (*func)(void *data), void *data)
 {
+#ifdef CONFIG_IOTHREAD
     if (env == cpu_single_env) {
         func(data);
         return;
     }
     abort();
+#else
+   func(data);

spaces++ :) But the workaround works.

Quoted 3 lines
kvm-all.c +1 -0
+#endif
 }
 
Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

kvm-all.c void kvm_setup_guest_memory(void *start, size_t size) · line 916

Quoted 1 line
kvm-all.c +0 -0
 struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *env,

Unless there is hope to fix kvm in iothread mode soon, we should issue a warning or even disable kvm support in that setup. That is particularly important for 0.11-stable.

As I said, with the fixes I sent recently, it should work pretty well.

You are referring to the workqueue things? Or "do proper cpu_self check" and the corresponding 2/2 (which I do not find in the archives)?

The later.
The 1/2 numbering is by bad. It is the way it was in my personal tree. The other patch is already sent a while ago. Not sure what anthony did of it.

If anthony prefer, I can resend both to make it easier to pick

#5 lore raw

PATCH RESEND 1/1 temporary fix for on_vcpu

In reply to Glauber Costa

From: Glauber Costa <[email protected]>

Recent changes made on_vcpu hit the abort() path, even with the IO thread disabled. This is because cpu_single_env is no longer set when we call this function. Although the correct fix is a little bit more complicated that that, the recent thread in which I proposed qemu_queue_work (which fixes that, btw), is likely to go on a quite different direction.

So for the benefit of those using guest debugging, I'm proposing this simple fix in the interim.

---

 kvm-all.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
kvm-all.c +4 -0
index ac57984..3c37dd7 100644
@@ -905,11 +905,15 @@ void kvm_setup_guest_memory(void *start, size_t size)
 #ifdef KVM_CAP_SET_GUEST_DEBUG
 static void on_vcpu(CPUState *env, void (*func)(void *data), void *data)
 {
+#ifdef CONFIG_IOTHREAD
     if (env == cpu_single_env) {
         func(data);
         return;
     }
     abort();
+#else
+    func(data);
+#endif
 }
 
 struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *env,