[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 16/22] Introduce VCPU self-signaling service
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] Re: [PATCH 16/22] Introduce VCPU self-signaling service |
Date: |
Tue, 01 Feb 2011 14:59:24 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2011-02-01 14:50, Marcelo Tosatti wrote:
> On Tue, Feb 01, 2011 at 02:33:45PM +0100, Jan Kiszka wrote:
>>>> +++ 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.
>>>
>>
>> It's done intentionally this way: function shall not be used for a
>> remote env.
>>
>> Jan
>
> Can assert on qemu_cpu_self(env) for that.
>
We already assert on cpu_single_env which is the right condition.
Removing env from the parameter list avoids that someone even thinks
about misusing it.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux