All of lore.kernel.org
 help / color / mirror / Atom feed
From: guohanjun@huawei.com (Hanjun Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: opcodes.h: Add arm big-endian config options before including arm header
Date: Fri, 25 Mar 2016 15:06:35 +0800	[thread overview]
Message-ID: <56F4E37B.5090302@huawei.com> (raw)
In-Reply-To: <1458838474-8625-1-git-send-email-james.morse@arm.com>

On 2016/3/25 0:54, James Morse wrote:
> arm and arm64 use different config options to specify big endian. This
> needs taking into account when including code/headers between the two
> architectures.
>
> A case in point is PAN, which uses the __instr_arm() macro to output
> instructions. The macro comes from opcodes.h, which lives under arch/arm.
> On a big-endian build the mismatched config options mean the instruction
> isn't byte swapped correctly, resulting in undefined instruction exceptions
> during boot:
>> alternatives: patching kernel code
>> kdevtmpfs[87]: undefined instruction: pc=ffffffc0004505b4
>> kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c
>> kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c
>> kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c
>> kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c
>> kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c
>> kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c
>> kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c
>> kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c
>> kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c
>> Internal error: Oops - undefined instruction: 0 [#1] SMP
>> Modules linked in:
>> CPU: 0 PID: 87 Comm: kdevtmpfs Not tainted 4.1.16+ #5
>> Hardware name: Hisilicon PhosphorHi1382 EVB (DT)
>> task: ffffffc336591700 ti: ffffffc3365a4000 task.ti: ffffffc3365a4000
>> PC is at dump_instr+0x68/0x100
>> LR is at do_undefinstr+0x1d4/0x2a4
>> pc : [<ffffffc00076231c>] lr : [<ffffffc0000811d4>] pstate: 604001c5
>> sp : ffffffc3365a6450
> Reported-by: Hanjun Guo <guohanjun@huawei.com>

My colleague Xuefeng helped to test this patch, and the bug
reported is gone,

Tested-by: Xuefeng Wang <wxf.wang@hisilicon.com>

Thanks
Hanjun

      reply	other threads:[~2016-03-25  7:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24 16:54 [PATCH] arm64: opcodes.h: Add arm big-endian config options before including arm header James Morse
2016-03-25  7:06 ` Hanjun Guo [this message]

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=56F4E37B.5090302@huawei.com \
    --to=guohanjun@huawei.com \
    --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 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.