Skip to content

Commit f5ca0eb

Browse files
author
Alex Shi
committed
Merge tag 'v4.4.79' into linux-linaro-lsk-v4.4
This is the 4.4.79 stable release
2 parents b017a97 + e058f63 commit f5ca0eb

81 files changed

Lines changed: 623 additions & 245 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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 78
3+
SUBLEVEL = 79
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

@@ -619,6 +619,9 @@ include arch/$(SRCARCH)/Makefile
619619
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
620620
KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
621621
KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
622+
KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
623+
KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
624+
KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context)
622625

623626
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
624627
KBUILD_CFLAGS += -Os

arch/mips/include/asm/branch.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ static inline int compute_return_epc(struct pt_regs *regs)
7474
return __microMIPS_compute_return_epc(regs);
7575
if (cpu_has_mips16)
7676
return __MIPS16e_compute_return_epc(regs);
77-
return regs->cp0_epc;
78-
}
79-
80-
if (!delay_slot(regs)) {
77+
} else if (!delay_slot(regs)) {
8178
regs->cp0_epc += 4;
8279
return 0;
8380
}

arch/mips/kernel/branch.c

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ int __MIPS16e_compute_return_epc(struct pt_regs *regs)
399399
*
400400
* @regs: Pointer to pt_regs
401401
* @insn: branch instruction to decode
402-
* @returns: -EFAULT on error and forces SIGBUS, and on success
402+
* @returns: -EFAULT on error and forces SIGILL, and on success
403403
* returns 0 or BRANCH_LIKELY_TAKEN as appropriate after
404404
* evaluating the branch.
405405
*
@@ -431,7 +431,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
431431
/* Fall through */
432432
case jr_op:
433433
if (NO_R6EMU && insn.r_format.func == jr_op)
434-
goto sigill_r6;
434+
goto sigill_r2r6;
435435
regs->cp0_epc = regs->regs[insn.r_format.rs];
436436
break;
437437
}
@@ -446,7 +446,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
446446
switch (insn.i_format.rt) {
447447
case bltzl_op:
448448
if (NO_R6EMU)
449-
goto sigill_r6;
449+
goto sigill_r2r6;
450450
case bltz_op:
451451
if ((long)regs->regs[insn.i_format.rs] < 0) {
452452
epc = epc + 4 + (insn.i_format.simmediate << 2);
@@ -459,7 +459,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
459459

460460
case bgezl_op:
461461
if (NO_R6EMU)
462-
goto sigill_r6;
462+
goto sigill_r2r6;
463463
case bgez_op:
464464
if ((long)regs->regs[insn.i_format.rs] >= 0) {
465465
epc = epc + 4 + (insn.i_format.simmediate << 2);
@@ -473,10 +473,8 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
473473
case bltzal_op:
474474
case bltzall_op:
475475
if (NO_R6EMU && (insn.i_format.rs ||
476-
insn.i_format.rt == bltzall_op)) {
477-
ret = -SIGILL;
478-
break;
479-
}
476+
insn.i_format.rt == bltzall_op))
477+
goto sigill_r2r6;
480478
regs->regs[31] = epc + 8;
481479
/*
482480
* OK we are here either because we hit a NAL
@@ -507,10 +505,8 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
507505
case bgezal_op:
508506
case bgezall_op:
509507
if (NO_R6EMU && (insn.i_format.rs ||
510-
insn.i_format.rt == bgezall_op)) {
511-
ret = -SIGILL;
512-
break;
513-
}
508+
insn.i_format.rt == bgezall_op))
509+
goto sigill_r2r6;
514510
regs->regs[31] = epc + 8;
515511
/*
516512
* OK we are here either because we hit a BAL
@@ -556,6 +552,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
556552
/*
557553
* These are unconditional and in j_format.
558554
*/
555+
case jalx_op:
559556
case jal_op:
560557
regs->regs[31] = regs->cp0_epc + 8;
561558
case j_op:
@@ -573,7 +570,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
573570
*/
574571
case beql_op:
575572
if (NO_R6EMU)
576-
goto sigill_r6;
573+
goto sigill_r2r6;
577574
case beq_op:
578575
if (regs->regs[insn.i_format.rs] ==
579576
regs->regs[insn.i_format.rt]) {
@@ -587,7 +584,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
587584

588585
case bnel_op:
589586
if (NO_R6EMU)
590-
goto sigill_r6;
587+
goto sigill_r2r6;
591588
case bne_op:
592589
if (regs->regs[insn.i_format.rs] !=
593590
regs->regs[insn.i_format.rt]) {
@@ -601,7 +598,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
601598

602599
case blezl_op: /* not really i_format */
603600
if (!insn.i_format.rt && NO_R6EMU)
604-
goto sigill_r6;
601+
goto sigill_r2r6;
605602
case blez_op:
606603
/*
607604
* Compact branches for R6 for the
@@ -636,7 +633,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
636633

637634
case bgtzl_op:
638635
if (!insn.i_format.rt && NO_R6EMU)
639-
goto sigill_r6;
636+
goto sigill_r2r6;
640637
case bgtz_op:
641638
/*
642639
* Compact branches for R6 for the
@@ -843,11 +840,12 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
843840
return ret;
844841

845842
sigill_dsp:
846-
printk("%s: DSP branch but not DSP ASE - sending SIGBUS.\n", current->comm);
847-
force_sig(SIGBUS, current);
843+
pr_info("%s: DSP branch but not DSP ASE - sending SIGILL.\n",
844+
current->comm);
845+
force_sig(SIGILL, current);
848846
return -EFAULT;
849-
sigill_r6:
850-
pr_info("%s: R2 branch but r2-to-r6 emulator is not preset - sending SIGILL.\n",
847+
sigill_r2r6:
848+
pr_info("%s: R2 branch but r2-to-r6 emulator is not present - sending SIGILL.\n",
851849
current->comm);
852850
force_sig(SIGILL, current);
853851
return -EFAULT;

arch/mips/kernel/proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
8383
}
8484

8585
seq_printf(m, "isa\t\t\t:");
86-
if (cpu_has_mips_r1)
86+
if (cpu_has_mips_1)
8787
seq_printf(m, " mips1");
8888
if (cpu_has_mips_2)
8989
seq_printf(m, "%s", " mips2");

arch/mips/kernel/ptrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs)
927927
audit_syscall_exit(regs);
928928

929929
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
930-
trace_sys_exit(regs, regs->regs[2]);
930+
trace_sys_exit(regs, regs_return_value(regs));
931931

932932
if (test_thread_flag(TIF_SYSCALL_TRACE))
933933
tracehook_report_syscall_exit(regs, 0);

arch/mips/kernel/scall32-o32.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ EXPORT(sys_call_table)
372372
PTR sys_writev
373373
PTR sys_cacheflush
374374
PTR sys_cachectl
375-
PTR sys_sysmips
375+
PTR __sys_sysmips
376376
PTR sys_ni_syscall /* 4150 */
377377
PTR sys_getsid
378378
PTR sys_fdatasync

arch/mips/kernel/scall64-64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ EXPORT(sys_call_table)
312312
PTR sys_sched_getaffinity
313313
PTR sys_cacheflush
314314
PTR sys_cachectl
315-
PTR sys_sysmips
315+
PTR __sys_sysmips
316316
PTR sys_io_setup /* 5200 */
317317
PTR sys_io_destroy
318318
PTR sys_io_getevents

arch/mips/kernel/scall64-n32.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ EXPORT(sysn32_call_table)
298298
PTR compat_sys_sched_getaffinity
299299
PTR sys_cacheflush
300300
PTR sys_cachectl
301-
PTR sys_sysmips
301+
PTR __sys_sysmips
302302
PTR compat_sys_io_setup /* 6200 */
303303
PTR sys_io_destroy
304304
PTR compat_sys_io_getevents

arch/mips/kernel/scall64-o32.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ EXPORT(sys32_call_table)
367367
PTR compat_sys_writev
368368
PTR sys_cacheflush
369369
PTR sys_cachectl
370-
PTR sys_sysmips
370+
PTR __sys_sysmips
371371
PTR sys_ni_syscall /* 4150 */
372372
PTR sys_getsid
373373
PTR sys_fdatasync

arch/mips/kernel/syscall.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <linux/elf.h>
2929

3030
#include <asm/asm.h>
31+
#include <asm/asm-eva.h>
3132
#include <asm/branch.h>
3233
#include <asm/cachectl.h>
3334
#include <asm/cacheflush.h>
@@ -138,10 +139,12 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new)
138139
__asm__ __volatile__ (
139140
" .set "MIPS_ISA_ARCH_LEVEL" \n"
140141
" li %[err], 0 \n"
141-
"1: ll %[old], (%[addr]) \n"
142+
"1: \n"
143+
user_ll("%[old]", "(%[addr])")
142144
" move %[tmp], %[new] \n"
143-
"2: sc %[tmp], (%[addr]) \n"
144-
" bnez %[tmp], 4f \n"
145+
"2: \n"
146+
user_sc("%[tmp]", "(%[addr])")
147+
" beqz %[tmp], 4f \n"
145148
"3: \n"
146149
" .insn \n"
147150
" .subsection 2 \n"
@@ -199,6 +202,12 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new)
199202
unreachable();
200203
}
201204

205+
/*
206+
* mips_atomic_set() normally returns directly via syscall_exit potentially
207+
* clobbering static registers, so be sure to preserve them.
208+
*/
209+
save_static_function(sys_sysmips);
210+
202211
SYSCALL_DEFINE3(sysmips, long, cmd, long, arg1, long, arg2)
203212
{
204213
switch (cmd) {

0 commit comments

Comments
 (0)