From owner-freebsd-toolchain@freebsd.org Mon Oct 17 21:31:30 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E73FC162E7 for ; Mon, 17 Oct 2016 21:31:30 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-39.reflexion.net [208.70.210.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 545DA79 for ; Mon, 17 Oct 2016 21:31:29 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 16254 invoked from network); 17 Oct 2016 21:24:40 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 17 Oct 2016 21:24:40 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.10.0) with SMTP; Mon, 17 Oct 2016 17:24:47 -0400 (EDT) Received: (qmail 629 invoked from network); 17 Oct 2016 21:24:47 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 17 Oct 2016 21:24:47 -0000 Received: from [192.168.1.107] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 3EEBAEC8B1B; Mon, 17 Oct 2016 14:24:42 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: RPI3 - clang 3.9.0 issues From: Mark Millard In-Reply-To: <20161017211143.GA20952@mutt-hardenedbsd> Date: Mon, 17 Oct 2016 14:24:41 -0700 Cc: freebsd-toolchain@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20161017211143.GA20952@mutt-hardenedbsd> To: Shawn Webb X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 21:31:30 -0000 [A quick top post about synchronous aborts for aarch64.] = http://infocenter.arm.com/help/index.jsp?topic=3D/com.arm.doc.den0024a/ch1= 0s02s01.html says: > Synchronous exceptions can occur for a number of possible reasons: >=20 > =E2=80=A2 Aborts from the MMU. For example, permission failures = or memory areas marked as Access flag fault.=20 > =E2=80=A2 SP and PC alignment checking. > =E2=80=A2 Unallocated instructions.=20 > =E2=80=A2 Service Calls (SVCs, SMCs and HVCs). >=20 > Such exceptions may be part of the normal operation of the OS. For = example, in Linux, when a task wishes to request allocation of a new = memory page, this is handled through the MMU abort mechanism. >=20 > In the ARMv7-A architecture, the prefetch abort, Data Abort and undef = exceptions are separate items. In AArch64, all of these events generate = a Synchronous abort. The exception handler may then read the syndrome = and FAR registers to obtain the necessary information to distinguish = between them (described in more detail later.) =3D=3D=3D Mark Millard markmi at dsl-only.net On 2016-Oct-17, at 2:11 PM, Shawn Webb = wrote: Hey All, I'm submitting this report to this list as directed by Ed Maste. The Raspberry Pi 3 is an ARMv8 SoC dev board. Within the last week, FreeBSD added basic initial support for it. We don't currently have a linker in HEAD for the arm64/aarch64 platform. The projects/clang390-import branch contains lld, though, which supports arm64/aarch64. Over the past few days, I've been working on testing clang 3.9.0 and lld on the RPI3. I've jotted down a few issues in FreeBSD's wiki: https://wiki.freebsd.org/arm64/rpi3 Mainly: low-level code like bootloaders (boot1.efi and loader.efi) do NOT work with projects/clang390-import. When I use boot1.efi and loader.efi compiled with HEAD (clang 3.8), they work. When the kernel is compiled with clang 3.9.0, it seems to freeze after being loaded by the clang 3.8 boot1.efi/loader.efi. I'm unsure if it's actually frozen or if simply nothing is being outputted to the console. Either way, I don't see console messages and the RPI3 _appears_ frozen. I'm tracking down a potential issue with jemalloc compiled with clang 3.9.0, but I need to verify that the issue exists in vanilla FreeBSD in addition to HardenedBSD. Most of my testing has been done with HardenedBSD to-date. If I find more issues or find the causes of the ones I've already documented, I'll be sure to not only update the wiki, but update this email thread as well. If there's anything anyone would like me to try, please let me know. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE