Skip to content

Commit bab9147

Browse files
committed
Merge remote-tracking branch 'stable/linux-3.12.y' into rpi-3.12.y
2 parents c256eb9 + b45ddfa commit bab9147

152 files changed

Lines changed: 1726 additions & 732 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 3
22
PATCHLEVEL = 12
3-
SUBLEVEL = 28
3+
SUBLEVEL = 29
44
EXTRAVERSION =
55
NAME = One Giant Leap for Frogkind
66

‎arch/arm64/kernel/process.c‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,27 @@ void exit_thread(void)
183183
{
184184
}
185185

186+
static void tls_thread_flush(void)
187+
{
188+
asm ("msr tpidr_el0, xzr");
189+
190+
if (is_compat_task()) {
191+
current->thread.tp_value = 0;
192+
193+
/*
194+
* We need to ensure ordering between the shadow state and the
195+
* hardware state, so that we don't corrupt the hardware state
196+
* with a stale shadow state during context switch.
197+
*/
198+
barrier();
199+
asm ("msr tpidrro_el0, xzr");
200+
}
201+
}
202+
186203
void flush_thread(void)
187204
{
188205
fpsimd_flush_thread();
206+
tls_thread_flush();
189207
flush_ptrace_hw_breakpoint(current);
190208
}
191209

‎arch/arm64/kernel/sys_compat.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ long compat_arm_syscall(struct pt_regs *regs)
7979

8080
case __ARM_NR_compat_set_tls:
8181
current->thread.tp_value = regs->regs[0];
82+
83+
/*
84+
* Protect against register corruption from context switch.
85+
* See comment in tls_thread_flush.
86+
*/
87+
barrier();
8288
asm ("msr tpidrro_el0, %0" : : "r" (regs->regs[0]));
8389
return 0;
8490

‎arch/mips/cavium-octeon/setup.c‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,18 +458,26 @@ static void octeon_halt(void)
458458
octeon_kill_core(NULL);
459459
}
460460

461+
static char __read_mostly octeon_system_type[80];
462+
463+
static int __init init_octeon_system_type(void)
464+
{
465+
snprintf(octeon_system_type, sizeof(octeon_system_type), "%s (%s)",
466+
cvmx_board_type_to_string(octeon_bootinfo->board_type),
467+
octeon_model_get_string(read_c0_prid()));
468+
469+
return 0;
470+
}
471+
early_initcall(init_octeon_system_type);
472+
461473
/**
462474
* Return a string representing the system type
463475
*
464476
* Returns
465477
*/
466478
const char *octeon_board_type_string(void)
467479
{
468-
static char name[80];
469-
sprintf(name, "%s (%s)",
470-
cvmx_board_type_to_string(octeon_bootinfo->board_type),
471-
octeon_model_get_string(read_c0_prid()));
472-
return name;
480+
return octeon_system_type;
473481
}
474482

475483
const char *get_system_type(void)

