All of lore.kernel.org
 help / color / mirror / Atom feed
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: Sat, 7 Nov 2015 23:13:03 +0100	[thread overview]
Message-ID: <20151107221303.GE1798@hermes.click-hack.org> (raw)
In-Reply-To: <20151106192557.GV21923@csclub.uwaterloo.ca>

On Fri, Nov 06, 2015 at 02:25:57PM -0500, Lennart Sorensen wrote:
> On Thu, Nov 05, 2015 at 05:08:51PM -0500, Lennart Sorensen wrote:
> > On Thu, Nov 05, 2015 at 10:40:42PM +0100, Gilles Chanteperdrix wrote:
> > > On Thu, Nov 05, 2015 at 12:52:25PM -0500, Lennart Sorensen wrote:
> > > > I wish I could figure out why the backtraces aren't working, since they
> > > > are such a nice debug feature to have.
> > > 
> > > You can try disabling unwinding, this should enable frame pointers
> > > and maybe make the backtraces more reliable.
> > 
> > I can try that.  I always thought unwinding was part of making backtraces
> > work.  Not sure why I thought so.
> 
> So I removed H_DMA from the alloc cal and the alignment problem went away.
> Never actually did need the DMA flag in the case anyhow so it shouldn't
> have been there in the first place.
>  Now while poking at it, I did find
> that using H_NONCACHED instead causes a NULL pointer crash in the kernel,
> which seems like a bug (how can user space making a system call cause
> a NULL pointer dereference in the kernel unless there is a bug?).
> With 0 for the flags, it just works.


Well, mapping the same piece of RAM with cacheable and non-cacheable
mappings on ARM is "undefined behaviour" territory. If you want to
map some RAM with H_NONCACHED, you should reserve it with something
like the CMA allocator so that the kernel does not map it in any
other way. That is one possible reason.

H_NONCACHED is routinely used on armv4/armv5 (actually, I mixed
H_DMA with H_NONCACHED, Xenomai core never sets H_DMA, it sets
H_NONCACHED for shared user/kernel mappings for armv4/armv5, because
this is required with these architectures). So, it works. However,
that maybe an issue with LPAE, that would be a second possible reason.

-- 
					    Gilles.
https://click-hack.org


  reply	other threads:[~2015-11-07 22:13 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
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 [this message]
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=20151107221303.GE1798@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.