From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JrFoB-0002iL-E2 for qemu-devel@nongnu.org; Wed, 30 Apr 2008 13:09:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JrFo8-0002hu-Vb for qemu-devel@nongnu.org; Wed, 30 Apr 2008 13:09:30 -0400 Received: from [199.232.76.173] (port=57790 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JrFo8-0002hr-Sw for qemu-devel@nongnu.org; Wed, 30 Apr 2008 13:09:28 -0400 Received: from nf-out-0910.google.com ([64.233.182.191]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JrFo8-00036y-TL for qemu-devel@nongnu.org; Wed, 30 Apr 2008 13:09:29 -0400 Received: by nf-out-0910.google.com with SMTP id b2so217065nfb.12 for ; Wed, 30 Apr 2008 10:09:23 -0700 (PDT) Message-ID: Date: Wed, 30 Apr 2008 20:09:23 +0300 From: "Blue Swirl" Subject: Re: [Qemu-devel] Crash due to invalid env->current_tb In-Reply-To: <20080430152102.GC6712@os.inf.tu-dresden.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080429115614.GA15524@os.inf.tu-dresden.de> <20080429184011.GK17356@os.inf.tu-dresden.de> <20080430151132.GB6712@os.inf.tu-dresden.de> <20080430152102.GC6712@os.inf.tu-dresden.de> 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 On 4/30/08, Adam Lackorzynski wrote: > > On Wed Apr 30, 2008 at 17:11:32 +0200, Adam Lackorzynski wrote: > > On Wed Apr 30, 2008 at 11:08:46 +0200, Alexander Graf wrote: > > > > There was a comment from Fabrice on how to do prologues in TCG to save / > > > restore the clobbered values. Btw, ebx gets clobbered as well. > > > > tcg/README says that some registers are clobbered. So something like > > this should be safe: > > > > Index: cpu-exec.c > > =================================================================== > > --- cpu-exec.c (revision 4276) > > +++ cpu-exec.c (working copy) > > @@ -690,6 +691,15 @@ > > fp.ip = tc_ptr; > > fp.gp = code_gen_buffer + 2 * (1 << 20); > > (*(void (*)(void)) &fp)(); > > +#elif defined(__i386) > > + asm volatile ("push %%ebp\n" > > + "push %%ebx\n" > > + "call *%1\n" > > + "pop %%ebx\n" > > + "pop %%ebp\n" > > + : "=a" (T0) > > + : "r" (gen_func) > > + : "esi", "edi", "ecx", "edx"); > > #else > > T0 = gen_func(); > > #endif > > > I just realised that the push and pop of ebx is not needed as T0 is ebx > which gets overwritten in the output anyway. Sparc32 compiles, but for sparc64-softmmu target, I get compiler errors: /src/qemu/cpu-exec.c: In function `cpu_sparc_exec': /src/qemu/cpu-exec.c:694: error: impossible register constraint in `asm' /src/qemu/cpu-exec.c:694: error: can't find a register in class `ALL_REGS' while reloading `asm'