From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JsPoW-0002I5-W8 for qemu-devel@nongnu.org; Sat, 03 May 2008 18:02:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JsPoW-0002Ht-Bl for qemu-devel@nongnu.org; Sat, 03 May 2008 18:02:40 -0400 Received: from [199.232.76.173] (port=52076 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JsPoW-0002Hq-8A for qemu-devel@nongnu.org; Sat, 03 May 2008 18:02:40 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JsPoV-0003qf-Gx for qemu-devel@nongnu.org; Sat, 03 May 2008 18:02:39 -0400 From: Paul Brook Subject: Re: [Qemu-devel] Crash due to invalid env->current_tb Date: Sat, 3 May 2008 23:02:32 +0100 References: <20080429115614.GA15524@os.inf.tu-dresden.de> <20080502154134.GA7060@os.inf.tu-dresden.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805032302.32996.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl > I made a new version that does not use T0 at all. Tested on i386 and > AMD64, both Sparc32 and Sparc64 work. AMD64 asm version does not seem > to be necessary. I guess amd64 is currently working by luck rather than by design. You're pushing a single word to the stack, which could cause issues with stack alignment. I suggest: sub $12,%%esp push %%ebp call *%1 pop %%ebp add $12,%%esp Likewise for amd64 you want sub $8, %%rsp, etc. > + : "ebx", "ecx", "edx", "esi", "edi", "cc"); You also want to add "memory" here. > #else > - T0 = gen_func(); > + next_tb = gen_func(); I'd just make this a #error. Other host are likely to need special consideration anyway. Other than that, looks ok to me. Paul