[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/37] Introduce VCPU self-signaling service
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [PATCH 18/37] Introduce VCPU self-signaling service |
Date: |
Mon, 14 Feb 2011 13:22:47 -0200 |
From: Jan Kiszka <address@hidden>
Introduce qemu_cpu_kick_self to send SIG_IPI to the calling VCPU
context. First user will be kvm.
Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Marcelo Tosatti <address@hidden>
---
cpus.c | 21 +++++++++++++++++++++
qemu-common.h | 1 +
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/cpus.c b/cpus.c
index 9a3fc31..6a85dc8 100644
--- a/cpus.c
+++ b/cpus.c
@@ -529,6 +529,17 @@ 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)
{
CPUState *env = cpu_single_env;
@@ -831,6 +842,16 @@ void qemu_cpu_kick(void *_env)
}
}
+void qemu_cpu_kick_self(void)
+{
+ assert(cpu_single_env);
+
+ if (!cpu_single_env->thread_kicked) {
+ qemu_thread_signal(cpu_single_env->thread, SIG_IPI);
+ cpu_single_env->thread_kicked = true;
+ }
+}
+
int qemu_cpu_self(void *_env)
{
CPUState *env = _env;
diff --git a/qemu-common.h b/qemu-common.h
index c7ff280..a4d9c21 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -288,6 +288,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 */
--
1.7.4
- [Qemu-devel] [PATCH 00/37] [PULL] qemu-kvm.git uq/master queue, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 29/37] kvm: Separate TCG from KVM cpu execution, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 05/37] Leave inner main_loop faster on pending requests, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 24/37] Refactor cpu_has_work/any_cpu_has_work in cpus.c, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 25/37] Fix a few coding style violations in cpus.c, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 32/37] kvm: x86: Catch and report failing IRQ and NMI injections, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 01/37] Prevent abortion on multiple VCPU kicks, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 18/37] Introduce VCPU self-signaling service,
Marcelo Tosatti <=
- [Qemu-devel] [PATCH 27/37] Refactor debug and vmstop request interface, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 06/37] Flatten the main loop, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 21/37] kvm: Leave kvm_cpu_exec directly after KVM_EXIT_SHUTDOWN, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 33/37] kvm: Remove unneeded memory slot reservation, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 10/37] kvm: Provide sigbus services arch-independently, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 26/37] Improve vm_stop reason declarations, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 08/37] kvm: Drop redundant kvm_enabled from kvm_cpu_thread_fn, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 13/37] kvm: Refactor qemu_kvm_eat_signals, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 36/37] kvm: Make kvm_state globally available, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 03/37] Process vmstop requests in IO thread, Marcelo Tosatti, 2011/02/14