From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QK8t9-0006DM-Bn for qemu-devel@nongnu.org; Wed, 11 May 2011 08:51:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QK8t8-0001bw-De for qemu-devel@nongnu.org; Wed, 11 May 2011 08:51:39 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:34127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QK8t8-0001br-BA for qemu-devel@nongnu.org; Wed, 11 May 2011 08:51:38 -0400 Received: by ywl41 with SMTP id 41so173305ywl.4 for ; Wed, 11 May 2011 05:51:37 -0700 (PDT) Message-ID: <4DCA8655.3070807@codemonkey.ws> Date: Wed, 11 May 2011 07:51:33 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1305108925-26048-1-git-send-email-stefanha@linux.vnet.ibm.com> <1305108925-26048-2-git-send-email-stefanha@linux.vnet.ibm.com> <4DCA7B64.7000900@redhat.com> In-Reply-To: <4DCA7B64.7000900@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] coroutine: introduce coroutines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Anthony Liguori , Venkateswararao Jujjuri , Stefan Hajnoczi , qemu-devel@nongnu.org On 05/11/2011 07:04 AM, Paolo Bonzini wrote: > On 05/11/2011 12:15 PM, Stefan Hajnoczi wrote: >> +#ifdef __i386__ >> + asm volatile( >> + "mov %%esp, %%ebx;" >> + "mov %0, %%esp;" >> + "pushl %1;" >> + "call _trampoline;" >> + "mov %%ebx, %%esp;" >> + : : "r" (co->stack + co->stack_size), "r" (co) : "ebx" >> + ); > > This is incomplete, it should set FS:[4] and FS:[8] to top and bottom of > stack respectively, otherwise exception handling (including SIGSEGV) is > broken. But I think for Windows it's anyway better to use fibers. Commit > this and either I or Stefan Weil will fix it. :) > > Acked-by: Paolo Bonzini How about a generic thread fallback? That's what we do in gtk-vnc and it solves the portability issue in a very robust way. Regards, Anthony Liguori > > Paolo >