Skip to content

Commit 8fac2f9

Browse files
committed
Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King: "Low priority fixes and updates for ARM: - add some missing includes - efficiency improvements in system call entry code when tracing is enabled - ensure ARMv6+ is always built as EABI - export save_stack_trace_tsk() - fix fatal signal handling during mm fault - build translation table base address register from scratch - appropriately align the .data section to a word boundary where we rely on that data being word aligned" * 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 8691/1: Export save_stack_trace_tsk() ARM: 8692/1: mm: abort uaccess retries upon fatal signal ARM: 8690/1: lpae: build TTB control register value from scratch in v7_ttb_setup ARM: align .data section ARM: always enable AEABI for ARMv6+ ARM: avoid saving and restoring registers unnecessarily ARM: move PC value into r9 ARM: obtain thread info structure later ARM: use aliases for registers in entry-common ARM: 8689/1: scu: add missing errno include ARM: 8688/1: pm: add missing types include
2 parents 260d165 + e558bdc commit 8fac2f9

File tree

20 files changed

+59
-19
lines changed

20 files changed

+59
-19
lines changed

arch/arm/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,6 @@ config THUMB2_KERNEL
15311531
bool "Compile the kernel in Thumb-2 mode" if !CPU_THUMBONLY
15321532
depends on (CPU_V7 || CPU_V7M) && !CPU_V6 && !CPU_V6K
15331533
default y if CPU_THUMBONLY
1534-
select AEABI
15351534
select ARM_ASM_UNIFIED
15361535
select ARM_UNWIND
15371536
help
@@ -1594,7 +1593,8 @@ config ARM_PATCH_IDIV
15941593
code to do integer division.
15951594

15961595
config AEABI
1597-
bool "Use the ARM EABI to compile the kernel"
1596+
bool "Use the ARM EABI to compile the kernel" if !CPU_V7 && !CPU_V7M && !CPU_V6 && !CPU_V6K
1597+
default CPU_V7 || CPU_V7M || CPU_V6 || CPU_V6K
15981598
help
15991599
This option allows for the kernel to be compiled using the latest
16001600
ARM ABI (aka EABI). This is only useful if you are using a user

arch/arm/include/asm/smp_scu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#ifndef __ASSEMBLER__
99

10+
#include <linux/errno.h>
1011
#include <asm/cputype.h>
1112

1213
static inline bool scu_a9_has_base(void)

arch/arm/include/asm/suspend.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef __ASM_ARM_SUSPEND_H
22
#define __ASM_ARM_SUSPEND_H
33

