Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus

Pull MIPS fixes from Ralf Baechle:
"The two indirect syscall fixes have sat in linux-next for a few days.
I did check back with a hardware designer to ensure a SYNC is really
what's required for the GIC fix and so the GIC fix didn't make it into
to linux-next in time for this final pull request.

It builds in local build tests and passes Imagination's test system"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
irqchip: mips-gic: SYNC after enabling GIC region
MIPS: Remove pt_regs adjustments in indirect syscall handler
MIPS: seccomp: Fix indirect syscall args

Changed files
+8 -24
arch
drivers
irqchip
+4 -6
arch/mips/kernel/ptrace.c
··· 872 872 if (unlikely(test_thread_flag(TIF_SECCOMP))) { 873 873 int ret, i; 874 874 struct seccomp_data sd; 875 + unsigned long args[6]; 875 876 876 877 sd.nr = syscall; 877 878 sd.arch = syscall_get_arch(); 878 - for (i = 0; i < 6; i++) { 879 - unsigned long v, r; 880 - 881 - r = mips_get_syscall_arg(&v, current, regs, i); 882 - sd.args[i] = r ? 0 : v; 883 - } 879 + syscall_get_arguments(current, regs, 0, 6, args); 880 + for (i = 0; i < 6; i++) 881 + sd.args[i] = args[i]; 884 882 sd.instruction_pointer = KSTK_EIP(current); 885 883 886 884 ret = __secure_computing(&sd);
-11
arch/mips/kernel/scall32-o32.S
··· 190 190 sll t1, t0, 2 191 191 beqz v0, einval 192 192 lw t2, sys_call_table(t1) # syscall routine 193 - sw a0, PT_R2(sp) # call routine directly on restart 194 - 195 - /* Some syscalls like execve get their arguments from struct pt_regs 196 - and claim zero arguments in the syscall table. Thus we have to 197 - assume the worst case and shuffle around all potential arguments. 198 - If you want performance, don't use indirect syscalls. */ 199 193 200 194 move a0, a1 # shift argument registers 201 195 move a1, a2 ··· 201 207 sw t4, 16(sp) 202 208 sw t5, 20(sp) 203 209 sw t6, 24(sp) 204 - sw a0, PT_R4(sp) # .. and push back a0 - a3, some 205 - sw a1, PT_R5(sp) # syscalls expect them there 206 - sw a2, PT_R6(sp) 207 - sw a3, PT_R7(sp) 208 - sw a3, PT_R26(sp) # update a3 for syscall restarting 209 210 jr t2 210 211 /* Unreached */ 211 212
-6
arch/mips/kernel/scall64-o32.S
··· 198 198 dsll t1, t0, 3 199 199 beqz v0, einval 200 200 ld t2, sys32_call_table(t1) # syscall routine 201 - sd a0, PT_R2(sp) # call routine directly on restart 202 201 203 202 move a0, a1 # shift argument registers 204 203 move a1, a2 ··· 206 207 move a4, a5 207 208 move a5, a6 208 209 move a6, a7 209 - sd a0, PT_R4(sp) # ... and push back a0 - a3, some 210 - sd a1, PT_R5(sp) # syscalls expect them there 211 - sd a2, PT_R6(sp) 212 - sd a3, PT_R7(sp) 213 - sd a3, PT_R26(sp) # update a3 for syscall restarting 214 210 jr t2 215 211 /* Unreached */ 216 212
+4 -1
drivers/irqchip/irq-mips-gic.c
··· 1020 1020 gic_len = resource_size(&res); 1021 1021 } 1022 1022 1023 - if (mips_cm_present()) 1023 + if (mips_cm_present()) { 1024 1024 write_gcr_gic_base(gic_base | CM_GCR_GIC_BASE_GICEN_MSK); 1025 + /* Ensure GIC region is enabled before trying to access it */ 1026 + __sync(); 1027 + } 1025 1028 gic_present = true; 1026 1029 1027 1030 __gic_init(gic_base, gic_len, cpu_vec, 0, node);