From owner-freebsd-arm@FreeBSD.ORG Tue Mar 11 12:09:25 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 068C6714 for ; Tue, 11 Mar 2014 12:09:25 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id DE852C64 for ; Tue, 11 Mar 2014 12:09:24 +0000 (UTC) Received: from bender (222-154-130-182.jetstream.xtra.co.nz [222.154.130.182]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 8FBB05C682; Tue, 11 Mar 2014 12:09:22 +0000 (UTC) Date: Wed, 12 Mar 2014 01:09:19 +1300 From: Andrew Turner To: Warner Losh Subject: Re: Updating the minimum armv6 requirement Message-ID: <20140312010919.30e90f96@bender> In-Reply-To: References: <20140311131945.01f4c9b2@bender> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 12:09:25 -0000 On Mon, 10 Mar 2014 20:42:38 -0600 Warner Losh wrote: > > On Mar 10, 2014, at 6:19 PM, Andrew Turner > wrote: > > > I've been looking at code that uses 64-bit C++ atomic operations on > > armv6. These require the ldrexd and strexd instructions that are > > present on armv6k. > > > > The problem is there is a mismatch between clang and binutils. Clang > > thinks armv6k is an arm1136jf-s and sets the cpu in the asm output > > as one. Binutils will see the cpu and think clang means an earlier > > armv6 instruction set that lacks the above instructions. > > > > In this case both are correct as prior to the r1p0 release of the > > arm1136jf-s core it was an armv6 core, and as of the r1p0 release it > > became an armv6k core. > > > > All of this is uninteresting for FreeBSD as the only ARMv6 SoC we > > run on appears to be the bcm2835, and maybe some Marvell parts. As > > the bcm2835 is an arm1176jzf-s and we are unlikely to get a new > > ARMv6 port I am suggesting we make this the minimum requirement. It > > appears NetBSD has the same requirement as clang will set the cpu > > to arm1176jzf-s when building for NetBSD and armv6. > > > > My proposal is to have the same CPU requirement as NetBSD for > > armv6. Is anyone working on an SoC that would be affected by this? > > I think this is OK. Is there some way to make the new requirement a > compile time error, or kernel-time panic? I don't think there is any way. On further investigation it appears all this would change is to update clang to generate for the same architecture variant as gcc. As far as I can tell there are no instruction differences between the arm1136 r1p0 and the arm1176, they are both armv6k cores. The additions the arm1176 bring are in other areas, e.g. adding TrustZone. In gcc we target armv6k as the base instruction set. Andrew