On 8/5/20 10:47 AM, Paolo Bonzini wrote:
> On 05/08/20 10:40, Claudio Fontana wrote:
>>> #ifdef _WIN32
>>> - /* Eat dummy APC queued by qemu_cpu_kick_thread. */
>>> + /* Eat dummy APC queued by qemu_cpu_kick_thread. */
>>> + /* NB!!! Should not this be if (hax_enabled)? Is this wrong for whpx?
>>> */
>>> if (!tcg_enabled()) {
>>> SleepEx(0, TRUE);
>>> }
>>
>> Looking at the history here, I think this should be if (hax_enabled());
>> this check was added at a time when whpx did not exist, so I _think_ there
>> might have been an assumption here
>> that !tcg_enabled() on windows means actually hax_enabled() for eating this
>> dummy APC.
>
> Yes, that matches the condition under which QueueUserAPC is called in
> qemu_cpu_kick_thread.
>
> Paolo
>
>> Probably it does not cause problems, because whpx does not end up calling
>> qemu_wait_io_event,
>> instead it calls qemu_wait_io_event_common. But it would be more expressive
>> to use if (hax_enabled()) I think.
>
Thanks for the clarification, indeed,
I'd then convert it to hax_enabled() in the series then, because this allows
removing an extra include in cpus.c
(no need to check for tcg_enabled() in cpus.c anymore)...
thanks,
Claudio