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

Pull MIPS fixes from Ralf Baechle:
"MIPS fixes across the field. The only area that's standing out is the
exception handling which received it's dose of breakage as part of the
microMIPS patchset"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
MIPS: ralink: add missing SZ_1M multiplier
MIPS: Compat: Fix cputime_to_timeval() arguments in compat binfmt_elf.
MIPS: OCTEON: Improve _machine_halt implementation.
MIPS: rtlx: Fix implicit declaration of function set_vi_handler()
MIPS: Trap exception handling fixes
MIPS: Quit exposing Kconfig symbols in uapi headers.
MIPS: Remove duplicate definition of check_for_high_segbits.

Changed files
+82 -39
arch
mips
cavium-octeon
include
asm
uapi
asm
kernel
mm
ralink
+9 -6
arch/mips/cavium-octeon/setup.c
··· 428 428 */ 429 429 static void octeon_kill_core(void *arg) 430 430 { 431 - mb(); 432 - if (octeon_is_simulation()) { 433 - /* The simulator needs the watchdog to stop for dead cores */ 434 - cvmx_write_csr(CVMX_CIU_WDOGX(cvmx_get_core_num()), 0); 431 + if (octeon_is_simulation()) 435 432 /* A break instruction causes the simulator stop a core */ 436 - asm volatile ("sync\nbreak"); 437 - } 433 + asm volatile ("break" ::: "memory"); 434 + 435 + local_irq_disable(); 436 + /* Disable watchdog on this core. */ 437 + cvmx_write_csr(CVMX_CIU_WDOGX(cvmx_get_core_num()), 0); 438 + /* Spin in a low power mode. */ 439 + while (true) 440 + asm volatile ("wait" ::: "memory"); 438 441 } 439 442 440 443
+32
arch/mips/include/asm/ptrace.h
··· 16 16 #include <asm/isadep.h> 17 17 #include <uapi/asm/ptrace.h> 18 18 19 + /* 20 + * This struct defines the way the registers are stored on the stack during a 21 + * system call/exception. As usual the registers k0/k1 aren't being saved. 22 + */ 23 + struct pt_regs { 24 + #ifdef CONFIG_32BIT 25 + /* Pad bytes for argument save space on the stack. */ 26 + unsigned long pad0[6]; 27 + #endif 28 + 29 + /* Saved main processor registers. */ 30 + unsigned long regs[32]; 31 + 32 + /* Saved special registers. */ 33 + unsigned long cp0_status; 34 + unsigned long hi; 35 + unsigned long lo; 36 + #ifdef CONFIG_CPU_HAS_SMARTMIPS 37 + unsigned long acx; 38 + #endif 39 + unsigned long cp0_badvaddr; 40 + unsigned long cp0_cause; 41 + unsigned long cp0_epc; 42 + #ifdef CONFIG_MIPS_MT_SMTC 43 + unsigned long cp0_tcstatus; 44 + #endif /* CONFIG_MIPS_MT_SMTC */ 45 + #ifdef CONFIG_CPU_CAVIUM_OCTEON 46 + unsigned long long mpl[3]; /* MTM{0,1,2} */ 47 + unsigned long long mtp[3]; /* MTP{0,1,2} */ 48 + #endif 49 + } __aligned(8); 50 + 19 51 struct task_struct; 20 52 21 53 extern int ptrace_getregs(struct task_struct *child, __s64 __user *data);
+2 -15
arch/mips/include/uapi/asm/ptrace.h
··· 22 22 #define DSP_CONTROL 77 23 23 #define ACX 78 24 24 25 + #ifndef __KERNEL__ 25 26 /* 26 27 * This struct defines the way the registers are stored on the stack during a 27 28 * system call/exception. As usual the registers k0/k1 aren't being saved. 28 29 */ 29 30 struct pt_regs { 30 - #ifdef CONFIG_32BIT 31 - /* Pad bytes for argument save space on the stack. */ 32 - unsigned long pad0[6]; 33 - #endif 34 - 35 31 /* Saved main processor registers. */ 36 32 unsigned long regs[32]; 37 33 ··· 35 39 unsigned long cp0_status; 36 40 unsigned long hi; 37 41 unsigned long lo; 38 - #ifdef CONFIG_CPU_HAS_SMARTMIPS 39 - unsigned long acx; 40 - #endif 41 42 unsigned long cp0_badvaddr; 42 43 unsigned long cp0_cause; 43 44 unsigned long cp0_epc; 44 - #ifdef CONFIG_MIPS_MT_SMTC 45 - unsigned long cp0_tcstatus; 46 - #endif /* CONFIG_MIPS_MT_SMTC */ 47 - #ifdef CONFIG_CPU_CAVIUM_OCTEON 48 - unsigned long long mpl[3]; /* MTM{0,1,2} */ 49 - unsigned long long mtp[3]; /* MTP{0,1,2} */ 50 - #endif 51 45 } __attribute__ ((aligned (8))); 46 + #endif /* __KERNEL__ */ 52 47 53 48 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ 54 49 #define PTRACE_GETREGS 12
+11
arch/mips/kernel/binfmt_elfn32.c
··· 119 119 #undef TASK_SIZE 120 120 #define TASK_SIZE TASK_SIZE32 121 121 122 + #undef cputime_to_timeval 123 + #define cputime_to_timeval cputime_to_compat_timeval 124 + static __inline__ void 125 + cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) 126 + { 127 + unsigned long jiffies = cputime_to_jiffies(cputime); 128 + 129 + value->tv_usec = (jiffies % HZ) * (1000000L / HZ); 130 + value->tv_sec = jiffies / HZ; 131 + } 132 + 122 133 #include "../../../fs/binfmt_elf.c"
+11
arch/mips/kernel/binfmt_elfo32.c
··· 162 162 #undef TASK_SIZE 163 163 #define TASK_SIZE TASK_SIZE32 164 164 165 + #undef cputime_to_timeval 166 + #define cputime_to_timeval cputime_to_compat_timeval 167 + static __inline__ void 168 + cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) 169 + { 170 + unsigned long jiffies = cputime_to_jiffies(cputime); 171 + 172 + value->tv_usec = (jiffies % HZ) * (1000000L / HZ); 173 + value->tv_sec = jiffies / HZ; 174 + } 175 + 165 176 #include "../../../fs/binfmt_elf.c"
+1
arch/mips/kernel/rtlx.c
··· 40 40 #include <asm/processor.h> 41 41 #include <asm/vpe.h> 42 42 #include <asm/rtlx.h> 43 + #include <asm/setup.h> 43 44 44 45 static struct rtlx_info *rtlx; 45 46 static int major;
+15 -13
arch/mips/kernel/traps.c
··· 897 897 898 898 asmlinkage void do_tr(struct pt_regs *regs) 899 899 { 900 - unsigned int opcode, tcode = 0; 900 + u32 opcode, tcode = 0; 901 901 u16 instr[2]; 902 - unsigned long epc = exception_epc(regs); 902 + unsigned long epc = msk_isa16_mode(exception_epc(regs)); 903 903 904 - if ((__get_user(instr[0], (u16 __user *)msk_isa16_mode(epc))) || 905 - (__get_user(instr[1], (u16 __user *)msk_isa16_mode(epc + 2)))) 904 + if (get_isa16_mode(regs->cp0_epc)) { 905 + if (__get_user(instr[0], (u16 __user *)(epc + 0)) || 906 + __get_user(instr[1], (u16 __user *)(epc + 2))) 906 907 goto out_sigsegv; 907 - opcode = (instr[0] << 16) | instr[1]; 908 - 909 - /* Immediate versions don't provide a code. */ 910 - if (!(opcode & OPCODE)) { 911 - if (get_isa16_mode(regs->cp0_epc)) 912 - /* microMIPS */ 913 - tcode = (opcode >> 12) & 0x1f; 914 - else 915 - tcode = ((opcode >> 6) & ((1 << 10) - 1)); 908 + opcode = (instr[0] << 16) | instr[1]; 909 + /* Immediate versions don't provide a code. */ 910 + if (!(opcode & OPCODE)) 911 + tcode = (opcode >> 12) & ((1 << 4) - 1); 912 + } else { 913 + if (__get_user(opcode, (u32 __user *)epc)) 914 + goto out_sigsegv; 915 + /* Immediate versions don't provide a code. */ 916 + if (!(opcode & OPCODE)) 917 + tcode = (opcode >> 6) & ((1 << 10) - 1); 916 918 } 917 919 918 920 do_trap_or_bp(regs, tcode, "Trap");
-4
arch/mips/mm/tlbex.c
··· 301 301 static struct uasm_label labels[128] __cpuinitdata; 302 302 static struct uasm_reloc relocs[128] __cpuinitdata; 303 303 304 - #ifdef CONFIG_64BIT 305 - static int check_for_high_segbits __cpuinitdata; 306 - #endif 307 - 308 304 static int check_for_high_segbits __cpuinitdata; 309 305 310 306 static unsigned int kscratch_used_mask __cpuinitdata;
+1 -1
arch/mips/ralink/of.c
··· 88 88 __dt_setup_arch(&__dtb_start); 89 89 90 90 if (soc_info.mem_size) 91 - add_memory_region(soc_info.mem_base, soc_info.mem_size, 91 + add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M, 92 92 BOOT_MEM_RAM); 93 93 else 94 94 detect_memory_region(soc_info.mem_base,