Received: from [140.186.70.92] (port=41007 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PDxif-0006Ac-Us for qemu-devel@nongnu.org; Thu, 04 Nov 2010 07:11:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PDxiZ-0001wn-HU for qemu-devel@nongnu.org; Thu, 04 Nov 2010 07:11:00 -0400 Received: from adelie.canonical.com ([91.189.90.139]:35027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PDxiZ-0001wV-7S for qemu-devel@nongnu.org; Thu, 04 Nov 2010 07:10:55 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1PDxiV-0000kD-5q for ; Thu, 04 Nov 2010 11:10:51 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 5685F2E809C for ; Thu, 4 Nov 2010 11:10:47 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Thu, 04 Nov 2010 11:03:44 -0000 From: Peter Maydell Sender: bounces@canonical.com References: <20101104061226.18518.80408.malonedeb@wampee.canonical.com> Message-Id: <20101104110344.3558.96716.malone@wampee.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 670776] Re: Build errors on TEGRA2(ubuntu), testandset() Reply-To: Bug 670776 <670776@bugs.launchpad.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The Ubuntu ARM gcc defaults to building in Thumb mode. The swp/swpb instructions only exist in ARM mode. In any case, swp is deprecated for more recent ARM architectures (ARMv6 and above), and on ARMv7 MP it will UNDEF and have to be emulated in the kernel. So the testandset implementation should probably be replaced with something involving ldrex/strex for cores that support it, or by using the gcc sync primitives (needs a gcc 4.4.1 or better, I think). This Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/qemu- kvm/+bug/514252 has a patch which checks for the gcc primitives in configure and uses them if they exist -- you might like to try that. Or if we believe the comment at the top of qemu-lock.h that "most of this code should be redundant" we could do the cleanup to get rid of it completely :-) -- = Build errors on TEGRA2(ubuntu), testandset() https://bugs.launchpad.net/bugs/670776 You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. Status in QEMU: New Bug description: Build errors on TEGRA2(ubuntu) /tmp/ccqt9Y5t.s: Assembler messages: /tmp/ccqt9Y5t.s:1899: Error: selected processor does not support Thumb mode= 'swp r4, r4, [r2]' /tmp/ccqt9Y5t.s:1974: Error: selected processor does not support Thumb mode= 'swp r5, r5, [ip]' make[1]: *** [exec.o Error 1 qemu-lock.h #elif defined(__arm__) static inline int testandset (int *spinlock) { register unsigned int ret; __asm__ __volatile__("swp %0, %1, [%2]" : "=3Dr"(ret) : "0"(1), "r"(spinlock)); return ret; }