diff mbox

[11/18] Introduce VCPU self-signaling service

Message ID 0ae314c71742cebc1f25053e42d6d5c5392291a8.1294648329.git.jan.kiszka@web.de
State New
Headers show

Commit Message

Jan Kiszka Jan. 10, 2011, 8:32 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

Introduce qemu_cpu_kick_self to send SIG_IPI to the calling VCPU
context. First user will be kvm.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 cpus.c        |   19 ++++++++++++++++++-
 qemu-common.h |    1 +
 2 files changed, 19 insertions(+), 1 deletions(-)

Comments

Marcelo Tosatti Jan. 24, 2011, 11:47 a.m. UTC | #1
On Mon, Jan 10, 2011 at 09:32:04AM +0100, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Introduce qemu_cpu_kick_self to send SIG_IPI to the calling VCPU
> context. First user will be kvm.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

For the updated patch, can't see where thread_kicked is cleared.
Jan Kiszka Jan. 24, 2011, 12:36 p.m. UTC | #2
On 2011-01-24 12:47, Marcelo Tosatti wrote:
> On Mon, Jan 10, 2011 at 09:32:04AM +0100, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> Introduce qemu_cpu_kick_self to send SIG_IPI to the calling VCPU
>> context. First user will be kvm.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> 
> For the updated patch, can't see where thread_kicked is cleared.
> 

"Prevent abortion on multiple VCPU kicks", 6 patches earlier (assuming
you are hopefully looking at the patch queue in my git, not some older
postings).

Jan
diff mbox

Patch

diff --git a/cpus.c b/cpus.c
index 89b4bd7..4a4d130 100644
--- a/cpus.c
+++ b/cpus.c
@@ -450,7 +450,17 @@  void pause_all_vcpus(void)
 
 void qemu_cpu_kick(void *env)
 {
-    return;
+}
+
+void qemu_cpu_kick_self(void)
+{
+#ifndef _WIN32
+    assert(cpu_single_env);
+
+    raise(SIG_IPI);
+#else
+    abort();
+#endif
 }
 
 void qemu_notify_event(void)
@@ -789,6 +799,13 @@  void qemu_cpu_kick(void *_env)
     qemu_thread_signal(env->thread, SIG_IPI);
 }
 
+void qemu_cpu_kick_self(void)
+{
+    assert(cpu_single_env);
+
+    qemu_thread_signal(cpu_single_env->thread, SIG_IPI);
+}
+
 int qemu_cpu_self(void *_env)
 {
     CPUState *env = _env;
diff --git a/qemu-common.h b/qemu-common.h
index 63d9943..220c8c8 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -287,6 +287,7 @@  void qemu_notify_event(void);
 
 /* Unblock cpu */
 void qemu_cpu_kick(void *env);
+void qemu_cpu_kick_self(void);
 int qemu_cpu_self(void *env);
 
 /* work queue */