From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34140) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QK8Hc-0008DU-DO for qemu-devel@nongnu.org; Wed, 11 May 2011 08:12:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QK8HX-00041q-IC for qemu-devel@nongnu.org; Wed, 11 May 2011 08:12:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QK8HX-00041g-B1 for qemu-devel@nongnu.org; Wed, 11 May 2011 08:12:47 -0400 Message-ID: <4DCA7DDA.4010107@redhat.com> Date: Wed, 11 May 2011 14:15:22 +0200 From: Kevin Wolf 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 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: Anthony Liguori , Venkateswararao Jujjuri , Stefan Hajnoczi , qemu-devel@nongnu.org Am 11.05.2011 14:04, schrieb Paolo Bonzini: > 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 Yeah, I didn't feel like searching for the right APIs, but wanted to have something that builds for win32 at least. And this one seemed to work for some simple tests in Wine. So my plan with it was to CC Stefan Weil and have him provide the real implementation that works on 64 bit, too. ;-) Kevin