]>
Commit | Line | Data |
---|---|---|
c82b3d8c GKH |
1 | From 252f6e8eae909bc075a1b1e3b9efb095ae4c0b56 Mon Sep 17 00:00:00 2001 |
2 | From: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> | |
3 | Date: Wed, 16 Jan 2019 14:29:50 +0300 | |
4 | Subject: ARCv2: Enable unaligned access in early ASM code | |
5 | ||
6 | From: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> | |
7 | ||
8 | commit 252f6e8eae909bc075a1b1e3b9efb095ae4c0b56 upstream. | |
9 | ||
10 | It is currently done in arc_init_IRQ() which might be too late | |
11 | considering gcc 7.3.1 onwards (GNU 2018.03) generates unaligned | |
12 | memory accesses by default | |
13 | ||
14 | Cc: stable@vger.kernel.org #4.4+ | |
15 | Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> | |
16 | Signed-off-by: Vineet Gupta <vgupta@synopsys.com> | |
17 | [vgupta: rewrote changelog] | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | ||
20 | --- | |
21 | arch/arc/kernel/head.S | 10 ++++++++++ | |
22 | 1 file changed, 10 insertions(+) | |
23 | ||
24 | --- a/arch/arc/kernel/head.S | |
25 | +++ b/arch/arc/kernel/head.S | |
26 | @@ -17,6 +17,7 @@ | |
27 | #include <asm/entry.h> | |
28 | #include <asm/arcregs.h> | |
29 | #include <asm/cache.h> | |
30 | +#include <asm/irqflags.h> | |
31 | ||
32 | .macro CPU_EARLY_SETUP | |
33 | ||
34 | @@ -47,6 +48,15 @@ | |
35 | sr r5, [ARC_REG_DC_CTRL] | |
36 | ||
37 | 1: | |
38 | + | |
39 | +#ifdef CONFIG_ISA_ARCV2 | |
40 | + ; Unaligned access is disabled at reset, so re-enable early as | |
41 | + ; gcc 7.3.1 (ARC GNU 2018.03) onwards generates unaligned access | |
42 | + ; by default | |
43 | + lr r5, [status32] | |
44 | + bset r5, r5, STATUS_AD_BIT | |
45 | + kflag r5 | |
46 | +#endif | |
47 | .endm | |
48 | ||
49 | .section .init.text, "ax",@progbits |