diff options
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/branch.c | 8 | ||||
-rw-r--r-- | arch/mips/kernel/genex.S | 1 | ||||
-rw-r--r-- | arch/mips/kernel/r2300_fpu.S | 6 | ||||
-rw-r--r-- | arch/mips/kernel/r2300_switch.S | 5 | ||||
-rw-r--r-- | arch/mips/kernel/r4k_fpu.S | 27 | ||||
-rw-r--r-- | arch/mips/kernel/r4k_switch.S | 15 | ||||
-rw-r--r-- | arch/mips/kernel/r6000_fpu.S | 5 | ||||
-rw-r--r-- | arch/mips/kernel/scall32-o32.S | 1 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-64.S | 1 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-n32.S | 1 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-o32.S | 1 | ||||
-rw-r--r-- | arch/mips/kernel/setup.c | 3 |
12 files changed, 64 insertions, 10 deletions
diff --git a/arch/mips/kernel/branch.c b/arch/mips/kernel/branch.c index 7b2df224f041..4d7d99d601cc 100644 --- a/arch/mips/kernel/branch.c +++ b/arch/mips/kernel/branch.c | |||
@@ -144,7 +144,7 @@ int __mm_isBranchInstr(struct pt_regs *regs, struct mm_decoded_insn dec_insn, | |||
144 | case mm_bc1t_op: | 144 | case mm_bc1t_op: |
145 | preempt_disable(); | 145 | preempt_disable(); |
146 | if (is_fpu_owner()) | 146 | if (is_fpu_owner()) |
147 | asm volatile("cfc1\t%0,$31" : "=r" (fcr31)); | 147 | fcr31 = read_32bit_cp1_register(CP1_STATUS); |
148 | else | 148 | else |
149 | fcr31 = current->thread.fpu.fcr31; | 149 | fcr31 = current->thread.fpu.fcr31; |
150 | preempt_enable(); | 150 | preempt_enable(); |
@@ -562,11 +562,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs, | |||
562 | case cop1_op: | 562 | case cop1_op: |
563 | preempt_disable(); | 563 | preempt_disable(); |
564 | if (is_fpu_owner()) | 564 | if (is_fpu_owner()) |
565 | asm volatile( | 565 | fcr31 = read_32bit_cp1_register(CP1_STATUS); |
566 | ".set push\n" | ||
567 | "\t.set mips1\n" | ||
568 | "\tcfc1\t%0,$31\n" | ||
569 | "\t.set pop" : "=r" (fcr31)); | ||
570 | else | 566 | else |
571 | fcr31 = current->thread.fpu.fcr31; | 567 | fcr31 = current->thread.fpu.fcr31; |
572 | preempt_enable(); | 568 | preempt_enable(); |
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index ac35e12cb1f3..a5e26dd90592 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S | |||
@@ -358,6 +358,7 @@ NESTED(nmi_handler, PT_SIZE, sp) | |||
358 | .set push | 358 | .set push |
359 | /* gas fails to assemble cfc1 for some archs (octeon).*/ \ | 359 | /* gas fails to assemble cfc1 for some archs (octeon).*/ \ |
360 | .set mips1 | 360 | .set mips1 |
361 | SET_HARDFLOAT | ||
361 | cfc1 a1, fcr31 | 362 | cfc1 a1, fcr31 |
362 | li a2, ~(0x3f << 12) | 363 | li a2, ~(0x3f << 12) |
363 | and a2, a1 | 364 | and a2, a1 |
diff --git a/arch/mips/kernel/r2300_fpu.S b/arch/mips/kernel/r2300_fpu.S index f31063dbdaeb..5ce3b746cedc 100644 --- a/arch/mips/kernel/r2300_fpu.S +++ b/arch/mips/kernel/r2300_fpu.S | |||
@@ -28,6 +28,8 @@ | |||
28 | .set mips1 | 28 | .set mips1 |
29 | /* Save floating point context */ | 29 | /* Save floating point context */ |
30 | LEAF(_save_fp_context) | 30 | LEAF(_save_fp_context) |
31 | .set push | ||
32 | SET_HARDFLOAT | ||
31 | li v0, 0 # assume success | 33 | li v0, 0 # assume success |
32 | cfc1 t1,fcr31 | 34 | cfc1 t1,fcr31 |
33 | EX(swc1 $f0,(SC_FPREGS+0)(a0)) | 35 | EX(swc1 $f0,(SC_FPREGS+0)(a0)) |
@@ -65,6 +67,7 @@ LEAF(_save_fp_context) | |||
65 | EX(sw t1,(SC_FPC_CSR)(a0)) | 67 | EX(sw t1,(SC_FPC_CSR)(a0)) |
66 | cfc1 t0,$0 # implementation/version | 68 | cfc1 t0,$0 # implementation/version |
67 | jr ra | 69 | jr ra |
70 | .set pop | ||
68 | .set nomacro | 71 | .set nomacro |
69 | EX(sw t0,(SC_FPC_EIR)(a0)) | 72 | EX(sw t0,(SC_FPC_EIR)(a0)) |
70 | .set macro | 73 | .set macro |
@@ -80,6 +83,8 @@ LEAF(_save_fp_context) | |||
80 | * stack frame which might have been changed by the user. | 83 | * stack frame which might have been changed by the user. |
81 | */ | 84 | */ |
82 | LEAF(_restore_fp_context) | 85 | LEAF(_restore_fp_context) |
86 | .set push | ||
87 | SET_HARDFLOAT | ||
83 | li v0, 0 # assume success | 88 | li v0, 0 # assume success |
84 | EX(lw t0,(SC_FPC_CSR)(a0)) | 89 | EX(lw t0,(SC_FPC_CSR)(a0)) |
85 | EX(lwc1 $f0,(SC_FPREGS+0)(a0)) | 90 | EX(lwc1 $f0,(SC_FPREGS+0)(a0)) |
@@ -116,6 +121,7 @@ LEAF(_restore_fp_context) | |||
116 | EX(lwc1 $f31,(SC_FPREGS+248)(a0)) | 121 | EX(lwc1 $f31,(SC_FPREGS+248)(a0)) |
117 | jr ra | 122 | jr ra |
118 | ctc1 t0,fcr31 | 123 | ctc1 t0,fcr31 |
124 | .set pop | ||
119 | END(_restore_fp_context) | 125 | END(_restore_fp_context) |
120 | .set reorder | 126 | .set reorder |
121 | 127 | ||
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S index 20b7b040e76f..435ea652f5fa 100644 --- a/arch/mips/kernel/r2300_switch.S +++ b/arch/mips/kernel/r2300_switch.S | |||
@@ -120,6 +120,9 @@ LEAF(_restore_fp) | |||
120 | 120 | ||
121 | #define FPU_DEFAULT 0x00000000 | 121 | #define FPU_DEFAULT 0x00000000 |
122 | 122 | ||
123 | .set push | ||
124 | SET_HARDFLOAT | ||
125 | |||
123 | LEAF(_init_fpu) | 126 | LEAF(_init_fpu) |
124 | mfc0 t0, CP0_STATUS | 127 | mfc0 t0, CP0_STATUS |
125 | li t1, ST0_CU1 | 128 | li t1, ST0_CU1 |
@@ -165,3 +168,5 @@ LEAF(_init_fpu) | |||
165 | mtc1 t0, $f31 | 168 | mtc1 t0, $f31 |
166 | jr ra | 169 | jr ra |
167 | END(_init_fpu) | 170 | END(_init_fpu) |
171 | |||
172 | .set pop | ||
diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S index 8352523568e6..6c160c67984c 100644 --- a/arch/mips/kernel/r4k_fpu.S +++ b/arch/mips/kernel/r4k_fpu.S | |||
@@ -19,8 +19,12 @@ | |||
19 | #include <asm/asm-offsets.h> | 19 | #include <asm/asm-offsets.h> |
20 | #include <asm/regdef.h> | 20 | #include <asm/regdef.h> |
21 | 21 | ||
22 | /* preprocessor replaces the fp in ".set fp=64" with $30 otherwise */ | ||
23 | #undef fp | ||
24 | |||
22 | .macro EX insn, reg, src | 25 | .macro EX insn, reg, src |
23 | .set push | 26 | .set push |
27 | SET_HARDFLOAT | ||
24 | .set nomacro | 28 | .set nomacro |
25 | .ex\@: \insn \reg, \src | 29 | .ex\@: \insn \reg, \src |
26 | .set pop | 30 | .set pop |
@@ -33,12 +37,17 @@ | |||
33 | .set arch=r4000 | 37 | .set arch=r4000 |
34 | 38 | ||
35 | LEAF(_save_fp_context) | 39 | LEAF(_save_fp_context) |
40 | .set push | ||
41 | SET_HARDFLOAT | ||
36 | cfc1 t1, fcr31 | 42 | cfc1 t1, fcr31 |
43 | .set pop | ||
37 | 44 | ||
38 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) | 45 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) |
39 | .set push | 46 | .set push |
47 | SET_HARDFLOAT | ||
40 | #ifdef CONFIG_CPU_MIPS32_R2 | 48 | #ifdef CONFIG_CPU_MIPS32_R2 |
41 | .set mips64r2 | 49 | .set mips32r2 |
50 | .set fp=64 | ||
42 | mfc0 t0, CP0_STATUS | 51 | mfc0 t0, CP0_STATUS |
43 | sll t0, t0, 5 | 52 | sll t0, t0, 5 |
44 | bgez t0, 1f # skip storing odd if FR=0 | 53 | bgez t0, 1f # skip storing odd if FR=0 |
@@ -64,6 +73,8 @@ LEAF(_save_fp_context) | |||
64 | 1: .set pop | 73 | 1: .set pop |
65 | #endif | 74 | #endif |
66 | 75 | ||
76 | .set push | ||
77 | SET_HARDFLOAT | ||
67 | /* Store the 16 even double precision registers */ | 78 | /* Store the 16 even double precision registers */ |
68 | EX sdc1 $f0, SC_FPREGS+0(a0) | 79 | EX sdc1 $f0, SC_FPREGS+0(a0) |
69 | EX sdc1 $f2, SC_FPREGS+16(a0) | 80 | EX sdc1 $f2, SC_FPREGS+16(a0) |
@@ -84,11 +95,14 @@ LEAF(_save_fp_context) | |||
84 | EX sw t1, SC_FPC_CSR(a0) | 95 | EX sw t1, SC_FPC_CSR(a0) |
85 | jr ra | 96 | jr ra |
86 | li v0, 0 # success | 97 | li v0, 0 # success |
98 | .set pop | ||
87 | END(_save_fp_context) | 99 | END(_save_fp_context) |
88 | 100 | ||
89 | #ifdef CONFIG_MIPS32_COMPAT | 101 | #ifdef CONFIG_MIPS32_COMPAT |
90 | /* Save 32-bit process floating point context */ | 102 | /* Save 32-bit process floating point context */ |
91 | LEAF(_save_fp_context32) | 103 | LEAF(_save_fp_context32) |
104 | .set push | ||
105 | SET_HARDFLOAT | ||
92 | cfc1 t1, fcr31 | 106 | cfc1 t1, fcr31 |
93 | 107 | ||
94 | mfc0 t0, CP0_STATUS | 108 | mfc0 t0, CP0_STATUS |
@@ -134,6 +148,7 @@ LEAF(_save_fp_context32) | |||
134 | EX sw t1, SC32_FPC_CSR(a0) | 148 | EX sw t1, SC32_FPC_CSR(a0) |
135 | cfc1 t0, $0 # implementation/version | 149 | cfc1 t0, $0 # implementation/version |
136 | EX sw t0, SC32_FPC_EIR(a0) | 150 | EX sw t0, SC32_FPC_EIR(a0) |
151 | .set pop | ||
137 | 152 | ||
138 | jr ra | 153 | jr ra |
139 | li v0, 0 # success | 154 | li v0, 0 # success |
@@ -150,8 +165,10 @@ LEAF(_restore_fp_context) | |||
150 | 165 | ||
151 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) | 166 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) |
152 | .set push | 167 | .set push |
168 | SET_HARDFLOAT | ||
153 | #ifdef CONFIG_CPU_MIPS32_R2 | 169 | #ifdef CONFIG_CPU_MIPS32_R2 |
154 | .set mips64r2 | 170 | .set mips32r2 |
171 | .set fp=64 | ||
155 | mfc0 t0, CP0_STATUS | 172 | mfc0 t0, CP0_STATUS |
156 | sll t0, t0, 5 | 173 | sll t0, t0, 5 |
157 | bgez t0, 1f # skip loading odd if FR=0 | 174 | bgez t0, 1f # skip loading odd if FR=0 |
@@ -175,6 +192,8 @@ LEAF(_restore_fp_context) | |||
175 | EX ldc1 $f31, SC_FPREGS+248(a0) | 192 | EX ldc1 $f31, SC_FPREGS+248(a0) |
176 | 1: .set pop | 193 | 1: .set pop |
177 | #endif | 194 | #endif |
195 | .set push | ||
196 | SET_HARDFLOAT | ||
178 | EX ldc1 $f0, SC_FPREGS+0(a0) | 197 | EX ldc1 $f0, SC_FPREGS+0(a0) |
179 | EX ldc1 $f2, SC_FPREGS+16(a0) | 198 | EX ldc1 $f2, SC_FPREGS+16(a0) |
180 | EX ldc1 $f4, SC_FPREGS+32(a0) | 199 | EX ldc1 $f4, SC_FPREGS+32(a0) |
@@ -192,6 +211,7 @@ LEAF(_restore_fp_context) | |||
192 | EX ldc1 $f28, SC_FPREGS+224(a0) | 211 | EX ldc1 $f28, SC_FPREGS+224(a0) |
193 | EX ldc1 $f30, SC_FPREGS+240(a0) | 212 | EX ldc1 $f30, SC_FPREGS+240(a0) |
194 | ctc1 t1, fcr31 | 213 | ctc1 t1, fcr31 |
214 | .set pop | ||
195 | jr ra | 215 | jr ra |
196 | li v0, 0 # success | 216 | li v0, 0 # success |
197 | END(_restore_fp_context) | 217 | END(_restore_fp_context) |
@@ -199,6 +219,8 @@ LEAF(_restore_fp_context) | |||
199 | #ifdef CONFIG_MIPS32_COMPAT | 219 | #ifdef CONFIG_MIPS32_COMPAT |
200 | LEAF(_restore_fp_context32) | 220 | LEAF(_restore_fp_context32) |
201 | /* Restore an o32 sigcontext. */ | 221 | /* Restore an o32 sigcontext. */ |
222 | .set push | ||
223 | SET_HARDFLOAT | ||
202 | EX lw t1, SC32_FPC_CSR(a0) | 224 | EX lw t1, SC32_FPC_CSR(a0) |
203 | 225 | ||
204 | mfc0 t0, CP0_STATUS | 226 | mfc0 t0, CP0_STATUS |
@@ -242,6 +264,7 @@ LEAF(_restore_fp_context32) | |||
242 | ctc1 t1, fcr31 | 264 | ctc1 t1, fcr31 |
243 | jr ra | 265 | jr ra |
244 | li v0, 0 # success | 266 | li v0, 0 # success |
267 | .set pop | ||
245 | END(_restore_fp_context32) | 268 | END(_restore_fp_context32) |
246 | #endif | 269 | #endif |
247 | 270 | ||
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S index 4c4ec1812420..64591e671878 100644 --- a/arch/mips/kernel/r4k_switch.S +++ b/arch/mips/kernel/r4k_switch.S | |||
@@ -22,6 +22,9 @@ | |||
22 | 22 | ||
23 | #include <asm/asmmacro.h> | 23 | #include <asm/asmmacro.h> |
24 | 24 | ||
25 | /* preprocessor replaces the fp in ".set fp=64" with $30 otherwise */ | ||
26 | #undef fp | ||
27 | |||
25 | /* | 28 | /* |
26 | * Offset to the current process status flags, the first 32 bytes of the | 29 | * Offset to the current process status flags, the first 32 bytes of the |
27 | * stack are not used. | 30 | * stack are not used. |
@@ -65,8 +68,12 @@ | |||
65 | bgtz a3, 1f | 68 | bgtz a3, 1f |
66 | 69 | ||
67 | /* Save 128b MSA vector context + scalar FP control & status. */ | 70 | /* Save 128b MSA vector context + scalar FP control & status. */ |
71 | .set push | ||
72 | SET_HARDFLOAT | ||
68 | cfc1 t1, fcr31 | 73 | cfc1 t1, fcr31 |
69 | msa_save_all a0 | 74 | msa_save_all a0 |
75 | .set pop /* SET_HARDFLOAT */ | ||
76 | |||
70 | sw t1, THREAD_FCR31(a0) | 77 | sw t1, THREAD_FCR31(a0) |
71 | b 2f | 78 | b 2f |
72 | 79 | ||
@@ -161,6 +168,9 @@ LEAF(_init_msa_upper) | |||
161 | 168 | ||
162 | #define FPU_DEFAULT 0x00000000 | 169 | #define FPU_DEFAULT 0x00000000 |
163 | 170 | ||
171 | .set push | ||
172 | SET_HARDFLOAT | ||
173 | |||
164 | LEAF(_init_fpu) | 174 | LEAF(_init_fpu) |
165 | mfc0 t0, CP0_STATUS | 175 | mfc0 t0, CP0_STATUS |
166 | li t1, ST0_CU1 | 176 | li t1, ST0_CU1 |
@@ -232,7 +242,8 @@ LEAF(_init_fpu) | |||
232 | 242 | ||
233 | #ifdef CONFIG_CPU_MIPS32_R2 | 243 | #ifdef CONFIG_CPU_MIPS32_R2 |
234 | .set push | 244 | .set push |
235 | .set mips64r2 | 245 | .set mips32r2 |
246 | .set fp=64 | ||
236 | sll t0, t0, 5 # is Status.FR set? | 247 | sll t0, t0, 5 # is Status.FR set? |
237 | bgez t0, 1f # no: skip setting upper 32b | 248 | bgez t0, 1f # no: skip setting upper 32b |
238 | 249 | ||
@@ -291,3 +302,5 @@ LEAF(_init_fpu) | |||
291 | #endif | 302 | #endif |
292 | jr ra | 303 | jr ra |
293 | END(_init_fpu) | 304 | END(_init_fpu) |
305 | |||
306 | .set pop /* SET_HARDFLOAT */ | ||
diff --git a/arch/mips/kernel/r6000_fpu.S b/arch/mips/kernel/r6000_fpu.S index da0fbe46d83b..47077380c15c 100644 --- a/arch/mips/kernel/r6000_fpu.S +++ b/arch/mips/kernel/r6000_fpu.S | |||
@@ -18,6 +18,9 @@ | |||
18 | 18 | ||
19 | .set noreorder | 19 | .set noreorder |
20 | .set mips2 | 20 | .set mips2 |
21 | .set push | ||
22 | SET_HARDFLOAT | ||
23 | |||
21 | /* Save floating point context */ | 24 | /* Save floating point context */ |
22 | LEAF(_save_fp_context) | 25 | LEAF(_save_fp_context) |
23 | mfc0 t0,CP0_STATUS | 26 | mfc0 t0,CP0_STATUS |
@@ -85,3 +88,5 @@ | |||
85 | 1: jr ra | 88 | 1: jr ra |
86 | nop | 89 | nop |
87 | END(_restore_fp_context) | 90 | END(_restore_fp_context) |
91 | |||
92 | .set pop /* SET_HARDFLOAT */ | ||
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 744cd10ba599..00cad1005a16 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -579,3 +579,4 @@ EXPORT(sys_call_table) | |||
579 | PTR sys_seccomp | 579 | PTR sys_seccomp |
580 | PTR sys_getrandom | 580 | PTR sys_getrandom |
581 | PTR sys_memfd_create | 581 | PTR sys_memfd_create |
582 | PTR sys_bpf /* 4355 */ | ||
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 002b1bc09c38..5251565e344b 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -434,4 +434,5 @@ EXPORT(sys_call_table) | |||
434 | PTR sys_seccomp | 434 | PTR sys_seccomp |
435 | PTR sys_getrandom | 435 | PTR sys_getrandom |
436 | PTR sys_memfd_create | 436 | PTR sys_memfd_create |
437 | PTR sys_bpf /* 5315 */ | ||
437 | .size sys_call_table,.-sys_call_table | 438 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index ca6cbbe9805b..77e74398b828 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -427,4 +427,5 @@ EXPORT(sysn32_call_table) | |||
427 | PTR sys_seccomp | 427 | PTR sys_seccomp |
428 | PTR sys_getrandom | 428 | PTR sys_getrandom |
429 | PTR sys_memfd_create | 429 | PTR sys_memfd_create |
430 | PTR sys_bpf | ||
430 | .size sysn32_call_table,.-sysn32_call_table | 431 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 9e10d11fbb84..6f8db9f728e8 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -564,4 +564,5 @@ EXPORT(sys32_call_table) | |||
564 | PTR sys_seccomp | 564 | PTR sys_seccomp |
565 | PTR sys_getrandom | 565 | PTR sys_getrandom |
566 | PTR sys_memfd_create | 566 | PTR sys_memfd_create |
567 | PTR sys_bpf /* 4355 */ | ||
567 | .size sys32_call_table,.-sys32_call_table | 568 | .size sys32_call_table,.-sys32_call_table |
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index b3b8f0d9d4a7..d21ec57b6e95 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c | |||
@@ -683,7 +683,8 @@ static void __init arch_mem_init(char **cmdline_p) | |||
683 | dma_contiguous_reserve(PFN_PHYS(max_low_pfn)); | 683 | dma_contiguous_reserve(PFN_PHYS(max_low_pfn)); |
684 | /* Tell bootmem about cma reserved memblock section */ | 684 | /* Tell bootmem about cma reserved memblock section */ |
685 | for_each_memblock(reserved, reg) | 685 | for_each_memblock(reserved, reg) |
686 | reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT); | 686 | if (reg->size != 0) |
687 | reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT); | ||
687 | } | 688 | } |
688 | 689 | ||
689 | static void __init resource_init(void) | 690 | static void __init resource_init(void) |