From: Ian Campbell Subject: Re: [PATCH 10/17] xen: arm64: disable alignment traps Date: Thu, 20 Mar 2014 16:27:30 +0000 Message-ID: <1395332850.3104.28.camel@kazak.uk.xensource.com> References: "\"<1395330336.3104.12.camel@kazak.uk.xensource.com> " <1395330365-9901-10-git-send-email-ian.campbell@citrix.com> " <532B0FDA.7070707@citrix.com> <1395331183.3104.21.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Gordan Bobic Cc: Andrew Cooper , xen-devel@lists.xen.org, julien.grall@linaro.org, tim@xen.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Thu, 2014-03-20 at 16:21 +0000, Gordan Bobic wrote: > On 2014-03-20 15:59, Ian Campbell wrote: > > On Thu, 2014-03-20 at 15:57 +0000, Andrew Cooper wrote: > >> On 20/03/14 15:45, Ian Campbell wrote: > >> > The mem* primitives which I am about to import from Linux in a subsequent > >> > patch rely on the hardware handling misalignment. > >> > > >> > The benefits of an optimised memcpy etc oughtweigh the downsides. > > > > Ahem, "outweigh". > > Just FYI, the slow-down from heavy unaligned accesses (with > hardware alignment fixup, you can't disable it using > /proc/cpu/alignment) on Cortex A15 is about 40x. That's pretty staggering -- are you positive this wasn't the kernel doing the fixups? > Most of the commonly used code has been fixed recently, but > there are still some packages that exhibit misaligned access > traps during their test suites and/or normal operation. > > Whether the hardware alignment fixup is less overheady on > ARM64, I don't know - I haven't been able to get my hands > on the hardware yet. arm64 is a lot "friendlier" than arm32 in this regard. I was mostly taking it on trust that whoever implemented memcpy.S etc found that memcpy.S with hardware alignment was better than the dumb loop, even if it wasn't as good as a clever memcpy.S which avoided the alignments. Ian.