]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 3 Sep 2017 16:50:26 +0000 (09:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 3 Sep 2017 16:50:26 +0000 (09:50 -0700)
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

arch/mips/kernel/ptrace.c
arch/mips/kernel/scall32-o32.S
arch/mips/kernel/scall64-o32.S
drivers/irqchip/irq-mips-gic.c

index 6dd13641a4188e2a977592a3a0ed5e964bca064b..1395654cfc8d833b62ded894af5639cc696367c5 100644 (file)
@@ -872,15 +872,13 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
        if (unlikely(test_thread_flag(TIF_SECCOMP))) {
                int ret, i;
                struct seccomp_data sd;
+               unsigned long args[6];
 
                sd.nr = syscall;
                sd.arch = syscall_get_arch();
-               for (i = 0; i < 6; i++) {
-                       unsigned long v, r;
-
-                       r = mips_get_syscall_arg(&v, current, regs, i);
-                       sd.args[i] = r ? 0 : v;
-               }
+               syscall_get_arguments(current, regs, 0, 6, args);
+               for (i = 0; i < 6; i++)
+                       sd.args[i] = args[i];
                sd.instruction_pointer = KSTK_EIP(current);
 
                ret = __secure_computing(&sd);
index 27c2f90eeb21f60e07e6cb4534fb33cdd0b68ef9..a9a7d78803cde30097a02c76aa49bef9f812be7e 100644 (file)
@@ -190,12 +190,6 @@ illegal_syscall:
        sll     t1, t0, 2
        beqz    v0, einval
        lw      t2, sys_call_table(t1)          # syscall routine
-       sw      a0, PT_R2(sp)                   # call routine directly on restart
-
-       /* Some syscalls like execve get their arguments from struct pt_regs
-          and claim zero arguments in the syscall table. Thus we have to
-          assume the worst case and shuffle around all potential arguments.
-          If you want performance, don't use indirect syscalls. */
 
        move    a0, a1                          # shift argument registers
        move    a1, a2
@@ -207,11 +201,6 @@ illegal_syscall:
        sw      t4, 16(sp)
        sw      t5, 20(sp)
        sw      t6, 24(sp)
-       sw      a0, PT_R4(sp)                   # .. and push back a0 - a3, some
-       sw      a1, PT_R5(sp)                   # syscalls expect them there
-       sw      a2, PT_R6(sp)
-       sw      a3, PT_R7(sp)
-       sw      a3, PT_R26(sp)                  # update a3 for syscall restarting
        jr      t2
        /* Unreached */
 
index c30bc520885f985a921b066bfb45d5dea8aadab2..9ebe3e2403b1d7b84d66732cd261364208f6020d 100644 (file)
@@ -198,7 +198,6 @@ LEAF(sys32_syscall)
        dsll    t1, t0, 3
        beqz    v0, einval
        ld      t2, sys32_call_table(t1)                # syscall routine
-       sd      a0, PT_R2(sp)           # call routine directly on restart
 
        move    a0, a1                  # shift argument registers
        move    a1, a2
@@ -207,11 +206,6 @@ LEAF(sys32_syscall)
        move    a4, a5
        move    a5, a6
        move    a6, a7
-       sd      a0, PT_R4(sp)           # ... and push back a0 - a3, some
-       sd      a1, PT_R5(sp)           # syscalls expect them there
-       sd      a2, PT_R6(sp)
-       sd      a3, PT_R7(sp)
-       sd      a3, PT_R26(sp)          # update a3 for syscall restarting
        jr      t2
        /* Unreached */
 
index 6ab1d3afec02b39f4d8b26e9e30c280b316de156..48ee1bad473f005fca967d1908b1204fa90773ba 100644 (file)
@@ -1020,8 +1020,11 @@ static int __init gic_of_init(struct device_node *node,
                gic_len = resource_size(&res);
        }
 
-       if (mips_cm_present())
+       if (mips_cm_present()) {
                write_gcr_gic_base(gic_base | CM_GCR_GIC_BASE_GICEN_MSK);
+               /* Ensure GIC region is enabled before trying to access it */
+               __sync();
+       }
        gic_present = true;
 
        __gic_init(gic_base, gic_len, cpu_vec, 0, node);