diff options
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 16 | ||||
-rw-r--r-- | arch/arm/kernel/kprobes-decode.c | 5 | ||||
-rw-r--r-- | arch/arm/kernel/perf_event.c | 2 | ||||
-rw-r--r-- | arch/arm/kernel/process.c | 23 |
4 files changed, 24 insertions, 22 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index a6cfb1791af..e864e482118 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -163,8 +163,6 @@ ENDPROC(__und_invalid) | |||
163 | @ r4 - orig_r0 (see pt_regs definition in ptrace.h) | 163 | @ r4 - orig_r0 (see pt_regs definition in ptrace.h) |
164 | @ | 164 | @ |
165 | stmia r5, {r0 - r4} | 165 | stmia r5, {r0 - r4} |
166 | |||
167 | asm_trace_hardirqs_off | ||
168 | .endm | 166 | .endm |
169 | 167 | ||
170 | .align 5 | 168 | .align 5 |
@@ -205,7 +203,7 @@ __dabt_svc: | |||
205 | @ | 203 | @ |
206 | @ IRQs off again before pulling preserved data off the stack | 204 | @ IRQs off again before pulling preserved data off the stack |
207 | @ | 205 | @ |
208 | disable_irq | 206 | disable_irq_notrace |
209 | 207 | ||
210 | @ | 208 | @ |
211 | @ restore SPSR and restart the instruction | 209 | @ restore SPSR and restart the instruction |
@@ -219,6 +217,9 @@ ENDPROC(__dabt_svc) | |||
219 | __irq_svc: | 217 | __irq_svc: |
220 | svc_entry | 218 | svc_entry |
221 | 219 | ||
220 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
221 | bl trace_hardirqs_off | ||
222 | #endif | ||
222 | #ifdef CONFIG_PREEMPT | 223 | #ifdef CONFIG_PREEMPT |
223 | get_thread_info tsk | 224 | get_thread_info tsk |
224 | ldr r8, [tsk, #TI_PREEMPT] @ get preempt count | 225 | ldr r8, [tsk, #TI_PREEMPT] @ get preempt count |
@@ -292,7 +293,7 @@ __und_svc: | |||
292 | @ | 293 | @ |
293 | @ IRQs off again before pulling preserved data off the stack | 294 | @ IRQs off again before pulling preserved data off the stack |
294 | @ | 295 | @ |
295 | 1: disable_irq | 296 | 1: disable_irq_notrace |
296 | 297 | ||
297 | @ | 298 | @ |
298 | @ restore SPSR and restart the instruction | 299 | @ restore SPSR and restart the instruction |
@@ -328,7 +329,7 @@ __pabt_svc: | |||
328 | @ | 329 | @ |
329 | @ IRQs off again before pulling preserved data off the stack | 330 | @ IRQs off again before pulling preserved data off the stack |
330 | @ | 331 | @ |
331 | disable_irq | 332 | disable_irq_notrace |
332 | 333 | ||
333 | @ | 334 | @ |
334 | @ restore SPSR and restart the instruction | 335 | @ restore SPSR and restart the instruction |
@@ -394,8 +395,6 @@ ENDPROC(__pabt_svc) | |||
394 | @ Clear FP to mark the first stack frame | 395 | @ Clear FP to mark the first stack frame |
395 | @ | 396 | @ |
396 | zero_fp | 397 | zero_fp |
397 | |||
398 | asm_trace_hardirqs_off | ||
399 | .endm | 398 | .endm |
400 | 399 | ||
401 | .macro kuser_cmpxchg_check | 400 | .macro kuser_cmpxchg_check |
@@ -466,9 +465,6 @@ __irq_usr: | |||
466 | THUMB( movne r0, #0 ) | 465 | THUMB( movne r0, #0 ) |
467 | THUMB( strne r0, [r0] ) | 466 | THUMB( strne r0, [r0] ) |
468 | #endif | 467 | #endif |
469 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
470 | bl trace_hardirqs_on | ||
471 | #endif | ||
472 | 468 | ||
473 | mov why, #0 | 469 | mov why, #0 |
474 | b ret_to_user | 470 | b ret_to_user |
diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c index da1f94906a4..8bccbfa693f 100644 --- a/arch/arm/kernel/kprobes-decode.c +++ b/arch/arm/kernel/kprobes-decode.c | |||
@@ -583,13 +583,14 @@ static void __kprobes emulate_ldr(struct kprobe *p, struct pt_regs *regs) | |||
583 | { | 583 | { |
584 | insn_llret_3arg_fn_t *i_fn = (insn_llret_3arg_fn_t *)&p->ainsn.insn[0]; | 584 | insn_llret_3arg_fn_t *i_fn = (insn_llret_3arg_fn_t *)&p->ainsn.insn[0]; |
585 | kprobe_opcode_t insn = p->opcode; | 585 | kprobe_opcode_t insn = p->opcode; |
586 | long ppc = (long)p->addr + 8; | ||
586 | union reg_pair fnr; | 587 | union reg_pair fnr; |
587 | int rd = (insn >> 12) & 0xf; | 588 | int rd = (insn >> 12) & 0xf; |
588 | int rn = (insn >> 16) & 0xf; | 589 | int rn = (insn >> 16) & 0xf; |
589 | int rm = insn & 0xf; | 590 | int rm = insn & 0xf; |
590 | long rdv; | 591 | long rdv; |
591 | long rnv = regs->uregs[rn]; | 592 | long rnv = (rn == 15) ? ppc : regs->uregs[rn]; |
592 | long rmv = regs->uregs[rm]; /* rm/rmv may be invalid, don't care. */ | 593 | long rmv = (rm == 15) ? ppc : regs->uregs[rm]; |
593 | long cpsr = regs->ARM_cpsr; | 594 | long cpsr = regs->ARM_cpsr; |
594 | 595 | ||
595 | fnr.dr = insnslot_llret_3arg_rflags(rnv, 0, rmv, cpsr, i_fn); | 596 | fnr.dr = insnslot_llret_3arg_rflags(rnv, 0, rmv, cpsr, i_fn); |
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index c45768614c8..de12536d687 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -201,7 +201,7 @@ armpmu_event_update(struct perf_event *event, | |||
201 | { | 201 | { |
202 | int shift = 64 - 32; | 202 | int shift = 64 - 32; |
203 | s64 prev_raw_count, new_raw_count; | 203 | s64 prev_raw_count, new_raw_count; |
204 | s64 delta; | 204 | u64 delta; |
205 | 205 | ||
206 | again: | 206 | again: |
207 | prev_raw_count = atomic64_read(&hwc->prev_count); | 207 | prev_raw_count = atomic64_read(&hwc->prev_count); |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index acf5e6fdb6d..a4a9cc88bec 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -351,17 +351,21 @@ EXPORT_SYMBOL(dump_fpu); | |||
351 | 351 | ||
352 | /* | 352 | /* |
353 | * Shuffle the argument into the correct register before calling the | 353 | * Shuffle the argument into the correct register before calling the |
354 | * thread function. r1 is the thread argument, r2 is the pointer to | 354 | * thread function. r4 is the thread argument, r5 is the pointer to |
355 | * the thread function, and r3 points to the exit function. | 355 | * the thread function, and r6 points to the exit function. |
356 | */ | 356 | */ |
357 | extern void kernel_thread_helper(void); | 357 | extern void kernel_thread_helper(void); |
358 | asm( ".pushsection .text\n" | 358 | asm( ".pushsection .text\n" |
359 | " .align\n" | 359 | " .align\n" |
360 | " .type kernel_thread_helper, #function\n" | 360 | " .type kernel_thread_helper, #function\n" |
361 | "kernel_thread_helper:\n" | 361 | "kernel_thread_helper:\n" |
362 | " mov r0, r1\n" | 362 | #ifdef CONFIG_TRACE_IRQFLAGS |
363 | " mov lr, r3\n" | 363 | " bl trace_hardirqs_on\n" |
364 | " mov pc, r2\n" | 364 | #endif |
365 | " msr cpsr_c, r7\n" | ||
366 | " mov r0, r4\n" | ||
367 | " mov lr, r6\n" | ||
368 | " mov pc, r5\n" | ||
365 | " .size kernel_thread_helper, . - kernel_thread_helper\n" | 369 | " .size kernel_thread_helper, . - kernel_thread_helper\n" |
366 | " .popsection"); | 370 | " .popsection"); |
367 | 371 | ||
@@ -391,11 +395,12 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | |||
391 | 395 | ||
392 | memset(®s, 0, sizeof(regs)); | 396 | memset(®s, 0, sizeof(regs)); |
393 | 397 | ||
394 | regs.ARM_r1 = (unsigned long)arg; | 398 | regs.ARM_r4 = (unsigned long)arg; |
395 | regs.ARM_r2 = (unsigned long)fn; | 399 | regs.ARM_r5 = (unsigned long)fn; |
396 | regs.ARM_r3 = (unsigned long)kernel_thread_exit; | 400 | regs.ARM_r6 = (unsigned long)kernel_thread_exit; |
401 | regs.ARM_r7 = SVC_MODE | PSR_ENDSTATE | PSR_ISETSTATE; | ||
397 | regs.ARM_pc = (unsigned long)kernel_thread_helper; | 402 | regs.ARM_pc = (unsigned long)kernel_thread_helper; |
398 | regs.ARM_cpsr = SVC_MODE | PSR_ENDSTATE | PSR_ISETSTATE; | 403 | regs.ARM_cpsr = regs.ARM_r7 | PSR_I_BIT; |
399 | 404 | ||
400 | return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); | 405 | return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); |
401 | } | 406 | } |