qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC v4 14/28] tcg: add kick timer for single-threaded


From: Alex Bennée
Subject: Re: [Qemu-devel] [RFC v4 14/28] tcg: add kick timer for single-threaded vCPU emulation
Date: Wed, 07 Sep 2016 11:15:44 +0100
User-agent: mu4e 0.9.17; emacs 25.1.11

Paolo Bonzini <address@hidden> writes:

> On 07/09/2016 05:25, Richard Henderson wrote:
>>>
>>> +    /* Set to kick if we have to do more than one vCPU */
>>> +    if (CPU_NEXT(first_cpu)) {
>>> +        kick_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,  kick_tcg_thread,
>>> +                                  &kick_timer);
>>
>> I'm not especially keen on this pointer to local variable thing.
>> Perhaps better as
>>
>>   kick_timer = timer_new_ns(..., NULL);
>>   kick_timer->opaque = kick_timer;
>
> Or put it in CPUState and pass that.

I was trying to avoid expanding CPUState for something that is only
required in one mode of operation. However I appreciate abusing the
stack is a little magical even though we never leave the function.

If setting kick_timer->opaque directly doesn't violate the interface
then I'll do that.

>
> Paolo
>
>> and avoid the indirection in kick_tcg_thread.


--
Alex Bennée



reply via email to

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