From: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> 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@xxxxxxxxxxx> --- cpus.c | 19 ++++++++++++++++++- qemu-common.h | 1 + 2 files changed, 19 insertions(+), 1 deletions(-) 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 */ -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html