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

Pull MIPS fixes from Ralf Baechle:

- Fix bitrot in __get_user_unaligned()
- EVA userspace accessor bug fixes.
- Fix for build issues with certain toolchains.
- Fix build error for VDSO with particular toolchain versions.
- Fix build error due to a variable that should have been removed by an
earlier patch

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
MIPS: Fix bitrot in __get_user_unaligned()
MIPS: Fix build error due to unused variables.
MIPS: VDSO: Fix build error
MIPS: CPS: drop .set mips64r2 directives
MIPS: uaccess: Take EVA into account in [__]clear_user
MIPS: uaccess: Take EVA into account in __copy_from_user()
MIPS: uaccess: Fix strlen_user with EVA

Changed files
+42 -24
arch
mips
include
asm
kernel
lib
pci
pmcs-msp71xx
sni
vdso
+35 -17
arch/mips/include/asm/uaccess.h
··· 599 599 * On error, the variable @x is set to zero. 600 600 */ 601 601 #define __get_user_unaligned(x,ptr) \ 602 - __get_user__unalignednocheck((x),(ptr),sizeof(*(ptr))) 602 + __get_user_unaligned_nocheck((x),(ptr),sizeof(*(ptr))) 603 603 604 604 /* 605 605 * Yuck. We need two variants, one for 64bit operation and one ··· 620 620 do { \ 621 621 switch (size) { \ 622 622 case 1: __get_data_asm(val, "lb", ptr); break; \ 623 - case 2: __get_user_unaligned_asm(val, "ulh", ptr); break; \ 624 - case 4: __get_user_unaligned_asm(val, "ulw", ptr); break; \ 623 + case 2: __get_data_unaligned_asm(val, "ulh", ptr); break; \ 624 + case 4: __get_data_unaligned_asm(val, "ulw", ptr); break; \ 625 625 case 8: __GET_USER_UNALIGNED_DW(val, ptr); break; \ 626 626 default: __get_user_unaligned_unknown(); break; \ 627 627 } \ ··· 1122 1122 __cu_to = (to); \ 1123 1123 __cu_from = (from); \ 1124 1124 __cu_len = (n); \ 1125 - might_fault(); \ 1126 - __cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \ 1127 - __cu_len); \ 1125 + if (eva_kernel_access()) { \ 1126 + __cu_len = __invoke_copy_from_kernel(__cu_to, \ 1127 + __cu_from, \ 1128 + __cu_len); \ 1129 + } else { \ 1130 + might_fault(); \ 1131 + __cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \ 1132 + __cu_len); \ 1133 + } \ 1128 1134 __cu_len; \ 1129 1135 }) 1130 1136 ··· 1235 1229 { 1236 1230 __kernel_size_t res; 1237 1231 1238 - might_fault(); 1239 - __asm__ __volatile__( 1240 - "move\t$4, %1\n\t" 1241 - "move\t$5, $0\n\t" 1242 - "move\t$6, %2\n\t" 1243 - __MODULE_JAL(__bzero) 1244 - "move\t%0, $6" 1245 - : "=r" (res) 1246 - : "r" (addr), "r" (size) 1247 - : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"); 1232 + if (eva_kernel_access()) { 1233 + __asm__ __volatile__( 1234 + "move\t$4, %1\n\t" 1235 + "move\t$5, $0\n\t" 1236 + "move\t$6, %2\n\t" 1237 + __MODULE_JAL(__bzero_kernel) 1238 + "move\t%0, $6" 1239 + : "=r" (res) 1240 + : "r" (addr), "r" (size) 1241 + : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"); 1242 + } else { 1243 + might_fault(); 1244 + __asm__ __volatile__( 1245 + "move\t$4, %1\n\t" 1246 + "move\t$5, $0\n\t" 1247 + "move\t$6, %2\n\t" 1248 + __MODULE_JAL(__bzero) 1249 + "move\t%0, $6" 1250 + : "=r" (res) 1251 + : "r" (addr), "r" (size) 1252 + : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"); 1253 + } 1248 1254 1249 1255 return res; 1250 1256 } ··· 1402 1384 might_fault(); 1403 1385 __asm__ __volatile__( 1404 1386 "move\t$4, %1\n\t" 1405 - __MODULE_JAL(__strlen_kernel_asm) 1387 + __MODULE_JAL(__strlen_user_asm) 1406 1388 "move\t%0, $2" 1407 1389 : "=r" (res) 1408 1390 : "r" (s)
-2
arch/mips/kernel/cps-vec.S
··· 257 257 has_mt t0, 3f 258 258 259 259 .set push 260 - .set mips64r2 261 260 .set mt 262 261 263 262 /* Only allow 1 TC per VPE to execute... */ ··· 375 376 nop 376 377 377 378 .set push 378 - .set mips64r2 379 379 .set mt 380 380 381 381 1: /* Enter VPE configuration state */
+2
arch/mips/kernel/mips_ksyms.c
··· 17 17 #include <asm/fpu.h> 18 18 #include <asm/msa.h> 19 19 20 + extern void *__bzero_kernel(void *__s, size_t __count); 20 21 extern void *__bzero(void *__s, size_t __count); 21 22 extern long __strncpy_from_kernel_nocheck_asm(char *__to, 22 23 const char *__from, long __len); ··· 65 64 EXPORT_SYMBOL(__copy_in_user_eva); 66 65 EXPORT_SYMBOL(__copy_to_user_eva); 67 66 EXPORT_SYMBOL(__copy_user_inatomic_eva); 67 + EXPORT_SYMBOL(__bzero_kernel); 68 68 #endif 69 69 EXPORT_SYMBOL(__bzero); 70 70 EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm);
+2
arch/mips/lib/memset.S
··· 283 283 1: 284 284 #ifndef CONFIG_EVA 285 285 FEXPORT(__bzero) 286 + #else 287 + FEXPORT(__bzero_kernel) 286 288 #endif 287 289 __BUILD_BZERO LEGACY_MODE 288 290
-1
arch/mips/pci/pci-rt2880.c
··· 221 221 static int rt288x_pci_probe(struct platform_device *pdev) 222 222 { 223 223 void __iomem *io_map_base; 224 - int i; 225 224 226 225 rt2880_pci_base = ioremap_nocache(RT2880_PCI_BASE, PAGE_SIZE); 227 226
-1
arch/mips/pmcs-msp71xx/msp_setup.c
··· 39 39 void msp7120_reset(void) 40 40 { 41 41 void *start, *end, *iptr; 42 - register int i; 43 42 44 43 /* Diasble all interrupts */ 45 44 local_irq_disable();
+1 -1
arch/mips/sni/reset.c
··· 26 26 /* XXX This ends up at the ARC firmware prompt ... */ 27 27 void sni_machine_restart(char *command) 28 28 { 29 - int i, j; 29 + int i; 30 30 31 31 /* This does a normal via the keyboard controller like a PC. 32 32 We can do that easier ... */
+2 -2
arch/mips/vdso/Makefile
··· 26 26 # the comments on that file. 27 27 # 28 28 ifndef CONFIG_CPU_MIPSR6 29 - ifeq ($(call ld-ifversion, -gt, 22400000, y),) 30 - $(warning MIPS VDSO requires binutils > 2.24) 29 + ifeq ($(call ld-ifversion, -lt, 22500000, y),) 30 + $(warning MIPS VDSO requires binutils >= 2.25) 31 31 obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) 32 32 ccflags-vdso += -DDISABLE_MIPS_VDSO 33 33 endif