4+
#include <linux/types.h>
5+
46
struct sleep_save_sp {
57
u32 *save_ptr_stash;
68
u32 save_ptr_stash_phys;

arch/arm/include/debug/omap2plus.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#define UART_OFFSET(addr) ((addr) & 0x00ffffff)
2323

2424
.pushsection .data
25+
.align 2
2526
omap_uart_phys: .word 0
2627
omap_uart_virt: .word 0
2728
omap_uart_lsr: .word 0

arch/arm/kernel/entry-armv.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@ do_fpe:
721721
*/
722722

723723
.pushsection .data
724+
.align 2
724725
ENTRY(fp_enter)
725726
.word no_fp
726727
.popsection
@@ -1224,6 +1225,7 @@ vector_addrexcptn:
12241225
W(b) vector_fiq
12251226

12261227
.data
1228+
.align 2
12271229

12281230
.globl cr_alignment
12291231
cr_alignment:

arch/arm/kernel/entry-common.S

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727

2828
#include "entry-header.S"
2929

30+
saved_psr .req r8
31+
#if defined(CONFIG_TRACE_IRQFLAGS) || defined(CONFIG_CONTEXT_TRACKING)
32+
saved_pc .req r9
33+
#define TRACE(x...) x
34+
#else
35+
saved_pc .req lr
36+
#define TRACE(x...)
37+
#endif
3038

3139
.align 5
3240
#if !(IS_ENABLED(CONFIG_TRACE_IRQFLAGS) || IS_ENABLED(CONFIG_CONTEXT_TRACKING))
@@ -146,16 +154,17 @@ ENTRY(vector_swi)
146154
ARM( stmdb r8, {sp, lr}^ ) @ Calling sp, lr
147155
THUMB( mov r8, sp )
148156
THUMB( store_user_sp_lr r8, r10, S_SP ) @ calling sp, lr
149-
mrs r8, spsr @ called from non-FIQ mode, so ok.
150-
str lr, [sp, #S_PC] @ Save calling PC
151-
str r8, [sp, #S_PSR] @ Save CPSR
157+
mrs saved_psr, spsr @ called from non-FIQ mode, so ok.
158+
TRACE( mov saved_pc, lr )
159+
str saved_pc, [sp, #S_PC] @ Save calling PC
160+
str saved_psr, [sp, #S_PSR] @ Save CPSR
152161
str r0, [sp, #S_OLD_R0] @ Save OLD_R0
153162
#endif
154163
zero_fp
155164
alignment_trap r10, ip, __cr_alignment
156-
enable_irq
157-
ct_user_exit
158-
get_thread_info tsk
165+
asm_trace_hardirqs_on save=0
166+
enable_irq_notrace
167+
ct_user_exit save=0
159168

160169
/*
161170
* Get the system call number.
@@ -168,11 +177,11 @@ ENTRY(vector_swi)
168177
* value to determine if it is an EABI or an old ABI call.
169178
*/
170179
#ifdef CONFIG_ARM_THUMB
171-
tst r8, #PSR_T_BIT
180+
tst saved_psr, #PSR_T_BIT
172181
movne r10, #0 @ no thumb OABI emulation
173-
USER( ldreq r10, [lr, #-4] ) @ get SWI instruction
182+
USER( ldreq r10, [saved_pc, #-4] ) @ get SWI instruction
174183
#else
175-
USER( ldr r10, [lr, #-4] ) @ get SWI instruction
184+
USER( ldr r10, [saved_pc, #-4] ) @ get SWI instruction
176185
#endif
177186
ARM_BE8(rev r10, r10) @ little endian instruction
178187

@@ -183,15 +192,17 @@ ENTRY(vector_swi)
183192
*/
184193
#elif defined(CONFIG_ARM_THUMB)
185194
/* Legacy ABI only, possibly thumb mode. */
186-
tst r8, #PSR_T_BIT @ this is SPSR from save_user_regs
195+
tst saved_psr, #PSR_T_BIT @ this is SPSR from save_user_regs
187196
addne scno, r7, #__NR_SYSCALL_BASE @ put OS number in
188-
USER( ldreq scno, [lr, #-4] )
197+
USER( ldreq scno, [saved_pc, #-4] )
189198

190199
#else
191200
/* Legacy ABI only. */
192-
USER( ldr scno, [lr, #-4] ) @ get SWI instruction
201+
USER( ldr scno, [saved_pc, #-4] ) @ get SWI instruction
193202
#endif
194203

204+
/* saved_psr and saved_pc are now dead */
205+
195206
uaccess_disable tbl
196207

197208
adr tbl, sys_call_table @ load syscall table pointer
@@ -210,6 +221,12 @@ ENTRY(vector_swi)
210221
bic scno, scno, #0xff000000 @ mask off SWI op-code
211222
eor scno, scno, #__NR_SYSCALL_BASE @ check OS number
212223
#endif
224+
get_thread_info tsk
225+
/*
226+
* Reload the registers that may have been corrupted on entry to
227+
* the syscall assembly (by tracing or context tracking.)
228+
*/
229+
TRACE( ldmia sp, {r0 - r3} )
213230

214231
local_restart:
215232
ldr r10, [tsk, #TI_FLAGS] @ check for syscall tracing
@@ -239,8 +256,9 @@ local_restart:
239256
* current task.
240257
*/
241258
9001:
242-
sub lr, lr, #4
259+
sub lr, saved_pc, #4
243260
str lr, [sp, #S_PC]
261+
get_thread_info tsk
244262
b ret_fast_syscall
245263
#endif
246264
ENDPROC(vector_swi)

arch/arm/kernel/head.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ ENDPROC(__fixup_smp)
556556
.word __smpalt_end
557557

558558
.pushsection .data
559+
.align 2
559560
.globl smp_on_up
560561
smp_on_up:
561562
ALT_SMP(.long 1)
@@ -716,6 +717,7 @@ ENTRY(fixup_pv_table)
716717
ENDPROC(fixup_pv_table)
717718

718719
.data
720+
.align 2
719721
.globl __pv_phys_pfn_offset
720722
.type __pv_phys_pfn_offset, %object
721723
__pv_phys_pfn_offset:

arch/arm/kernel/hyp-stub.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* zeroing of .bss would clobber it.
3232
*/
3333
.data
34+
.align 2
3435
ENTRY(__boot_cpu_mode)
3536
.long 0
3637
.text

arch/arm/kernel/iwmmxt.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ ENTRY(iwmmxt_task_release)
367367
ENDPROC(iwmmxt_task_release)
368368

369369
.data
370+
.align 2
370371
concan_owner:
371372
.word 0
372373

arch/arm/kernel/sleep.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ mpidr_hash_ptr:
171171
.long mpidr_hash - . @ mpidr_hash struct offset
172172

173173
.data
174+
.align 2
174175
.type sleep_save_sp, #object
175176
ENTRY(sleep_save_sp)
176177
.space SLEEP_SAVE_SP_SZ @ struct sleep_save_sp

0 commit comments

Comments
 (0)