From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Mon, 14 Oct 2013 16:22:34 +0200 Subject: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition In-Reply-To: <000801cec8e4$3d768800$b8639800$%wilczek@samsung.com> References: <1381498270-24342-1-git-send-email-p.wilczek@samsung.com> <000601cec8b7$ae803050$0b8090f0$%wilczek@samsung.com> <20131014134626.7e691591@lilith> <20131014150002.2b1cfe82@lilith> <000801cec8e4$3d768800$b8639800$%wilczek@samsung.com> Message-ID: <20131014162234.46c0e5f2@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Piotr, On Mon, 14 Oct 2013 15:49:43 +0200, Piotr Wilczek wrote: > Dear Albert and M?ns, > > > -----Original Message----- > > From: M?ns Rullg?rd [mailto:mans at mansr.com] > > Sent: Monday, October 14, 2013 3:05 PM > > To: Albert ARIBAUD > > Cc: Piotr Wilczek; 'Tom Rini'; u-boot at lists.denx.de; 'Kyungmin Park' > > Subject: Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi > > partition > > > > Albert ARIBAUD writes: > > > > >> > Please do not advise using native unaligned accesses on code that > > >> > is not strictly used by ARMv6+ architectures: the present code, > > for > > >> > instance, might be run on pre-ARMv6 or non-ARM platforms, and > > thus, > > >> > should never assume ability to perform unaligned accesses > > natively. > > >> > > >> I'm advising no such thing. I said two things: > > >> > > >> 1. Declaring a struct with the 'packed' attribute makes gcc > > >> automatically generate correct code for all targets. _IF_ the > > >> selected target supports unaligned ldr/str, these might get > > used. > > >> > > >> 2. If your target is ARMv6 or later _AND_ you enable strict > > alignment > > >> checking in the system control register, you _MUST_ build with > > the > > >> -mno-unaligned-access flag. > > > > > > Then I apologize; I had read "Note that on ARMv6 and later ldr/str > > > support unaligned addresses unless this is explicitly disabled in the > > > system control register" as a suggestion to use that capability. > > > > If building for ARMv6 or later, I do suggest allowing unaligned > > accesses. The moment you add -march=armv6 (or equivalent), you allow > > for a number of things not supported by older versions, so why not > > unaligned memory accesses? > > > > Thank you for your comments, I will follow your advice. I will NAK building part_efi.c with options to allow native unaligned access. I will, OTOH, be ok with explicit unaligned reads/writes. > Best regards > Piotr Wilczek Amicalement, -- Albert.