From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSCRp-0002hS-3V for qemu-devel@nongnu.org; Wed, 09 May 2012 15:21:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSCRn-0007lN-66 for qemu-devel@nongnu.org; Wed, 09 May 2012 15:21:16 -0400 Received: from thoth.sbs.de ([192.35.17.2]:18507) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSCRm-0007kr-Sy for qemu-devel@nongnu.org; Wed, 09 May 2012 15:21:15 -0400 Message-ID: <4FAAC3A3.5040503@siemens.com> Date: Wed, 09 May 2012 16:21:07 -0300 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [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: qemu-devel , Anthony Liguori , Kevin Wolf Cc: Peter Maydell , Michael Tokarev 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. Therefore, fall back to gthread coroutines on this host platform. 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. This is also stable material. configure | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 491109d..62dcdb2 100755 --- a/configure +++ b/configure @@ -2777,17 +2777,22 @@ fi # windows autodetected by make if test "$coroutine" = "" -o "$coroutine" = "ucontext"; then if test "$darwin" != "yes"; then - cat > $TMPC << EOF + if test "$linux" = "yes" -a "$cpu" = "i386"; then + # RT signal mask corruption for 32-on-64 bit prevents ucontext usage + coroutine_backend=gthread + else + cat > $TMPC << EOF #include #ifdef __stub_makecontext #error Ignoring glibc stub makecontext which will always fail #endif int main(void) { makecontext(0, 0, 0); return 0; } EOF - if compile_prog "" "" ; then + if compile_prog "" "" ; then coroutine_backend=ucontext - else - coroutine_backend=gthread + else + coroutine_backend=gthread + fi fi else echo "Silently falling back into gthread backend under darwin" -- 1.7.3.4