qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 16/22] Introduce VCPU self-signaling service


From: Marcelo Tosatti
Subject: [Qemu-devel] Re: [PATCH 16/22] Introduce VCPU self-signaling service
Date: Tue, 1 Feb 2011 11:14:04 -0200
User-agent: Mutt/1.5.20 (2009-08-17)

On Thu, Jan 27, 2011 at 02:10:00PM +0100, Jan Kiszka wrote:
> 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>
> ---
>  cpus.c        |   21 +++++++++++++++++++++
>  qemu-common.h |    1 +
>  2 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/cpus.c b/cpus.c
> index bba59e5..88bed4e 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -531,6 +531,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;
> @@ -808,6 +819,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;
> +    }
> +}
> +

There is no need to use cpu_single_env, can pass CPUState instead.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]