From owner-freebsd-arm@FreeBSD.ORG Mon Mar 9 16:49:20 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 23916C9A for ; Mon, 9 Mar 2015 16:49:20 +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 DCDCF35A for ; Mon, 9 Mar 2015 16:49:19 +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 t29GnJjT054096 for ; Mon, 9 Mar 2015 16:49:19 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 t29GnJRV054095; Mon, 9 Mar 2015 16:49:19 GMT (envelope-from root) Date: Mon, 9 Mar 2015 16:49:19 +0000 To: freebsd-arm@freebsd.org From: "zbb (Zbigniew Bodek)" Subject: [Differential] [Commented On] D2017: Allow to disable alignment faults in the kernel configuration file Message-ID: 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: M2IwYjY0ZDAxMWY3ZTNlM2Y4OWM0M2JjYjUzIFT9zw8= 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 16:49:20 -0000 zbb added a comment. **Jakub Palider wrote:** >Yes, I think I understand your reasoning, but you refer to a more >generic problem, related to CPU settings vs compiler code generation. >Let me show a more concrete example. Below is an extract from fault when >there is no ARM32_DISABLE_ALIGNMENT_FAULTS set. > >r7=a5b60b36a >Stopped at tcp_input+0x738: ldr r0, [r7, #0x004] > >Here, we can see instruction (LDR) which *does* operate on unaligned >addresses, so I assume compiler was clever enough not to use any of >those "forbidden" instructions (e.g. LDMIA/STMIA). Nevertheless the bit >SCTRL.A set still causes that fault happen and handled in the kernel. >As for alignment correctness in network code... well, I know it is >theoretically possible, but ensuring that would come with an >unacceptable performance cost. > >Summing up, I think that the option ought to be exported - especially >that this patch does no more than just changing feature visibility. >Feature which had been added to cpufunc.c already - not without a >reason. I personally don't understand about what is this discussion because from my point of view we have some portion of code that depends on an option that cannot be set in the configuration file. In this patch we just want to add the possibility to enable it. REVISION DETAIL https://reviews.freebsd.org/D2017 To: zbb, ian, andrew, imp Cc: meloun-miracle-cz, freebsd-arm