From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] ARM bus error due to alignment
Date: Thu, 5 Nov 2015 12:01:41 +0100 [thread overview]
Message-ID: <20151105110141.GC16314@hermes.click-hack.org> (raw)
In-Reply-To: <20151105015114.GJ21923@csclub.uwaterloo.ca>
On Wed, Nov 04, 2015 at 08:51:14PM -0500, Lennart Sorensen wrote:
> We are trying to move from gcc 4.6 to gcc 4.9 (as part of moving from
> being Debian wheezy based to jessie based).
>
> This has now brought up an unexpected change in behaviour on arm (powerpc
> is fine). We are getting bus errors with kernel complaints about
> unaligned memory accesses. Now it is certainly true that we are doing
> some unaligned memory accesses, but on armv7 that is supposed to be
> allowed, as long as the memory is marked as "normal memory".
>
> gcc 4.6 and earlier never generated unaligned accesses as far as I
> understand it, while gcc 4.7 and higher do generate unaligned accesses
> by default on armv7 according to the gcc documentation.
>
> Is it expected that the memory in xenomai would not be flagged as normal
> memory (the other options as far as I understand it are device memory
> and strongly ordered memory).
>
> This is with 3.14 kernel and xenomai 2.6.4 with LPAE enabled on a
> Cortex-A15 system.
>
> So same code, same xenomai, same kernel with gcc 4.6 does not see this,
> while with 4.9 it does. I tried building the application with
> -nno-unaligned-accesses, but I didn't rebuild the libraries that way,
> so that might not be enough. Really I think it should work fine, since I
> can't see why the pages would be flagged as something other than normal
> memory (unless DMA pages are somehow getting involved, since some of
> this is dealing with network packets being received).
>
> Any ideas where to investigate?
You need some piece of code, somewhere, to program the processor to
not get the fault. I think Linux historically set the processor to
generate a fault so as to be able to control the behaviour with what
is explained in Documentation/arm/mem_alignment, but there is a way
to avoid the fault on armv7. Maybe a kernel parameter, maybe you
need a more recent version of u-boot.
--
Gilles.
https://click-hack.org
next prev parent reply other threads:[~2015-11-05 11:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-05 1:51 [Xenomai] ARM bus error due to alignment Lennart Sorensen
2015-11-05 11:01 ` Gilles Chanteperdrix [this message]
2015-11-05 14:51 ` Lennart Sorensen
2015-11-05 14:57 ` Lennart Sorensen
2015-11-05 15:02 ` Lennart Sorensen
2015-11-05 15:15 ` Gilles Chanteperdrix
2015-11-05 15:24 ` Lennart Sorensen
2015-11-05 15:55 ` Gilles Chanteperdrix
2015-11-05 16:19 ` Lennart Sorensen
2015-11-05 16:25 ` Gilles Chanteperdrix
2015-11-05 16:57 ` Lennart Sorensen
2015-11-05 17:14 ` Gilles Chanteperdrix
2015-11-05 17:24 ` Lennart Sorensen
2015-11-05 17:52 ` Lennart Sorensen
2015-11-05 21:18 ` Lennart Sorensen
2015-11-05 21:28 ` Lennart Sorensen
2015-11-05 21:40 ` Gilles Chanteperdrix
2015-11-05 22:08 ` Lennart Sorensen
2015-11-06 19:25 ` Lennart Sorensen
2015-11-07 22:13 ` Gilles Chanteperdrix
2015-11-09 19:57 ` Lennart Sorensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151105110141.GC16314@hermes.click-hack.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=lsorense@csclub.uwaterloo.ca \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.