aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-12-27 21:12:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-12-27 21:12:21 -0500
commit3ae86f1a9f2f2bc628ea5ab91dd097a6e6ad210f (patch)
tree4e895b5aedd774ff55c0f6008471765307b54b78
parentdb0665012cc9cbc0445678e3fcce102791f721ce (diff)
parent930c0f708e156613c37b97cf583c4c6b07d99cce (diff)
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
-rw-r--r--arch/mips/include/asm/uaccess.h52
-rw-r--r--arch/mips/kernel/cps-vec.S2
-rw-r--r--arch/mips/kernel/mips_ksyms.c2
-rw-r--r--arch/mips/lib/memset.S2
-rw-r--r--arch/mips/pci/pci-rt2880.c1
-rw-r--r--arch/mips/pmcs-msp71xx/msp_setup.c1
-rw-r--r--arch/mips/sni/reset.c2
-rw-r--r--arch/mips/vdso/Makefile4
8 files changed, 42 insertions, 24 deletions
diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h
index 5305d694ffe5..095ecafe6bd3 100644
--- a/arch/mips/include/asm/uaccess.h
+++ b/arch/mips/include/asm/uaccess.h
@@ -599,7 +599,7 @@ extern void __put_user_unknown(void);
599 * On error, the variable @x is set to zero. 599 * On error, the variable @x is set to zero.
600 */ 600 */
601#define __get_user_unaligned(x,ptr) \ 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 * Yuck. We need two variants, one for 64bit operation and one 605 * Yuck. We need two variants, one for 64bit operation and one
@@ -620,8 +620,8 @@ extern void __get_user_unaligned_unknown(void);
620do { \ 620do { \
621 switch (size) { \ 621 switch (size) { \
622 case 1: __get_data_asm(val, "lb", ptr); break; \ 622 case 1: __get_data_asm(val, "lb", ptr); break; \
623 case 2: __get_user_unaligned_asm(val, "ulh", ptr); break; \ 623 case 2: __get_data_unaligned_asm(val, "ulh", ptr); break; \
624 case 4: __get_user_unaligned_asm(val, "ulw", ptr); break; \ 624 case 4: __get_data_unaligned_asm(val, "ulw", ptr); break; \
625 case 8: __GET_USER_UNALIGNED_DW(val, ptr); break; \ 625 case 8: __GET_USER_UNALIGNED_DW(val, ptr); break; \
626 default: __get_user_unaligned_unknown(); break; \ 626 default: __get_user_unaligned_unknown(); break; \
627 } \ 627 } \
@@ -1122,9 +1122,15 @@ extern size_t __copy_in_user_eva(void *__to, const void *__from, size_t __n);
1122 __cu_to = (to); \ 1122 __cu_to = (to); \
1123 __cu_from = (from); \ 1123 __cu_from = (from); \
1124 __cu_len = (n); \ 1124 __cu_len = (n); \
1125 might_fault(); \ 1125 if (eva_kernel_access()) { \
1126 __cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \ 1126 __cu_len = __invoke_copy_from_kernel(__cu_to, \
1127 __cu_len); \ 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 __cu_len; \ 1134 __cu_len; \
1129}) 1135})
1130 1136
@@ -1229,16 +1235,28 @@ __clear_user(void __user *addr, __kernel_size_t size)
1229{ 1235{
1230 __kernel_size_t res; 1236 __kernel_size_t res;
1231 1237
1232 might_fault(); 1238 if (eva_kernel_access()) {
1233 __asm__ __volatile__( 1239 __asm__ __volatile__(
1234 "move\t$4, %1\n\t" 1240 "move\t$4, %1\n\t"
1235 "move\t$5, $0\n\t" 1241 "move\t$5, $0\n\t"
1236 "move\t$6, %2\n\t" 1242 "move\t$6, %2\n\t"
1237 __MODULE_JAL(__bzero) 1243 __MODULE_JAL(__bzero_kernel)
1238 "move\t%0, $6" 1244 "move\t%0, $6"
1239 : "=r" (res) 1245 : "=r" (res)
1240 : "r" (addr), "r" (size) 1246 : "r" (addr), "r" (size)
1241 : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"); 1247 : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31");
1248 } else {
1249 might_fault();
1250 __asm__ __volatile__(
1251 "move\t$4, %1\n\t"
1252 "move\t$5, $0\n\t"
1253 "move\t$6, %2\n\t"
1254 __MODULE_JAL(__bzero)
1255 "move\t%0, $6"
1256 : "=r" (res)
1257 : "r" (addr), "r" (size)
1258 : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31");
1259 }
1242 1260
1243 return res; 1261 return res;
1244} 1262}
@@ -1384,7 +1402,7 @@ static inline long strlen_user(const char __user *s)
1384 might_fault(); 1402 might_fault();
1385 __asm__ __volatile__( 1403 __asm__ __volatile__(
1386 "move\t$4, %1\n\t" 1404 "move\t$4, %1\n\t"
1387 __MODULE_JAL(__strlen_kernel_asm) 1405 __MODULE_JAL(__strlen_user_asm)
1388 "move\t%0, $2" 1406 "move\t%0, $2"
1389 : "=r" (res) 1407 : "=r" (res)
1390 : "r" (s) 1408 : "r" (s)
diff --git a/arch/mips/kernel/cps-vec.S b/arch/mips/kernel/cps-vec.S
index 8fd5a276cad2..ac81edd44563 100644
--- a/arch/mips/kernel/cps-vec.S
+++ b/arch/mips/kernel/cps-vec.S
@@ -257,7 +257,6 @@ LEAF(mips_cps_core_init)
257 has_mt t0, 3f 257 has_mt t0, 3f
258 258
259 .set push 259 .set push
260 .set mips64r2
261 .set mt 260 .set mt
262 261
263 /* Only allow 1 TC per VPE to execute... */ 262 /* Only allow 1 TC per VPE to execute... */
@@ -376,7 +375,6 @@ LEAF(mips_cps_boot_vpes)
376 nop 375 nop
377 376
378 .set push 377 .set push
379 .set mips64r2
380 .set mt 378 .set mt
381 379
3821: /* Enter VPE configuration state */ 3801: /* Enter VPE configuration state */
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index 291af0b5c482..e2b6ab74643d 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -17,6 +17,7 @@
17#include <asm/fpu.h> 17#include <asm/fpu.h>
18#include <asm/msa.h> 18#include <asm/msa.h>
19 19
20extern void *__bzero_kernel(void *__s, size_t __count);
20extern void *__bzero(void *__s, size_t __count); 21extern void *__bzero(void *__s, size_t __count);
21extern long __strncpy_from_kernel_nocheck_asm(char *__to, 22extern long __strncpy_from_kernel_nocheck_asm(char *__to,
22 const char *__from, long __len); 23 const char *__from, long __len);
@@ -64,6 +65,7 @@ EXPORT_SYMBOL(__copy_from_user_eva);
64EXPORT_SYMBOL(__copy_in_user_eva); 65EXPORT_SYMBOL(__copy_in_user_eva);
65EXPORT_SYMBOL(__copy_to_user_eva); 66EXPORT_SYMBOL(__copy_to_user_eva);
66EXPORT_SYMBOL(__copy_user_inatomic_eva); 67EXPORT_SYMBOL(__copy_user_inatomic_eva);
68EXPORT_SYMBOL(__bzero_kernel);
67#endif 69#endif
68EXPORT_SYMBOL(__bzero); 70EXPORT_SYMBOL(__bzero);
69EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm); 71EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm);
diff --git a/arch/mips/lib/memset.S b/arch/mips/lib/memset.S
index b8e63fd00375..8f0019a2e5c8 100644
--- a/arch/mips/lib/memset.S
+++ b/arch/mips/lib/memset.S
@@ -283,6 +283,8 @@ LEAF(memset)
2831: 2831:
284#ifndef CONFIG_EVA 284#ifndef CONFIG_EVA
285FEXPORT(__bzero) 285FEXPORT(__bzero)
286#else
287FEXPORT(__bzero_kernel)
286#endif 288#endif
287 __BUILD_BZERO LEGACY_MODE 289 __BUILD_BZERO LEGACY_MODE
288 290
diff --git a/arch/mips/pci/pci-rt2880.c b/arch/mips/pci/pci-rt2880.c
index dbbeccc3d714..a245cad4372a 100644
--- a/arch/mips/pci/pci-rt2880.c
+++ b/arch/mips/pci/pci-rt2880.c
@@ -221,7 +221,6 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
221static int rt288x_pci_probe(struct platform_device *pdev) 221static int rt288x_pci_probe(struct platform_device *pdev)
222{ 222{
223 void __iomem *io_map_base; 223 void __iomem *io_map_base;
224 int i;
225 224
226 rt2880_pci_base = ioremap_nocache(RT2880_PCI_BASE, PAGE_SIZE); 225 rt2880_pci_base = ioremap_nocache(RT2880_PCI_BASE, PAGE_SIZE);
227 226
diff --git a/arch/mips/pmcs-msp71xx/msp_setup.c b/arch/mips/pmcs-msp71xx/msp_setup.c
index 78b2ef49dbc7..9d293b3e9130 100644
--- a/arch/mips/pmcs-msp71xx/msp_setup.c
+++ b/arch/mips/pmcs-msp71xx/msp_setup.c
@@ -39,7 +39,6 @@ extern void msp_serial_setup(void);
39void msp7120_reset(void) 39void msp7120_reset(void)
40{ 40{
41 void *start, *end, *iptr; 41 void *start, *end, *iptr;
42 register int i;
43 42
44 /* Diasble all interrupts */ 43 /* Diasble all interrupts */
45 local_irq_disable(); 44 local_irq_disable();
diff --git a/arch/mips/sni/reset.c b/arch/mips/sni/reset.c
index db8f88b6a3af..6afa34346b81 100644
--- a/arch/mips/sni/reset.c
+++ b/arch/mips/sni/reset.c
@@ -26,7 +26,7 @@ static inline void kb_wait(void)
26/* XXX This ends up at the ARC firmware prompt ... */ 26/* XXX This ends up at the ARC firmware prompt ... */
27void sni_machine_restart(char *command) 27void sni_machine_restart(char *command)
28{ 28{
29 int i, j; 29 int i;
30 30
31 /* This does a normal via the keyboard controller like a PC. 31 /* This does a normal via the keyboard controller like a PC.
32 We can do that easier ... */ 32 We can do that easier ... */
diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
index ef5f348f386a..018f8c7b94f2 100644
--- a/arch/mips/vdso/Makefile
+++ b/arch/mips/vdso/Makefile
@@ -26,8 +26,8 @@ aflags-vdso := $(ccflags-vdso) \
26# the comments on that file. 26# the comments on that file.
27# 27#
28ifndef CONFIG_CPU_MIPSR6 28ifndef CONFIG_CPU_MIPSR6
29 ifeq ($(call ld-ifversion, -gt, 22400000, y),) 29 ifeq ($(call ld-ifversion, -lt, 22500000, y),)
30 $(warning MIPS VDSO requires binutils > 2.24) 30 $(warning MIPS VDSO requires binutils >= 2.25)
31 obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) 31 obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y))
32 ccflags-vdso += -DDISABLE_MIPS_VDSO 32 ccflags-vdso += -DDISABLE_MIPS_VDSO
33 endif 33 endif