From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47101 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8glG-0006R1-4h for qemu-devel@nongnu.org; Wed, 20 Oct 2010 18:03:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8glE-0008UC-K4 for qemu-devel@nongnu.org; Wed, 20 Oct 2010 18:03:53 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:59495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8glE-0008U5-GV for qemu-devel@nongnu.org; Wed, 20 Oct 2010 18:03:52 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e6.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o9KM4QXi031949 for ; Wed, 20 Oct 2010 18:04:26 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o9KM3poA446974 for ; Wed, 20 Oct 2010 18:03:51 -0400 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o9KM3pdV003277 for ; Wed, 20 Oct 2010 16:03:51 -0600 Message-ID: <4CBF6747.3020308@linux.vnet.ibm.com> Date: Wed, 20 Oct 2010 17:03:51 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <10ae5833ff9de153c311917d532f3e84e5b00387.1287596626.git.mtosatti@redhat.com> <4CBF485C.9060808@linux.vnet.ibm.com> <4CBF65A7.3090903@redhat.com> In-Reply-To: <4CBF65A7.3090903@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 08/10] MCE: Relay UCR MCE to guest List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Avi Kivity On 10/20/2010 04:56 PM, Paolo Bonzini wrote: > On 10/20/2010 09:51 PM, Anthony Liguori wrote: >> I don't understand why this loop is needed but we specifically wait for >> a signal to get delivered that's either SIG_IPI or SIGBUS. We then check >> whether a SIG_IPI or SIGBUS is pending and loop waiting for signals >> again. >> >> Shouldn't we be looping on just sigismember(SIGBUS)? > > You mean because SIG_IPI is a real-time signal and standard signals > are delivered first? OTOH, real-time signals can be queued multiple > times so it makes sense to loop on SIG_IPI as well. > >> BTW, we're no longer respecting timeout because we're not adjusting ts >> after each iteration. > > The timeout of qemu_kvm_eat_signal is always zero. So then qemu_kvm_eat_signal purely polls and it will happily keep polling as long as there is a signal pending. So what's the point of doing a sigtimedwait() and dropping qemu_mutex? Why not just check sigpending in a loop? Regards, Anthony Liguori > Paolo