From owner-svn-src-head@freebsd.org Wed Sep 14 20:51:49 2016 Return-Path: Delivered-To: svn-src-head@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 96A11BDB564; Wed, 14 Sep 2016 20:51:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 5E5E5197C; Wed, 14 Sep 2016 20:51:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 02361784089; Thu, 15 Sep 2016 06:51:46 +1000 (AEST) Date: Thu, 15 Sep 2016 06:51:45 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Emmanuel Vadot cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305814 - head/sys/boot/common In-Reply-To: <20160914220949.bfbd8562ec180ab690b84b60@bidouilliste.com> Message-ID: <20160915063308.G2902@besplex.bde.org> References: <201609141743.u8EHhX7R038840@repo.freebsd.org> <20160915042715.N2557@besplex.bde.org> <20160914220949.bfbd8562ec180ab690b84b60@bidouilliste.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=iHnWpXaEffL-ftcl-ccA:9 a=CjuIK1q_8ugA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 20:51:49 -0000 On Wed, 14 Sep 2016, Emmanuel Vadot wrote: > Bruce Evans wrote: > >> On Wed, 14 Sep 2016, Emmanuel Vadot wrote: >> >>> Log: >>> ufsread: Do not cast struct direct from void * >>> This cause alignment problem on ARM (and possibly other archs), instead copy it. >>> ... >> >> This looks like a good pessimization for space. boot2 on i386 has to >> fit in 8192 bytes and has a negative number to spare (features are >> already left out). > > Do you have any suggestion on making the code better ? > This was the last patch for having EFI working on ARMv6 and this is > something that I want to be enabled by default at some point. At least copy to a local variable. Ifdefs for the space-constrained && non-strict-alignment arches work of course, but shouldn't be needed. You will have to investigate the -ffreestanding and builtin situation. -ffreestanding is set in 24 sub-Makefiles instead of correctly in 1 Makefile.inc. I think it applies to all of boot/i386. boot code almost never recovers from this using __builtin_*. Beware that some builtins just call an extern function which might not exist in boot code. Even memcpy barely exists in small boot2's. Some compilers have buggy -ffreestanding and call memcpy() for struct copying, so it is preferred to bcopy() in boot code. Bruce