From: slash.tmp@free.fr (Mason)
To: linux-arm-kernel@lists.infradead.org
Subject: l2c: Kernel panic in l2c310_enable() in non-secure mode
Date: Wed, 14 Oct 2015 21:34:30 +0200 [thread overview]
Message-ID: <561EAE46.4080901@free.fr> (raw)
In-Reply-To: <20151014174503.GQ32532@n2100.arm.linux.org.uk>
On 14/10/2015 19:45, Russell King - ARM Linux wrote:
> On Wed, Oct 14, 2015 at 04:17:43PM +0200, Marc Gonzalez wrote:
>
>> Internal error: Oops - undefined instruction: 0 [#1] PREEMPT SMP ARM
>>
>> On my platform, Linux v4.2 running in non-secure mode panics in
>> l2c310_enable() with the pc pointing at this instruction:
>>
>> c03390cc: ee013f30 mcr 15, 0, r3, cr1, cr0, {1}
>>
>> which corresponds to set_auxcr IIUC.
> ...
>> According to the Cortex A9 documentation,
>> ACTLR is RO in non-secure mode if NSACR[18]=0 and RW if NSACR[18]=1
>>
>> I suppose writing to a RO register cause the exception I see?
>
> It should not, the write should be ignored and no exception should be
> raised.
Interesting.
>> Commit 8abd259f657d5 ("l2c: provide generic hook to intercept
>> writes to secure registers") introduced a mechanism for non-secure
>> platforms to define how to write to the L2CC AUXCTRL register.
>
> Wrong register. This is the _CPU_ auxiliary control register, not the
> L2CC auxiliary control register.
Right.
>> Is there a similar mechanism for asking the firmware to write
>> to the CP15 ACTRL?
>
> That's entirely dependent on the secure monitor implementation. ARM Ltd
> didn't listen to me originally when I said there needs to be a spec for
> that, so there's no standardised way to talk to it, sorry.
My question was ambiguous. I didn't mean to ask how to interact
with the firmware, but rather if there existed some way to prevent
Linux from just writing the CP15 ACTRL, and instead go through
a platform-specific function (as you provided for L2CC AUXCTRL).
> Now, you've quoted one line from the oops, and a load of information that
> we already know (because we have access to the manuals). You've omitted
> the rest of the oops, which is information we don't know, and is information
> that we, as kernel developers, have decided that the kernel should print
> to allow _us_, on the receiving end of an oops, to be able to diagnose
> what happened and why.
>
> Please, if you get an oops, include the _full_ dump when reporting
> problems, even if you've diagnosed it already. Not only does it help to
> confirm the diagnosis, but it also serves as a source of documentation
> if/when we commit a change to solve it.
I didn't provide the full oops because I don't know how to enable
early_printk on my platform. My ad-hoc method is attaching a debugger,
stop in panic() and examine the __log_buf array.
Can I just dump the relevant part of the unformatted log?
Regards.
next prev parent reply other threads:[~2015-10-14 19:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 14:17 l2c: Kernel panic in l2c310_enable() in non-secure mode Marc Gonzalez
2015-10-14 14:47 ` Marc Gonzalez
2015-10-14 17:06 ` Rob Herring
2015-10-15 8:56 ` Marc Gonzalez
2015-10-15 9:09 ` Russell King - ARM Linux
2015-10-14 17:47 ` Russell King - ARM Linux
2015-10-14 20:28 ` Mason
2015-10-15 10:00 ` Marc Gonzalez
2015-10-15 11:07 ` Marc Gonzalez
2015-10-16 9:51 ` Mason
2015-10-14 17:45 ` Russell King - ARM Linux
2015-10-14 19:34 ` Mason [this message]
2015-10-14 20:19 ` Peter Maydell
2015-10-14 21:08 ` Russell King - ARM Linux
2015-10-15 8:27 ` Marc Gonzalez
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=561EAE46.4080901@free.fr \
--to=slash.tmp@free.fr \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).