Received: from [140.186.70.92] (port=45266 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrCy4-0001ML-Uc for qemu-devel@nongnu.org; Sun, 20 Feb 2011 12:21:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrCy2-0006GN-9d for qemu-devel@nongnu.org; Sun, 20 Feb 2011 12:21:08 -0500 Received: from adelie.canonical.com ([91.189.90.139]:35723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrCy1-0006Fn-SX for qemu-devel@nongnu.org; Sun, 20 Feb 2011 12:21:06 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1PrCy1-00031m-DQ for ; Sun, 20 Feb 2011 17:21:05 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 6169C2E80CD for ; Sun, 20 Feb 2011 17:21:05 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Sun, 20 Feb 2011 17:12:35 -0000 From: Aurelien Jarno Sender: bounces@canonical.com References: <20100330155853.23695.90233.malonedeb@wampee.canonical.com> Message-Id: <20110220171236.28191.60953.launchpad@soybean.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 551814] Re: qemu-system-sparc: conditional branch never taken when its delay slot accesses io and icount is being used Reply-To: Bug 551814 <551814@bugs.launchpad.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ** Changed in: qemu Status: Fix Committed =3D> Fix Released -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/551814 Title: qemu-system-sparc: conditional branch never taken when its delay slot accesses io and icount is being used Status in QEMU: Fix Released Bug description: Affects qemu 0.12.3, the latest development version, which was 6d8ff4d85c= e2f3fc8a18dc8f077f73a4bd19a89a and earlier releases. Affects i386 and amd64 hosts; possibly others. = #define IO_ADDR 0x71e00000 set IO_ADDR, %o0 sub %g0, 1, %o3 or %g0, 5, %l5 or %g0, 3, %l3 cmp %l5, %l3 bne 1f ld [ %o0 ], %l0 clr %o3 1: mov 1, %l0 When running the following code in qemu-system-sparc with the -icount opt= ion, %o3 holds 0x0, which is wrong. Without the icount option, %o3 holds 0xffffffff, which is OK. The ba and bn instructions are not affected. Using the other Bicc instructions with the appropriate condition codes se= t, the branch is not taken. = qemu was configured like this mkdir bld0123; cd bld0123 ../qemu/configure --target-list=3Dsparc-softmmu make = The test code is assembled, linked and used in place of openbios-sparc32. n=3Dthe-test; $CC -c $n.S && $LD -e start -Ttext=3D0xffd00000 $n.o -o $n.= elf where CC and LD the cross compiler and linker. and run like this bld0123debug/sparc-softmmu/qemu-system-sparc -nographic -icount 1 bld0123debug/sparc-softmmu/qemu-system-sparc -nographic I've attached a tar file with some scripts and the compiled test code to make it easier to reproduce the problem.