From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Simek Date: Fri, 9 Mar 2018 13:29:05 +0100 Subject: [U-Boot] [PATCH] arm: Disable the strict alignment of data on armv7 In-Reply-To: <6331ece57fb3d30c@bloch.sibelius.xs4all.nl> References: <029f7f8f6d89cc77c92e04223a7402376e050f56.1520433579.git.michal.simek@xilinx.com> <20180308225243.3BCC0240047@gemini.denx.de> <20180309112601.14CEE247241@gemini.denx.de> <6331ece57fb3d30c@bloch.sibelius.xs4all.nl> Message-ID: <99b92d37-6bf9-b3fb-deab-6856125ef9f9@xilinx.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 9.3.2018 13:23, Mark Kettenis wrote: >> From: Wolfgang Denk >> Date: Fri, 09 Mar 2018 12:26:01 +0100 >> >> Dear Michal, >> >> In message you wrote: >>> >>>> Can you please add some comments what the consequences of this >>>> change are? I guess there are advantages, but I also guess these >>>> come at a price? >>> >>> That's something what I am expecting from this discussion if there are >>> any corner cases which we are not aware of. >>> >>> We found this setting based on randomized testing where simply non >>> aligned access for memory read was causing exception. >> >> Hm... One possible position one can take is that unaligned accesses >> are likely an indication for incorrect or sloppy programming. >> usually we design data structures, buffers etc. such that no >> unaligned accesses take place. Most code is explicitly written in >> such a way that it also runs on architectures where unaligned access >> simply don't work. >> >> I feel that providing such an option just opens the door for lousy >> programmers who don't think throroughly about the code they write. >> >> Yes, in some cases this may be conveniendt. But there are also >> cases where the problem is just papered over, and hits all the >> harder later like when you also enable caching. > > That is pretty much why we run OpenBSD in strict alignment mode on as > much architectures as possible. More strict-alignment architectures > means that bugs are found quicker. So as long as U-Boot supports > hardware that cares about alignment (e.g. older ARM, MIPS, SuperH) I'd > say there is a clear benefit of running armv7 in strict alignment mode. > > Also note that some armv7 instructions still require properly aligned > data. And that really old ARM hardware silently fetches the wrong > data for a misaligned load instruction. > No problem with this at all. I wanted to check that this is intended setup. Thanks, Michal