‎arch/mips/kernel/irq-gic.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,13 @@ static void __init gic_setup_intr(unsigned int intr, unsigned int cpu,
255255

256256
/* Setup Intr to Pin mapping */
257257
if (pin & GIC_MAP_TO_NMI_MSK) {
258+
int i;
259+
258260
GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_MAP_TO_PIN(intr)), pin);
259261
/* FIXME: hack to route NMI to all cpu's */
260-
for (cpu = 0; cpu < NR_CPUS; cpu += 32) {
262+
for (i = 0; i < NR_CPUS; i += 32) {
261263
GICWRITE(GIC_REG_ADDR(SHARED,
262-
GIC_SH_MAP_TO_VPE_REG_OFF(intr, cpu)),
264+
GIC_SH_MAP_TO_VPE_REG_OFF(intr, i)),
263265
0xffffffff);
264266
}
265267
} else {

‎arch/mips/kernel/ptrace.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ int ptrace_setfpregs(struct task_struct *child, __u32 __user *data)
162162
__get_user(fregs[i], i + (__u64 __user *) data);
163163

164164
__get_user(child->thread.fpu.fcr31, data + 64);
165+
child->thread.fpu.fcr31 &= ~FPU_CSR_ALL_X;
165166

166167
/* FIR may not be written. */
167168

@@ -452,7 +453,7 @@ long arch_ptrace(struct task_struct *child, long request,
452453
break;
453454
#endif
454455
case FPC_CSR:
455-
child->thread.fpu.fcr31 = data;
456+
child->thread.fpu.fcr31 = data & ~FPU_CSR_ALL_X;
456457
break;
457458
case DSP_BASE ... DSP_BASE + 5: {
458459
dspreg_t *dregs;

‎arch/mips/kernel/unaligned.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,6 @@ static void emulate_load_store_insn(struct pt_regs *regs,
605605
case sdc1_op:
606606
die_if_kernel("Unaligned FP access in kernel code", regs);
607607
BUG_ON(!used_math());
608-
BUG_ON(!is_fpu_owner());
609608

610609
lose_fpu(1); /* Save FPU state for the emulator. */
611610
res = fpu_emulator_cop1Handler(regs, &current->thread.fpu, 1,

‎arch/mips/mm/tlbex.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,7 @@ static void build_r4000_tlb_refill_handler(void)
13331333
}
13341334
#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
13351335
uasm_l_tlb_huge_update(&l, p);
1336+
UASM_i_LW(&p, K0, 0, K1);
13361337
build_huge_update_entries(&p, htlb_info.huge_pte, K1);
13371338
build_huge_tlb_write_entry(&p, &l, &r, K0, tlb_random,
13381339
htlb_info.restore_scratch);

‎arch/openrisc/kernel/entry.S‎

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -853,37 +853,44 @@ UNHANDLED_EXCEPTION(_vector_0x1f00,0x1f00)
853853

854854
/* ========================================================[ return ] === */
855855

856+
_resume_userspace:
857+
DISABLE_INTERRUPTS(r3,r4)
858+
l.lwz r4,TI_FLAGS(r10)
859+
l.andi r13,r4,_TIF_WORK_MASK
860+
l.sfeqi r13,0
861+
l.bf _restore_all
862+
l.nop
863+
856864
_work_pending:
857-
/*
858-
* if (current_thread_info->flags & _TIF_NEED_RESCHED)
859-
* schedule();
860-
*/
861-
l.lwz r5,TI_FLAGS(r10)
862-
l.andi r3,r5,_TIF_NEED_RESCHED
863-
l.sfnei r3,0
864-
l.bnf _work_notifysig
865+
l.lwz r5,PT_ORIG_GPR11(r1)
866+
l.sfltsi r5,0
867+
l.bnf 1f
865868
l.nop
866-
l.jal schedule
869+
l.andi r5,r5,0
870+
1:
871+
l.jal do_work_pending
872+
l.ori r3,r1,0 /* pt_regs */
873+
874+
l.sfeqi r11,0
875+
l.bf _restore_all
867876
l.nop
868-
l.j _resume_userspace
877+
l.sfltsi r11,0
878+
l.bnf 1f
869879
l.nop
870-
871-
/* Handle pending signals and notify-resume requests.
872-
* do_notify_resume must be passed the latest pushed pt_regs, not
873-
* necessarily the "userspace" ones. Also, pt_regs->syscallno
874-
* must be set so that the syscall restart functionality works.
875-
*/
876-
_work_notifysig:
877-
l.jal do_notify_resume
878-
l.ori r3,r1,0 /* pt_regs */
879-
880-
_resume_userspace:
881-
DISABLE_INTERRUPTS(r3,r4)
882-
l.lwz r3,TI_FLAGS(r10)
883-
l.andi r3,r3,_TIF_WORK_MASK
884-
l.sfnei r3,0
885-
l.bf _work_pending
880+
l.and r11,r11,r0
881+
l.ori r11,r11,__NR_restart_syscall
882+
l.j _syscall_check_trace_enter
886883
l.nop
884+
1:
885+
l.lwz r11,PT_ORIG_GPR11(r1)
886+
/* Restore arg registers */
887+
l.lwz r3,PT_GPR3(r1)
888+
l.lwz r4,PT_GPR4(r1)
889+
l.lwz r5,PT_GPR5(r1)
890+
l.lwz r6,PT_GPR6(r1)
891+
l.lwz r7,PT_GPR7(r1)
892+
l.j _syscall_check_trace_enter
893+
l.lwz r8,PT_GPR8(r1)
887894

888895
_restore_all:
889896
RESTORE_ALL

0 commit comments

Comments
 (0)