Re: [RFC PATCH] KVM: race-free exit from KVM_RUN without POSIX signals

From: Paolo Bonzini
Date: Wed Feb 08 2017 - 09:49:02 EST




On 08/02/2017 14:18, Christian Borntraeger wrote:
>> VCPU thread service thread
>> --------------------------------------------------------------
>> raise signal
>> signal handler
>> set run->immediate_exit
>> KVM_RUN
>> check run->immediate_exit
> So the idea is to have both, a signal and this flag and you want userspace
> to set this flag in its signal handler?

Yes. This flag can also replace qemu_cpu_kick_self.

> So we no longer block this signal
> in QEMU then. Makes sense.
> Do you have the QEMU patch ready, to do a better review of the whole idea?

I have something that seems to work, but I've not stressed it at all and
it depends on a few cleanups to the SIGBUS handling code (which is
currently x86-specific).

Paolo