linux/arch/arm64
James Morse a6002ec5a8 arm64: opcodes.h: Add arm big-endian config options before including arm header
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

Cc: <stable@vger.kernel.org> #4.3.x-
Reported-by: Hanjun Guo <guohanjun@huawei.com>
Tested-by: Xuefeng Wang <wxf.wang@hisilicon.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2016-03-29 16:04:57 +01:00
..
boot ARM: DT changes, part 2 2016-03-24 19:01:38 -07:00
configs Samsung Exynos ARM64 improvements for v4.6: 2016-03-12 17:13:34 -08:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-03-17 11:22:54 -07:00
include arm64: opcodes.h: Add arm big-endian config options before including arm header 2016-03-29 16:04:57 +01:00
kernel arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections 2016-03-25 16:37:42 -07:00
kvm kvm: arm64: Disable compiler instrumentation for hypervisor code 2016-03-21 14:02:17 +01:00
lib arm64 updates for 4.6: 2016-03-17 20:03:47 -07:00
mm 2nd set of arm64 updates for 4.6: 2016-03-24 19:13:59 -07:00
net arm64: bpf: add extra pass to handle faulty codegen 2016-01-17 19:15:26 -05:00
xen xen/arm: introduce HYPERVISOR_platform_op on arm and arm64 2015-12-21 14:40:56 +00:00
Kconfig arm64 updates for 4.6: 2016-03-17 20:03:47 -07:00
Kconfig.debug arm64: enable CONFIG_DEBUG_RODATA by default 2016-03-03 18:14:17 +00:00
Kconfig.platforms Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-24 10:29:44 -07:00
Makefile arm64 updates for 4.6: 2016-03-17 20:03:47 -07:00