Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1381208

[PATCH 4.5 020/124] arm64: opcodes.h: Add arm big-endian config options before including arm header

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.5 020/124] arm64: opcodes.h: Add arm big-endian config options before including arm header
Date 2016-04-18 05:50 +0200
Message-ID <rp8me-7cT-15@gated-at.bofh.it> (permalink)
References <rp7gt-6ho-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.5-stable review patch.  If anyone has any objections, please let me know.

------------------

From: James Morse <james.morse@arm.com>

commit a6002ec5a8c68e69706b2efd6db6d682d0ab672c upstream.

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>
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm64/include/asm/opcodes.h |    4 ++++
 1 file changed, 4 insertions(+)

--- a/arch/arm64/include/asm/opcodes.h
+++ b/arch/arm64/include/asm/opcodes.h
@@ -1 +1,5 @@
+#ifdef CONFIG_CPU_BIG_ENDIAN
+#define CONFIG_CPU_ENDIAN_BE8 CONFIG_CPU_BIG_ENDIAN
+#endif
+
 #include <../../arm/include/asm/opcodes.h>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.5 000/124] 4.5.2-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:40 +0200
  [PATCH 4.5 045/124] mlx4: add missing braces in verify_qp_parameters Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:40 +0200
  [PATCH 4.5 007/124] parisc: Unbreak handling exceptions from kernel modules Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:40 +0200
  [PATCH 4.5 047/124] ath9k: fix buffer overrun for ar9287 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:40 +0200
  [PATCH 4.5 024/124] drm/radeon: add another R7 370 quirk Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:40 +0200
  [PATCH 4.5 043/124] ipv4: Dont do expensive useless work during inetdev destroy. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:40 +0200
  [PATCH 4.5 041/124] rocker: set FDB cleanup timer according to lowest ageing time Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:40 +0200
  [PATCH 4.5 054/124] ipv4: fix broadcast packets reception Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:40 +0200
  [PATCH 4.5 052/124] net: bcmgenet: fix dma api length mismatch Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:40 +0200
  [PATCH 4.5 035/124] sh_eth: fix NULL pointer dereference in sh_eth_ring_format() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:40 +0200
  [PATCH 4.5 011/124] ALSA: hda - Apply fix for white noise on Asus N550JV, too Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:50 +0200
  [PATCH 4.5 013/124] mm: fix invalid node in alloc_migrate_target() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:50 +0200
  [PATCH 4.5 020/124] arm64: opcodes.h: Add arm big-endian config options before including arm header Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:50 +0200
  [PATCH 4.5 010/124] ALSA: hda - Fix white noise on Asus N750JV headphone Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:50 +0200
  [PATCH 4.5 015/124] s390/mm: handle PTE-mapped tail pages in fast gup Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:50 +0200
  [PATCH 4.5 018/124] powerpc/process: Fix altivec SPR not being saved Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:50 +0200
  [PATCH 4.5 003/124] parisc: Fix SIGSYS signals in compat case Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:50 +0200
  [PATCH 4.5 006/124] parisc: Fix kernel crash with reversed copy_from_user() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:50 +0200
  [PATCH 4.5 019/124] compiler-gcc: disable -ftracer for __noclone functions Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:50 +0200
  [PATCH 4.5 016/124] libnvdimm: fix smart data retrieval Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-18 05:50 +0200
  Re: [PATCH 4.5 000/124] 4.5.2-stable review Guenter Roeck <linux@roeck-us.net> - 2016-04-18 18:40 +0200
    Re: [PATCH 4.5 000/124] 4.5.2-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-19 08:00 +0200
  Re: [PATCH 4.5 000/124] 4.5.2-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-04-18 18:40 +0200
    Re: [PATCH 4.5 000/124] 4.5.2-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-19 08:00 +0200
  Re: [PATCH 4.5 000/124] 4.5.2-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-19 08:00 +0200

csiph-web