From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSCtY-0004CJ-80 for qemu-devel@nongnu.org; Wed, 09 May 2012 15:49:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSCtV-0002ua-Vx for qemu-devel@nongnu.org; Wed, 09 May 2012 15:49:55 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:44710) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSCtV-0002tH-Rz for qemu-devel@nongnu.org; Wed, 09 May 2012 15:49:53 -0400 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 9 May 2012 15:49:49 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id EEA7F6E805F for ; Wed, 9 May 2012 15:49:44 -0400 (EDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q49JndOY101700 for ; Wed, 9 May 2012 15:49:39 -0400 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q49JnCmn032752 for ; Wed, 9 May 2012 13:49:13 -0600 Message-ID: <4FAACA0A.5040602@us.ibm.com> Date: Wed, 09 May 2012 14:48:26 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4FAAC3A3.5040503@siemens.com> <4FAAC521.5000907@msgid.tls.msk.ru> <4FAAC6B2.7040009@siemens.com> In-Reply-To: <4FAAC6B2.7040009@siemens.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.1] coroutine: Avoid ucontext usage on i386 Linux host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Kevin Wolf , Peter Maydell , Michael Tokarev , qemu-devel On 05/09/2012 02:34 PM, Jan Kiszka wrote: > On 2012-05-09 16:27, Michael Tokarev wrote: >> On 09.05.2012 23:21, Jan Kiszka wrote: >>> On i386, glibc only saves/restores the signal mask via sigprocmask, >>> excluding RT signal. A Linux bug in the compat version of this syscall >>> corrupts the RT signal state, which will cause lockups of QEMU's VCPU >>> threads. >> >> This should obviously be fixed in kernel, for benefit of all (not only >> qemu), do you have any details here? > > compat_sys_sigprocmask reads 32-bit sigmask from user space, i.e. > excluding RT signal, but calls sys_sigprocmask that takes a 64-bit > sigset. So the RT signals are unblocked. I'm testing a simple patch ATM, > will post it to LKML once this works. > >> >>> Signed-off-by: Jan Kiszka >>> --- >>> >>> I'm not sure where to fall back to. The existing code uses gthread, >>> likely because it is the safer harbor. So I picked it as well. >> >> Can't we resort to the SIGUSR1 workaround for the time being, while >> no RT signals are in actual use, and just have the time to let the >> kernel side to fix the things up before some actual RTsig user will >> emerge in qemu? I think it is a bit more conservative approach, >> especially having in mind the minority of users this issue affects >> (only 32/64 mixed environment). I'd favor for this variant, and >> it looks like I'm the "main" 32/64bit user of qemu in this world :) > > Most conservative is definitely this patch, not switching to SIGUSR1, > hoping that no other RT signal user shows up until current kernel are no > longer in use. Sorry, how is using a totally different code path more conservative than using a different signal number? Why would we even use an RT signal in the future? Regards, Anthony Liguori > > Jan >