From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPJEH-0002bA-Hr for qemu-devel@nongnu.org; Wed, 25 May 2011 14:54:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPJEG-0007CY-JW for qemu-devel@nongnu.org; Wed, 25 May 2011 14:54:49 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:46610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPJEG-0007CU-Fu for qemu-devel@nongnu.org; Wed, 25 May 2011 14:54:48 -0400 Received: by ywl41 with SMTP id 41so5409ywl.4 for ; Wed, 25 May 2011 11:54:47 -0700 (PDT) Sender: Richard Henderson Message-ID: <4DDD5073.80601@twiddle.net> Date: Wed, 25 May 2011 11:54:43 -0700 From: Richard Henderson 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> <4DCA8655.3070807@codemonkey.ws> <4DCA86A1.2020306@redhat.com> <4DCA89A9.8070000@us.ibm.com> <4DCA9303.5040400@redhat.com> <20110511135154.GU2661@redhat.com> <20110524193750.GQ969@shareable.org> <20110524195812.GA13211@stefanha-thinkpad.localdomain> <20110524205106.GS969@shareable.org> In-Reply-To: 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: Stefan Hajnoczi Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , qemu-devel@nongnu.org, Paolo Bonzini , Venkateswararao Jujjuri On 05/25/2011 12:09 AM, Stefan Hajnoczi wrote: > On Tue, May 24, 2011 at 9:51 PM, Jamie Lokier wrote: >> Stefan Hajnoczi wrote: >>> My current plan is to try using sigaltstack(2) instead of >>> makecontext()/swapcontext() as a hack since OpenBSD doesn't have >>> makecontext()/swapcontext(). >> >> sigaltstack() is just a system call to tell the system about an >> alternative signal stack - that you have allocated yourself using >> malloc(). According to 'info libc "Signal Stack"'. It won't help you >> get a new stack by itself. > > Issue sigaltstack() with the malloced new stack. Send yourself a > signal and in a custom signal handler setjmp() to stash away the state > (you're now on the new stack). Is any of this really easier than simply writing 20-30 lines of assembly to do what you Really Want And Nothing Else? Honestly, this is qemu we're talking about, and we assume you've already ported TCG to the host cpu plus abi. How hard is it to just DTRT with a qemu-specific routine, anyway? r~