From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QceUy-0005Y0-M7 for qemu-devel@nongnu.org; Fri, 01 Jul 2011 10:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QceUw-000820-SO for qemu-devel@nongnu.org; Fri, 01 Jul 2011 10:15:12 -0400 Received: from mail-qy0-f180.google.com ([209.85.216.180]:64943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QceUw-00081O-3q for qemu-devel@nongnu.org; Fri, 01 Jul 2011 10:15:10 -0400 Received: by qyk30 with SMTP id 30so1957152qyk.4 for ; Fri, 01 Jul 2011 07:15:09 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4E0DC450.4000700@jermar.eu> References: <4E0CE6A7.10901@jermar.eu> <4E0D9527.7010106@jermar.eu> <4E0DC450.4000700@jermar.eu> Date: Fri, 1 Jul 2011 16:15:09 +0200 Message-ID: From: Laurent Desnogues Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [HelenOS-devel] [sparc64] Miscomputed minimum of a group of numbers in sparc64 emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jakub Jermar Cc: HelenOS development mailing list , qemu-devel@nongnu.org On Fri, Jul 1, 2011 at 2:57 PM, Jakub Jermar wrote: [...] > When _not_ singlestepping via GDB's `stepi`, the testcase will fail and > crash Qemu like this: > > qemu: fatal: Trap 0x0101 while trap level (5) >= MAXTL (5), Error state > > > On the other hand, when I attach GDB to Qemu and step through all > instructions using `stepi`, the testcase will succeed and crash Qemu > like this: > > qemu: fatal: Trap 0x0100 while trap level (5) >= MAXTL (5), Error state > > > Mind the difference in the trap type - 0x100 for success, 0x101 for failure. > > This is how I run the test: > > Without GDB: > $ qemu-system-sparc64 -bios ./testcase > > With GDB: > $ qemu-system-sparc64 -bios ./testcase -s -S > > From another terminal: > $ /usr/local/cross/sparc64/bin/sparc64-linux-gnu-gdb > (gdb) set architecture sparc:v9 > (gdb) target remote localhost:1234 > (gdb) stepi > ... > > Hope this helps to fix the problem. You don't have to use gdb to reproduce the issue, just add -singlestep when running qemu. I find it odd that udivx is using cpu_cc_src and cpu_cc_src2. Using dedicated local temps seems to fix the issue. HTH, Laurent