aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/Kconfig3
-rw-r--r--arch/mips/Makefile11
-rw-r--r--arch/mips/bcm63xx/irq.c4
-rw-r--r--arch/mips/boot/compressed/decompress.c1
-rw-r--r--arch/mips/configs/gpr_defconfig1
-rw-r--r--arch/mips/configs/ip27_defconfig1
-rw-r--r--arch/mips/configs/jazz_defconfig1
-rw-r--r--arch/mips/configs/loongson3_defconfig1
-rw-r--r--arch/mips/configs/malta_defconfig1
-rw-r--r--arch/mips/configs/malta_kvm_defconfig1
-rw-r--r--arch/mips/configs/malta_kvm_guest_defconfig1
-rw-r--r--arch/mips/configs/mtx1_defconfig1
-rw-r--r--arch/mips/configs/nlm_xlp_defconfig1
-rw-r--r--arch/mips/configs/nlm_xlr_defconfig1
-rw-r--r--arch/mips/configs/rm200_defconfig1
-rw-r--r--arch/mips/include/asm/cop2.h18
-rw-r--r--arch/mips/include/asm/mach-ip28/spaces.h7
-rw-r--r--arch/mips/include/asm/page.h5
-rw-r--r--arch/mips/include/asm/smp.h5
-rw-r--r--arch/mips/include/asm/switch_to.h4
-rw-r--r--arch/mips/include/asm/topology.h8
-rw-r--r--arch/mips/include/uapi/asm/unistd.h18
-rw-r--r--arch/mips/kernel/machine_kexec.c8
-rw-r--r--arch/mips/kernel/mcount.S12
-rw-r--r--arch/mips/kernel/scall32-o32.S2
-rw-r--r--arch/mips/kernel/scall64-64.S2
-rw-r--r--arch/mips/kernel/scall64-n32.S2
-rw-r--r--arch/mips/kernel/scall64-o32.S2
-rw-r--r--arch/mips/math-emu/cp1emu.c6
-rw-r--r--arch/mips/mm/init.c1
-rw-r--r--arch/mips/net/bpf_jit.c5
31 files changed, 94 insertions, 41 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 900c7e5333b6..574c43000699 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -546,6 +546,7 @@ config SGI_IP28
546 # select SYS_HAS_EARLY_PRINTK 546 # select SYS_HAS_EARLY_PRINTK
547 select SYS_SUPPORTS_64BIT_KERNEL 547 select SYS_SUPPORTS_64BIT_KERNEL
548 select SYS_SUPPORTS_BIG_ENDIAN 548 select SYS_SUPPORTS_BIG_ENDIAN
549 select MIPS_L1_CACHE_SHIFT_7
549 help 550 help
550 This is the SGI Indigo2 with R10000 processor. To compile a Linux 551 This is the SGI Indigo2 with R10000 processor. To compile a Linux
551 kernel that runs on these, say Y here. 552 kernel that runs on these, say Y here.
@@ -2029,7 +2030,9 @@ config MIPS_CMP
2029 bool "MIPS CMP framework support (DEPRECATED)" 2030 bool "MIPS CMP framework support (DEPRECATED)"
2030 depends on SYS_SUPPORTS_MIPS_CMP 2031 depends on SYS_SUPPORTS_MIPS_CMP
2031 select MIPS_GIC_IPI 2032 select MIPS_GIC_IPI
2033 select SMP
2032 select SYNC_R4K 2034 select SYNC_R4K
2035 select SYS_SUPPORTS_SMP
2033 select WEAK_ORDERING 2036 select WEAK_ORDERING
2034 default n 2037 default n
2035 help 2038 help
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 9336509f47ad..bbac51e11179 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -113,7 +113,16 @@ predef-le += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
113cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be)) 113cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be))
114cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le)) 114cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le))
115 115
116cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips) 116# For smartmips configurations, there are hundreds of warnings due to ISA overrides
117# in assembly and header files. smartmips is only supported for MIPS32r1 onwards
118# and there is no support for 64-bit. Various '.set mips2' or '.set mips3' or
119# similar directives in the kernel will spam the build logs with the following warnings:
120# Warning: the `smartmips' extension requires MIPS32 revision 1 or greater
121# or
122# Warning: the 64-bit MIPS architecture does not support the `smartmips' extension
123# Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has
124# been fixed properly.
125cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips) -Wa,--no-warn
117cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,-mmicromips) 126cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,-mmicromips)
118 127
119cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \ 128cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \
diff --git a/arch/mips/bcm63xx/irq.c b/arch/mips/bcm63xx/irq.c
index 37eb2d1fa69a..b94bf44d8d8e 100644
--- a/arch/mips/bcm63xx/irq.c
+++ b/arch/mips/bcm63xx/irq.c
@@ -434,7 +434,7 @@ static void bcm63xx_init_irq(void)
434 irq_stat_addr[0] += PERF_IRQSTAT_3368_REG; 434 irq_stat_addr[0] += PERF_IRQSTAT_3368_REG;
435 irq_mask_addr[0] += PERF_IRQMASK_3368_REG; 435 irq_mask_addr[0] += PERF_IRQMASK_3368_REG;
436 irq_stat_addr[1] = 0; 436 irq_stat_addr[1] = 0;
437 irq_stat_addr[1] = 0; 437 irq_mask_addr[1] = 0;
438 irq_bits = 32; 438 irq_bits = 32;
439 ext_irq_count = 4; 439 ext_irq_count = 4;
440 ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368; 440 ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368;
@@ -443,7 +443,7 @@ static void bcm63xx_init_irq(void)
443 irq_stat_addr[0] += PERF_IRQSTAT_6328_REG(0); 443 irq_stat_addr[0] += PERF_IRQSTAT_6328_REG(0);
444 irq_mask_addr[0] += PERF_IRQMASK_6328_REG(0); 444 irq_mask_addr[0] += PERF_IRQMASK_6328_REG(0);
445 irq_stat_addr[1] += PERF_IRQSTAT_6328_REG(1); 445 irq_stat_addr[1] += PERF_IRQSTAT_6328_REG(1);
446 irq_stat_addr[1] += PERF_IRQMASK_6328_REG(1); 446 irq_mask_addr[1] += PERF_IRQMASK_6328_REG(1);
447 irq_bits = 64; 447 irq_bits = 64;
448 ext_irq_count = 4; 448 ext_irq_count = 4;
449 is_ext_irq_cascaded = 1; 449 is_ext_irq_cascaded = 1;
diff --git a/arch/mips/boot/compressed/decompress.c b/arch/mips/boot/compressed/decompress.c
index b49c7adbfa89..31903cf9709d 100644
--- a/arch/mips/boot/compressed/decompress.c
+++ b/arch/mips/boot/compressed/decompress.c
@@ -13,6 +13,7 @@
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/string.h>
16 17
17#include <asm/addrspace.h> 18#include <asm/addrspace.h>
18 19
diff --git a/arch/mips/configs/gpr_defconfig b/arch/mips/configs/gpr_defconfig
index 8f219dac9598..e24feb0633aa 100644
--- a/arch/mips/configs/gpr_defconfig
+++ b/arch/mips/configs/gpr_defconfig
@@ -19,6 +19,7 @@ CONFIG_MODULE_UNLOAD=y
19# CONFIG_BLK_DEV_BSG is not set 19# CONFIG_BLK_DEV_BSG is not set
20CONFIG_PCI=y 20CONFIG_PCI=y
21CONFIG_BINFMT_MISC=m 21CONFIG_BINFMT_MISC=m
22CONFIG_NET=y
22CONFIG_PACKET=y 23CONFIG_PACKET=y
23CONFIG_UNIX=y 24CONFIG_UNIX=y
24CONFIG_INET=y 25CONFIG_INET=y
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index cc0756021398..48e16d98b2cc 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -28,6 +28,7 @@ CONFIG_MIPS32_COMPAT=y
28CONFIG_MIPS32_O32=y 28CONFIG_MIPS32_O32=y
29CONFIG_MIPS32_N32=y 29CONFIG_MIPS32_N32=y
30CONFIG_PM=y 30CONFIG_PM=y
31CONFIG_NET=y
31CONFIG_PACKET=y 32CONFIG_PACKET=y
32CONFIG_UNIX=y 33CONFIG_UNIX=y
33CONFIG_XFRM_USER=m 34CONFIG_XFRM_USER=m
diff --git a/arch/mips/configs/jazz_defconfig b/arch/mips/configs/jazz_defconfig
index 2575302aa2be..4f37a5985459 100644
--- a/arch/mips/configs/jazz_defconfig
+++ b/arch/mips/configs/jazz_defconfig
@@ -18,6 +18,7 @@ CONFIG_MODULE_UNLOAD=y
18CONFIG_MODVERSIONS=y 18CONFIG_MODVERSIONS=y
19CONFIG_BINFMT_MISC=m 19CONFIG_BINFMT_MISC=m
20CONFIG_PM=y 20CONFIG_PM=y
21CONFIG_NET=y
21CONFIG_PACKET=m 22CONFIG_PACKET=m
22CONFIG_UNIX=y 23CONFIG_UNIX=y
23CONFIG_NET_KEY=m 24CONFIG_NET_KEY=m
diff --git a/arch/mips/configs/loongson3_defconfig b/arch/mips/configs/loongson3_defconfig
index 4cb787ff273e..1c6191ebd583 100644
--- a/arch/mips/configs/loongson3_defconfig
+++ b/arch/mips/configs/loongson3_defconfig
@@ -59,6 +59,7 @@ CONFIG_MIPS32_COMPAT=y
59CONFIG_MIPS32_O32=y 59CONFIG_MIPS32_O32=y
60CONFIG_MIPS32_N32=y 60CONFIG_MIPS32_N32=y
61CONFIG_PM_RUNTIME=y 61CONFIG_PM_RUNTIME=y
62CONFIG_NET=y
62CONFIG_PACKET=y 63CONFIG_PACKET=y
63CONFIG_UNIX=y 64CONFIG_UNIX=y
64CONFIG_XFRM_USER=y 65CONFIG_XFRM_USER=y
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig
index e18741ea1771..f57b96dcf7df 100644
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@ -19,6 +19,7 @@ CONFIG_MODULE_UNLOAD=y
19CONFIG_MODVERSIONS=y 19CONFIG_MODVERSIONS=y
20CONFIG_MODULE_SRCVERSION_ALL=y 20CONFIG_MODULE_SRCVERSION_ALL=y
21CONFIG_PCI=y 21CONFIG_PCI=y
22CONFIG_NET=y
22CONFIG_PACKET=y 23CONFIG_PACKET=y
23CONFIG_UNIX=y 24CONFIG_UNIX=y
24CONFIG_XFRM_USER=m 25CONFIG_XFRM_USER=m
diff --git a/arch/mips/configs/malta_kvm_defconfig b/arch/mips/configs/malta_kvm_defconfig
index cf0e01f814e1..d41742dd26c8 100644
--- a/arch/mips/configs/malta_kvm_defconfig
+++ b/arch/mips/configs/malta_kvm_defconfig
@@ -20,6 +20,7 @@ CONFIG_MODULE_UNLOAD=y
20CONFIG_MODVERSIONS=y 20CONFIG_MODVERSIONS=y
21CONFIG_MODULE_SRCVERSION_ALL=y 21CONFIG_MODULE_SRCVERSION_ALL=y
22CONFIG_PCI=y 22CONFIG_PCI=y
23CONFIG_NET=y
23CONFIG_PACKET=y 24CONFIG_PACKET=y
24CONFIG_UNIX=y 25CONFIG_UNIX=y
25CONFIG_XFRM_USER=m 26CONFIG_XFRM_USER=m
diff --git a/arch/mips/configs/malta_kvm_guest_defconfig b/arch/mips/configs/malta_kvm_guest_defconfig
index edd9ec9cb678..a7806e83ea0f 100644
--- a/arch/mips/configs/malta_kvm_guest_defconfig
+++ b/arch/mips/configs/malta_kvm_guest_defconfig
@@ -19,6 +19,7 @@ CONFIG_MODULE_UNLOAD=y
19CONFIG_MODVERSIONS=y 19CONFIG_MODVERSIONS=y
20CONFIG_MODULE_SRCVERSION_ALL=y 20CONFIG_MODULE_SRCVERSION_ALL=y
21CONFIG_PCI=y 21CONFIG_PCI=y
22CONFIG_NET=y
22CONFIG_PACKET=y 23CONFIG_PACKET=y
23CONFIG_UNIX=y 24CONFIG_UNIX=y
24CONFIG_XFRM_USER=m 25CONFIG_XFRM_USER=m
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig
index d269a5326a30..9b6926d6bb32 100644
--- a/arch/mips/configs/mtx1_defconfig
+++ b/arch/mips/configs/mtx1_defconfig
@@ -27,6 +27,7 @@ CONFIG_PD6729=m
27CONFIG_I82092=m 27CONFIG_I82092=m
28CONFIG_BINFMT_MISC=m 28CONFIG_BINFMT_MISC=m
29CONFIG_PM=y 29CONFIG_PM=y
30CONFIG_NET=y
30CONFIG_PACKET=m 31CONFIG_PACKET=m
31CONFIG_UNIX=y 32CONFIG_UNIX=y
32CONFIG_XFRM_USER=m 33CONFIG_XFRM_USER=m
diff --git a/arch/mips/configs/nlm_xlp_defconfig b/arch/mips/configs/nlm_xlp_defconfig
index 2f660e9a0da6..70509a48df82 100644
--- a/arch/mips/configs/nlm_xlp_defconfig
+++ b/arch/mips/configs/nlm_xlp_defconfig
@@ -63,6 +63,7 @@ CONFIG_MIPS32_O32=y
63CONFIG_MIPS32_N32=y 63CONFIG_MIPS32_N32=y
64CONFIG_PM_RUNTIME=y 64CONFIG_PM_RUNTIME=y
65CONFIG_PM_DEBUG=y 65CONFIG_PM_DEBUG=y
66CONFIG_NET=y
66CONFIG_PACKET=y 67CONFIG_PACKET=y
67CONFIG_UNIX=y 68CONFIG_UNIX=y
68CONFIG_XFRM_USER=m 69CONFIG_XFRM_USER=m
diff --git a/arch/mips/configs/nlm_xlr_defconfig b/arch/mips/configs/nlm_xlr_defconfig
index c6f84655c98a..82207e8079f3 100644
--- a/arch/mips/configs/nlm_xlr_defconfig
+++ b/arch/mips/configs/nlm_xlr_defconfig
@@ -43,6 +43,7 @@ CONFIG_PCI_DEBUG=y
43CONFIG_BINFMT_MISC=m 43CONFIG_BINFMT_MISC=m
44CONFIG_PM_RUNTIME=y 44CONFIG_PM_RUNTIME=y
45CONFIG_PM_DEBUG=y 45CONFIG_PM_DEBUG=y
46CONFIG_NET=y
46CONFIG_PACKET=y 47CONFIG_PACKET=y
47CONFIG_UNIX=y 48CONFIG_UNIX=y
48CONFIG_XFRM_USER=m 49CONFIG_XFRM_USER=m
diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig
index 29d79ae8a823..db029f4ff759 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -20,6 +20,7 @@ CONFIG_MODVERSIONS=y
20CONFIG_PCI=y 20CONFIG_PCI=y
21CONFIG_BINFMT_MISC=m 21CONFIG_BINFMT_MISC=m
22CONFIG_PM=y 22CONFIG_PM=y
23CONFIG_NET=y
23CONFIG_PACKET=m 24CONFIG_PACKET=m
24CONFIG_UNIX=y 25CONFIG_UNIX=y
25CONFIG_NET_KEY=m 26CONFIG_NET_KEY=m
diff --git a/arch/mips/include/asm/cop2.h b/arch/mips/include/asm/cop2.h
index d0352983b94d..51f80bd36fcc 100644
--- a/arch/mips/include/asm/cop2.h
+++ b/arch/mips/include/asm/cop2.h
@@ -16,8 +16,8 @@
16extern void octeon_cop2_save(struct octeon_cop2_state *); 16extern void octeon_cop2_save(struct octeon_cop2_state *);
17extern void octeon_cop2_restore(struct octeon_cop2_state *); 17extern void octeon_cop2_restore(struct octeon_cop2_state *);
18 18
19#define cop2_save(r) octeon_cop2_save(r) 19#define cop2_save(r) octeon_cop2_save(&(r)->thread.cp2)
20#define cop2_restore(r) octeon_cop2_restore(r) 20#define cop2_restore(r) octeon_cop2_restore(&(r)->thread.cp2)
21 21
22#define cop2_present 1 22#define cop2_present 1
23#define cop2_lazy_restore 1 23#define cop2_lazy_restore 1
@@ -26,26 +26,26 @@ extern void octeon_cop2_restore(struct octeon_cop2_state *);
26 26
27extern void nlm_cop2_save(struct nlm_cop2_state *); 27extern void nlm_cop2_save(struct nlm_cop2_state *);
28extern void nlm_cop2_restore(struct nlm_cop2_state *); 28extern void nlm_cop2_restore(struct nlm_cop2_state *);
29#define cop2_save(r) nlm_cop2_save(r) 29
30#define cop2_restore(r) nlm_cop2_restore(r) 30#define cop2_save(r) nlm_cop2_save(&(r)->thread.cp2)
31#define cop2_restore(r) nlm_cop2_restore(&(r)->thread.cp2)
31 32
32#define cop2_present 1 33#define cop2_present 1
33#define cop2_lazy_restore 0 34#define cop2_lazy_restore 0
34 35
35#elif defined(CONFIG_CPU_LOONGSON3) 36#elif defined(CONFIG_CPU_LOONGSON3)
36 37
37#define cop2_save(r)
38#define cop2_restore(r)
39
40#define cop2_present 1 38#define cop2_present 1
41#define cop2_lazy_restore 1 39#define cop2_lazy_restore 1
40#define cop2_save(r) do { (r); } while (0)
41#define cop2_restore(r) do { (r); } while (0)
42 42
43#else 43#else
44 44
45#define cop2_present 0 45#define cop2_present 0
46#define cop2_lazy_restore 0 46#define cop2_lazy_restore 0
47#define cop2_save(r) 47#define cop2_save(r) do { (r); } while (0)
48#define cop2_restore(r) 48#define cop2_restore(r) do { (r); } while (0)
49#endif 49#endif
50 50
51enum cu2_ops { 51enum cu2_ops {
diff --git a/arch/mips/include/asm/mach-ip28/spaces.h b/arch/mips/include/asm/mach-ip28/spaces.h
index 5d6a76434d00..c4a912733b65 100644
--- a/arch/mips/include/asm/mach-ip28/spaces.h
+++ b/arch/mips/include/asm/mach-ip28/spaces.h
@@ -11,15 +11,8 @@
11#ifndef _ASM_MACH_IP28_SPACES_H 11#ifndef _ASM_MACH_IP28_SPACES_H
12#define _ASM_MACH_IP28_SPACES_H 12#define _ASM_MACH_IP28_SPACES_H
13 13
14#define CAC_BASE _AC(0xa800000000000000, UL)
15
16#define HIGHMEM_START (~0UL)
17
18#define PHYS_OFFSET _AC(0x20000000, UL) 14#define PHYS_OFFSET _AC(0x20000000, UL)
19 15
20#define UNCAC_BASE _AC(0xc0000000, UL) /* 0xa0000000 + PHYS_OFFSET */
21#define IO_BASE UNCAC_BASE
22
23#include <asm/mach-generic/spaces.h> 16#include <asm/mach-generic/spaces.h>
24 17
25#endif /* _ASM_MACH_IP28_SPACES_H */ 18#endif /* _ASM_MACH_IP28_SPACES_H */
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 5699ec3a71af..3be81803595d 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -37,7 +37,7 @@
37 37
38/* 38/*
39 * This is used for calculating the real page sizes 39 * This is used for calculating the real page sizes
40 * for FTLB or VTLB + FTLB confugrations. 40 * for FTLB or VTLB + FTLB configurations.
41 */ 41 */
42static inline unsigned int page_size_ftlb(unsigned int mmuextdef) 42static inline unsigned int page_size_ftlb(unsigned int mmuextdef)
43{ 43{
@@ -223,7 +223,8 @@ static inline int pfn_valid(unsigned long pfn)
223 223
224#endif 224#endif
225 225
226#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr))) 226#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \
227 (kaddr))))
227 228
228extern int __virt_addr_valid(const volatile void *kaddr); 229extern int __virt_addr_valid(const volatile void *kaddr);
229#define virt_addr_valid(kaddr) \ 230#define virt_addr_valid(kaddr) \
diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h
index 1e0f20a9cdda..eacf865d21c2 100644
--- a/arch/mips/include/asm/smp.h
+++ b/arch/mips/include/asm/smp.h
@@ -37,11 +37,6 @@ extern int __cpu_logical_map[NR_CPUS];
37 37
38#define NO_PROC_ID (-1) 38#define NO_PROC_ID (-1)
39 39
40#define topology_physical_package_id(cpu) (cpu_data[cpu].package)
41#define topology_core_id(cpu) (cpu_data[cpu].core)
42#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
43#define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu])
44
45#define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */ 40#define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */
46#define SMP_CALL_FUNCTION 0x2 41#define SMP_CALL_FUNCTION 0x2
47/* Octeon - Tell another core to flush its icache */ 42/* Octeon - Tell another core to flush its icache */
diff --git a/arch/mips/include/asm/switch_to.h b/arch/mips/include/asm/switch_to.h
index 495c1041a2cc..b928b6f898cd 100644
--- a/arch/mips/include/asm/switch_to.h
+++ b/arch/mips/include/asm/switch_to.h
@@ -92,7 +92,7 @@ do { \
92 KSTK_STATUS(prev) &= ~ST0_CU2; \ 92 KSTK_STATUS(prev) &= ~ST0_CU2; \
93 __c0_stat = read_c0_status(); \ 93 __c0_stat = read_c0_status(); \
94 write_c0_status(__c0_stat | ST0_CU2); \ 94 write_c0_status(__c0_stat | ST0_CU2); \
95 cop2_save(&prev->thread.cp2); \ 95 cop2_save(prev); \
96 write_c0_status(__c0_stat & ~ST0_CU2); \ 96 write_c0_status(__c0_stat & ~ST0_CU2); \
97 } \ 97 } \
98 __clear_software_ll_bit(); \ 98 __clear_software_ll_bit(); \
@@ -111,7 +111,7 @@ do { \
111 (KSTK_STATUS(current) & ST0_CU2)) { \ 111 (KSTK_STATUS(current) & ST0_CU2)) { \
112 __c0_stat = read_c0_status(); \ 112 __c0_stat = read_c0_status(); \
113 write_c0_status(__c0_stat | ST0_CU2); \ 113 write_c0_status(__c0_stat | ST0_CU2); \
114 cop2_restore(&current->thread.cp2); \ 114 cop2_restore(current); \
115 write_c0_status(__c0_stat & ~ST0_CU2); \ 115 write_c0_status(__c0_stat & ~ST0_CU2); \
116 } \ 116 } \
117 if (cpu_has_dsp) \ 117 if (cpu_has_dsp) \
diff --git a/arch/mips/include/asm/topology.h b/arch/mips/include/asm/topology.h
index 20ea4859c822..3e307ec2afba 100644
--- a/arch/mips/include/asm/topology.h
+++ b/arch/mips/include/asm/topology.h
@@ -9,5 +9,13 @@
9#define __ASM_TOPOLOGY_H 9#define __ASM_TOPOLOGY_H
10 10
11#include <topology.h> 11#include <topology.h>
12#include <linux/smp.h>
13
14#ifdef CONFIG_SMP
15#define topology_physical_package_id(cpu) (cpu_data[cpu].package)
16#define topology_core_id(cpu) (cpu_data[cpu].core)
17#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
18#define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu])
19#endif
12 20
13#endif /* __ASM_TOPOLOGY_H */ 21#endif /* __ASM_TOPOLOGY_H */
diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h
index 9bc13eaf9d67..fdb4923777d1 100644
--- a/arch/mips/include/uapi/asm/unistd.h
+++ b/arch/mips/include/uapi/asm/unistd.h
@@ -373,16 +373,18 @@
373#define __NR_sched_getattr (__NR_Linux + 350) 373#define __NR_sched_getattr (__NR_Linux + 350)
374#define __NR_renameat2 (__NR_Linux + 351) 374#define __NR_renameat2 (__NR_Linux + 351)
375#define __NR_seccomp (__NR_Linux + 352) 375#define __NR_seccomp (__NR_Linux + 352)
376#define __NR_getrandom (__NR_Linux + 353)
377#define __NR_memfd_create (__NR_Linux + 354)
376 378
377/* 379/*
378 * Offset of the last Linux o32 flavoured syscall 380 * Offset of the last Linux o32 flavoured syscall
379 */ 381 */
380#define __NR_Linux_syscalls 352 382#define __NR_Linux_syscalls 354
381 383
382#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 384#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
383 385
384#define __NR_O32_Linux 4000 386#define __NR_O32_Linux 4000
385#define __NR_O32_Linux_syscalls 352 387#define __NR_O32_Linux_syscalls 354
386 388
387#if _MIPS_SIM == _MIPS_SIM_ABI64 389#if _MIPS_SIM == _MIPS_SIM_ABI64
388 390
@@ -703,16 +705,18 @@
703#define __NR_sched_getattr (__NR_Linux + 310) 705#define __NR_sched_getattr (__NR_Linux + 310)
704#define __NR_renameat2 (__NR_Linux + 311) 706#define __NR_renameat2 (__NR_Linux + 311)
705#define __NR_seccomp (__NR_Linux + 312) 707#define __NR_seccomp (__NR_Linux + 312)
708#define __NR_getrandom (__NR_Linux + 313)
709#define __NR_memfd_create (__NR_Linux + 314)
706 710
707/* 711/*
708 * Offset of the last Linux 64-bit flavoured syscall 712 * Offset of the last Linux 64-bit flavoured syscall
709 */ 713 */
710#define __NR_Linux_syscalls 312 714#define __NR_Linux_syscalls 314
711 715
712#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 716#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
713 717
714#define __NR_64_Linux 5000 718#define __NR_64_Linux 5000
715#define __NR_64_Linux_syscalls 312 719#define __NR_64_Linux_syscalls 314
716 720
717#if _MIPS_SIM == _MIPS_SIM_NABI32 721#if _MIPS_SIM == _MIPS_SIM_NABI32
718 722
@@ -1037,15 +1041,17 @@
1037#define __NR_sched_getattr (__NR_Linux + 314) 1041#define __NR_sched_getattr (__NR_Linux + 314)
1038#define __NR_renameat2 (__NR_Linux + 315) 1042#define __NR_renameat2 (__NR_Linux + 315)
1039#define __NR_seccomp (__NR_Linux + 316) 1043#define __NR_seccomp (__NR_Linux + 316)
1044#define __NR_getrandom (__NR_Linux + 317)
1045#define __NR_memfd_create (__NR_Linux + 318)
1040 1046
1041/* 1047/*
1042 * Offset of the last N32 flavoured syscall 1048 * Offset of the last N32 flavoured syscall
1043 */ 1049 */
1044#define __NR_Linux_syscalls 316 1050#define __NR_Linux_syscalls 318
1045 1051
1046#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 1052#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
1047 1053
1048#define __NR_N32_Linux 6000 1054#define __NR_N32_Linux 6000
1049#define __NR_N32_Linux_syscalls 316 1055#define __NR_N32_Linux_syscalls 318
1050 1056
1051#endif /* _UAPI_ASM_UNISTD_H */ 1057#endif /* _UAPI_ASM_UNISTD_H */
diff --git a/arch/mips/kernel/machine_kexec.c b/arch/mips/kernel/machine_kexec.c
index 992e18474da5..50980bf3983e 100644
--- a/arch/mips/kernel/machine_kexec.c
+++ b/arch/mips/kernel/machine_kexec.c
@@ -71,8 +71,12 @@ machine_kexec(struct kimage *image)
71 kexec_start_address = 71 kexec_start_address =
72 (unsigned long) phys_to_virt(image->start); 72 (unsigned long) phys_to_virt(image->start);
73 73
74 kexec_indirection_page = 74 if (image->type == KEXEC_TYPE_DEFAULT) {
75 (unsigned long) phys_to_virt(image->head & PAGE_MASK); 75 kexec_indirection_page =
76 (unsigned long) phys_to_virt(image->head & PAGE_MASK);
77 } else {
78 kexec_indirection_page = (unsigned long)&image->head;
79 }
76 80
77 memcpy((void*)reboot_code_buffer, relocate_new_kernel, 81 memcpy((void*)reboot_code_buffer, relocate_new_kernel,
78 relocate_new_kernel_size); 82 relocate_new_kernel_size);
diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S
index 5d25462de8a6..2f7c734771f4 100644
--- a/arch/mips/kernel/mcount.S
+++ b/arch/mips/kernel/mcount.S
@@ -129,7 +129,11 @@ NESTED(_mcount, PT_SIZE, ra)
129 nop 129 nop
130#endif 130#endif
131 b ftrace_stub 131 b ftrace_stub
132#ifdef CONFIG_32BIT
133 addiu sp, sp, 8
134#else
132 nop 135 nop
136#endif
133 137
134static_trace: 138static_trace:
135 MCOUNT_SAVE_REGS 139 MCOUNT_SAVE_REGS
@@ -139,6 +143,9 @@ static_trace:
139 move a1, AT /* arg2: parent's return address */ 143 move a1, AT /* arg2: parent's return address */
140 144
141 MCOUNT_RESTORE_REGS 145 MCOUNT_RESTORE_REGS
146#ifdef CONFIG_32BIT
147 addiu sp, sp, 8
148#endif
142 .globl ftrace_stub 149 .globl ftrace_stub
143ftrace_stub: 150ftrace_stub:
144 RETURN_BACK 151 RETURN_BACK
@@ -183,6 +190,11 @@ NESTED(ftrace_graph_caller, PT_SIZE, ra)
183 jal prepare_ftrace_return 190 jal prepare_ftrace_return
184 nop 191 nop
185 MCOUNT_RESTORE_REGS 192 MCOUNT_RESTORE_REGS
193#ifndef CONFIG_DYNAMIC_FTRACE
194#ifdef CONFIG_32BIT
195 addiu sp, sp, 8
196#endif
197#endif
186 RETURN_BACK 198 RETURN_BACK
187 END(ftrace_graph_caller) 199 END(ftrace_graph_caller)
188 200
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index f93b4cbec739..744cd10ba599 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -577,3 +577,5 @@ EXPORT(sys_call_table)
577 PTR sys_sched_getattr /* 4350 */ 577 PTR sys_sched_getattr /* 4350 */
578 PTR sys_renameat2 578 PTR sys_renameat2
579 PTR sys_seccomp 579 PTR sys_seccomp
580 PTR sys_getrandom
581 PTR sys_memfd_create
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index 03ebd9979ad2..002b1bc09c38 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -432,4 +432,6 @@ EXPORT(sys_call_table)
432 PTR sys_sched_getattr /* 5310 */ 432 PTR sys_sched_getattr /* 5310 */
433 PTR sys_renameat2 433 PTR sys_renameat2
434 PTR sys_seccomp 434 PTR sys_seccomp
435 PTR sys_getrandom
436 PTR sys_memfd_create
435 .size sys_call_table,.-sys_call_table 437 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index ebc9228e2e15..ca6cbbe9805b 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -425,4 +425,6 @@ EXPORT(sysn32_call_table)
425 PTR sys_sched_getattr 425 PTR sys_sched_getattr
426 PTR sys_renameat2 /* 6315 */ 426 PTR sys_renameat2 /* 6315 */
427 PTR sys_seccomp 427 PTR sys_seccomp
428 PTR sys_getrandom
429 PTR sys_memfd_create
428 .size sysn32_call_table,.-sysn32_call_table 430 .size sysn32_call_table,.-sysn32_call_table
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 25bb8400156d..9e10d11fbb84 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -562,4 +562,6 @@ EXPORT(sys32_call_table)
562 PTR sys_sched_getattr /* 4350 */ 562 PTR sys_sched_getattr /* 4350 */
563 PTR sys_renameat2 563 PTR sys_renameat2
564 PTR sys_seccomp 564 PTR sys_seccomp
565 PTR sys_getrandom
566 PTR sys_memfd_create
565 .size sys32_call_table,.-sys32_call_table 567 .size sys32_call_table,.-sys32_call_table
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index bf0fc6b16ad9..7a4727795a70 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -650,9 +650,9 @@ static inline int cop1_64bit(struct pt_regs *xcp)
650#define SIFROMREG(si, x) \ 650#define SIFROMREG(si, x) \
651do { \ 651do { \
652 if (cop1_64bit(xcp)) \ 652 if (cop1_64bit(xcp)) \
653 (si) = get_fpr32(&ctx->fpr[x], 0); \ 653 (si) = (int)get_fpr32(&ctx->fpr[x], 0); \
654 else \ 654 else \
655 (si) = get_fpr32(&ctx->fpr[(x) & ~1], (x) & 1); \ 655 (si) = (int)get_fpr32(&ctx->fpr[(x) & ~1], (x) & 1); \
656} while (0) 656} while (0)
657 657
658#define SITOREG(si, x) \ 658#define SITOREG(si, x) \
@@ -667,7 +667,7 @@ do { \
667 } \ 667 } \
668} while (0) 668} while (0)
669 669
670#define SIFROMHREG(si, x) ((si) = get_fpr32(&ctx->fpr[x], 1)) 670#define SIFROMHREG(si, x) ((si) = (int)get_fpr32(&ctx->fpr[x], 1))
671 671
672#define SITOHREG(si, x) \ 672#define SITOHREG(si, x) \
673do { \ 673do { \
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 571aab064936..f42e35e42790 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -53,6 +53,7 @@
53 */ 53 */
54unsigned long empty_zero_page, zero_page_mask; 54unsigned long empty_zero_page, zero_page_mask;
55EXPORT_SYMBOL_GPL(empty_zero_page); 55EXPORT_SYMBOL_GPL(empty_zero_page);
56EXPORT_SYMBOL(zero_page_mask);
56 57
57/* 58/*
58 * Not static inline because used by IP27 special magic initialization code 59 * Not static inline because used by IP27 special magic initialization code
diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
index 05a56619ece2..9f7ecbda250c 100644
--- a/arch/mips/net/bpf_jit.c
+++ b/arch/mips/net/bpf_jit.c
@@ -793,6 +793,7 @@ static int build_body(struct jit_ctx *ctx)
793 const struct sock_filter *inst; 793 const struct sock_filter *inst;
794 unsigned int i, off, load_order, condt; 794 unsigned int i, off, load_order, condt;
795 u32 k, b_off __maybe_unused; 795 u32 k, b_off __maybe_unused;
796 int tmp;
796 797
797 for (i = 0; i < prog->len; i++) { 798 for (i = 0; i < prog->len; i++) {
798 u16 code; 799 u16 code;
@@ -1332,9 +1333,9 @@ jmp_cmp:
1332 case BPF_ANC | SKF_AD_PKTTYPE: 1333 case BPF_ANC | SKF_AD_PKTTYPE:
1333 ctx->flags |= SEEN_SKB; 1334 ctx->flags |= SEEN_SKB;
1334 1335
1335 off = pkt_type_offset(); 1336 tmp = off = pkt_type_offset();
1336 1337
1337 if (off < 0) 1338 if (tmp < 0)
1338 return -1; 1339 return -1;
1339 emit_load_byte(r_tmp, r_skb, off, ctx); 1340 emit_load_byte(r_tmp, r_skb, off, ctx);
1340 /* Keep only the last 3 bits */ 1341 /* Keep only the last 3 bits */