From owner-freebsd-arm@FreeBSD.ORG Mon Mar 9 13:05:21 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28014D71 for ; Mon, 9 Mar 2015 13:05:21 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) (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 060B2672 for ; Mon, 9 Mar 2015 13:05:21 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [127.0.1.5]) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9) with ESMTP id t29D5KZ7011938 for ; Mon, 9 Mar 2015 13:05:20 GMT (envelope-from root@phabric-backend.isc.freebsd.org) Received: (from root@localhost) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9/Submit) id t29D5Keb011928; Mon, 9 Mar 2015 13:05:20 GMT (envelope-from root) Date: Mon, 9 Mar 2015 13:05:20 +0000 To: freebsd-arm@freebsd.org From: "meloun-miracle-cz (Michal Meloun)" Subject: [Differential] [Changed Subscribers] D2017: Allow to disable alignment faults in the kernel configuration file Message-ID: <5b814859c841d006aa8bfa8da5e67ed5@localhost.localdomain> X-Priority: 3 Thread-Topic: D2017: Allow to disable alignment faults in the kernel configuration file X-Herald-Rules: none X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: In-Reply-To: References: Thread-Index: M2IwYjY0ZDAxMWY3ZTNlM2Y4OWM0M2JjYjUzIFT9mpA= X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 13:05:21 -0000 meloun-miracle-cz added a subscriber: meloun-miracle-cz. meloun-miracle-cz added a comment. I don't think it's that simple. The "unaligned access" term on ARM consist of two things. First is "A" bit in SCTRL and second is option for compiler "-mno-unaligned-access / -munaligned-access". Unfortunately, because CPU allows unaligned accesses only for some instruction, the compiler must still know if accesses aligned or unaligned data. Therefore, properly written code compiled **cannot cause** unaligned abort if is compiled with with -mno-unaligned-access and runs on CPU that have CTRL.A bit set. And in opposite, bad code **can cause** unaligned abort even if is complied with -munaligned-access and runs on CPU that have CTRL.A bit cleared. Please see ARM ARM, section "A3.2.1 Unaligned data access" for details. REVISION DETAIL https://reviews.freebsd.org/D2017 To: zbb, ian, andrew, imp Cc: meloun-miracle-cz, freebsd-arm