Magellan Linux

Contents of /trunk/kernel-alx/patches-5.4/0302-5.4.203-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3635 - (show annotations) (download)
Mon Oct 24 12:34:12 2022 UTC (18 months, 1 week ago) by niro
File size: 41738 byte(s)
-sync kernel patches
1 diff --git a/Makefile b/Makefile
2 index 021878dc23f9b..86f518e49c333 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,7 +1,7 @@
6 # SPDX-License-Identifier: GPL-2.0
7 VERSION = 5
8 PATCHLEVEL = 4
9 -SUBLEVEL = 202
10 +SUBLEVEL = 203
11 EXTRAVERSION =
12 NAME = Kleptomaniac Octopus
13
14 diff --git a/arch/arm/boot/bootp/init.S b/arch/arm/boot/bootp/init.S
15 index 5c476bd2b4ce9..b562da2f70408 100644
16 --- a/arch/arm/boot/bootp/init.S
17 +++ b/arch/arm/boot/bootp/init.S
18 @@ -13,7 +13,7 @@
19 * size immediately following the kernel, we could build this into
20 * a binary blob, and concatenate the zImage using the cat command.
21 */
22 - .section .start,#alloc,#execinstr
23 + .section .start, "ax"
24 .type _start, #function
25 .globl _start
26
27 diff --git a/arch/arm/boot/compressed/big-endian.S b/arch/arm/boot/compressed/big-endian.S
28 index 88e2a88d324b2..0e092c36da2f2 100644
29 --- a/arch/arm/boot/compressed/big-endian.S
30 +++ b/arch/arm/boot/compressed/big-endian.S
31 @@ -6,7 +6,7 @@
32 * Author: Nicolas Pitre
33 */
34
35 - .section ".start", #alloc, #execinstr
36 + .section ".start", "ax"
37
38 mrc p15, 0, r0, c1, c0, 0 @ read control reg
39 orr r0, r0, #(1 << 7) @ enable big endian mode
40 diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
41 index 0a2410adc25b3..17f87f4c74f51 100644
42 --- a/arch/arm/boot/compressed/head.S
43 +++ b/arch/arm/boot/compressed/head.S
44 @@ -140,7 +140,7 @@
45 #endif
46 .endm
47
48 - .section ".start", #alloc, #execinstr
49 + .section ".start", "ax"
50 /*
51 * sort out different calling conventions
52 */
53 @@ -1274,7 +1274,7 @@ iflush:
54 __armv5tej_mmu_cache_flush:
55 tst r4, #1
56 movne pc, lr
57 -1: mrc p15, 0, r15, c7, c14, 3 @ test,clean,invalidate D cache
58 +1: mrc p15, 0, APSR_nzcv, c7, c14, 3 @ test,clean,invalidate D cache
59 bne 1b
60 mcr p15, 0, r0, c7, c5, 0 @ flush I cache
61 mcr p15, 0, r0, c7, c10, 4 @ drain WB
62 diff --git a/arch/arm/boot/compressed/piggy.S b/arch/arm/boot/compressed/piggy.S
63 index 0284f84dcf380..27577644ee721 100644
64 --- a/arch/arm/boot/compressed/piggy.S
65 +++ b/arch/arm/boot/compressed/piggy.S
66 @@ -1,5 +1,5 @@
67 /* SPDX-License-Identifier: GPL-2.0 */
68 - .section .piggydata,#alloc
69 + .section .piggydata, "a"
70 .globl input_data
71 input_data:
72 .incbin "arch/arm/boot/compressed/piggy_data"
73 diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig
74 index 043b0b18bf7e0..f747caea10ffa 100644
75 --- a/arch/arm/crypto/Kconfig
76 +++ b/arch/arm/crypto/Kconfig
77 @@ -30,7 +30,7 @@ config CRYPTO_SHA1_ARM_NEON
78
79 config CRYPTO_SHA1_ARM_CE
80 tristate "SHA1 digest algorithm (ARM v8 Crypto Extensions)"
81 - depends on KERNEL_MODE_NEON
82 + depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800)
83 select CRYPTO_SHA1_ARM
84 select CRYPTO_HASH
85 help
86 @@ -39,7 +39,7 @@ config CRYPTO_SHA1_ARM_CE
87
88 config CRYPTO_SHA2_ARM_CE
89 tristate "SHA-224/256 digest algorithm (ARM v8 Crypto Extensions)"
90 - depends on KERNEL_MODE_NEON
91 + depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800)
92 select CRYPTO_SHA256_ARM
93 select CRYPTO_HASH
94 help
95 @@ -96,7 +96,7 @@ config CRYPTO_AES_ARM_BS
96
97 config CRYPTO_AES_ARM_CE
98 tristate "Accelerated AES using ARMv8 Crypto Extensions"
99 - depends on KERNEL_MODE_NEON
100 + depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800)
101 select CRYPTO_BLKCIPHER
102 select CRYPTO_LIB_AES
103 select CRYPTO_SIMD
104 @@ -106,7 +106,7 @@ config CRYPTO_AES_ARM_CE
105
106 config CRYPTO_GHASH_ARM_CE
107 tristate "PMULL-accelerated GHASH using NEON/ARMv8 Crypto Extensions"
108 - depends on KERNEL_MODE_NEON
109 + depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800)
110 select CRYPTO_HASH
111 select CRYPTO_CRYPTD
112 select CRYPTO_GF128MUL
113 @@ -118,12 +118,14 @@ config CRYPTO_GHASH_ARM_CE
114
115 config CRYPTO_CRCT10DIF_ARM_CE
116 tristate "CRCT10DIF digest algorithm using PMULL instructions"
117 - depends on KERNEL_MODE_NEON && CRC_T10DIF
118 + depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800)
119 + depends on CRC_T10DIF
120 select CRYPTO_HASH
121
122 config CRYPTO_CRC32_ARM_CE
123 tristate "CRC32(C) digest algorithm using CRC and/or PMULL instructions"
124 - depends on KERNEL_MODE_NEON && CRC32
125 + depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800)
126 + depends on CRC32
127 select CRYPTO_HASH
128
129 config CRYPTO_CHACHA20_NEON
130 diff --git a/arch/arm/crypto/Makefile b/arch/arm/crypto/Makefile
131 index 4180f3a13512c..c0d36771a6934 100644
132 --- a/arch/arm/crypto/Makefile
133 +++ b/arch/arm/crypto/Makefile
134 @@ -12,32 +12,12 @@ obj-$(CONFIG_CRYPTO_SHA512_ARM) += sha512-arm.o
135 obj-$(CONFIG_CRYPTO_CHACHA20_NEON) += chacha-neon.o
136 obj-$(CONFIG_CRYPTO_NHPOLY1305_NEON) += nhpoly1305-neon.o
137
138 -ce-obj-$(CONFIG_CRYPTO_AES_ARM_CE) += aes-arm-ce.o
139 -ce-obj-$(CONFIG_CRYPTO_SHA1_ARM_CE) += sha1-arm-ce.o
140 -ce-obj-$(CONFIG_CRYPTO_SHA2_ARM_CE) += sha2-arm-ce.o
141 -ce-obj-$(CONFIG_CRYPTO_GHASH_ARM_CE) += ghash-arm-ce.o
142 -ce-obj-$(CONFIG_CRYPTO_CRCT10DIF_ARM_CE) += crct10dif-arm-ce.o
143 -crc-obj-$(CONFIG_CRYPTO_CRC32_ARM_CE) += crc32-arm-ce.o
144 -
145 -ifneq ($(crc-obj-y)$(crc-obj-m),)
146 -ifeq ($(call as-instr,.arch armv8-a\n.arch_extension crc,y,n),y)
147 -ce-obj-y += $(crc-obj-y)
148 -ce-obj-m += $(crc-obj-m)
149 -else
150 -$(warning These CRC Extensions modules need binutils 2.23 or higher)
151 -$(warning $(crc-obj-y) $(crc-obj-m))
152 -endif
153 -endif
154 -
155 -ifneq ($(ce-obj-y)$(ce-obj-m),)
156 -ifeq ($(call as-instr,.fpu crypto-neon-fp-armv8,y,n),y)
157 -obj-y += $(ce-obj-y)
158 -obj-m += $(ce-obj-m)
159 -else
160 -$(warning These ARMv8 Crypto Extensions modules need binutils 2.23 or higher)
161 -$(warning $(ce-obj-y) $(ce-obj-m))
162 -endif
163 -endif
164 +obj-$(CONFIG_CRYPTO_AES_ARM_CE) += aes-arm-ce.o
165 +obj-$(CONFIG_CRYPTO_SHA1_ARM_CE) += sha1-arm-ce.o
166 +obj-$(CONFIG_CRYPTO_SHA2_ARM_CE) += sha2-arm-ce.o
167 +obj-$(CONFIG_CRYPTO_GHASH_ARM_CE) += ghash-arm-ce.o
168 +obj-$(CONFIG_CRYPTO_CRCT10DIF_ARM_CE) += crct10dif-arm-ce.o
169 +obj-$(CONFIG_CRYPTO_CRC32_ARM_CE) += crc32-arm-ce.o
170
171 aes-arm-y := aes-cipher-core.o aes-cipher-glue.o
172 aes-arm-bs-y := aes-neonbs-core.o aes-neonbs-glue.o
173 diff --git a/arch/arm/crypto/crct10dif-ce-core.S b/arch/arm/crypto/crct10dif-ce-core.S
174 index 86be258a803fa..46c02c518a300 100644
175 --- a/arch/arm/crypto/crct10dif-ce-core.S
176 +++ b/arch/arm/crypto/crct10dif-ce-core.S
177 @@ -72,7 +72,7 @@
178 #endif
179
180 .text
181 - .arch armv7-a
182 + .arch armv8-a
183 .fpu crypto-neon-fp-armv8
184
185 init_crc .req r0
186 diff --git a/arch/arm/crypto/ghash-ce-core.S b/arch/arm/crypto/ghash-ce-core.S
187 index c47fe81abcb01..9f51e3fa45268 100644
188 --- a/arch/arm/crypto/ghash-ce-core.S
189 +++ b/arch/arm/crypto/ghash-ce-core.S
190 @@ -8,6 +8,9 @@
191 #include <linux/linkage.h>
192 #include <asm/assembler.h>
193
194 + .arch armv8-a
195 + .fpu crypto-neon-fp-armv8
196 +
197 SHASH .req q0
198 T1 .req q1
199 XL .req q2
200 @@ -88,7 +91,6 @@
201 T3_H .req d17
202
203 .text
204 - .fpu crypto-neon-fp-armv8
205
206 .macro __pmull_p64, rd, rn, rm, b1, b2, b3, b4
207 vmull.p64 \rd, \rn, \rm
208 diff --git a/arch/arm/crypto/sha1-ce-core.S b/arch/arm/crypto/sha1-ce-core.S
209 index 49a74a441aec7..8a702e051738a 100644
210 --- a/arch/arm/crypto/sha1-ce-core.S
211 +++ b/arch/arm/crypto/sha1-ce-core.S
212 @@ -10,6 +10,7 @@
213 #include <asm/assembler.h>
214
215 .text
216 + .arch armv8-a
217 .fpu crypto-neon-fp-armv8
218
219 k0 .req q0
220 diff --git a/arch/arm/crypto/sha2-ce-core.S b/arch/arm/crypto/sha2-ce-core.S
221 index 4ad517577e230..b6369d2440a19 100644
222 --- a/arch/arm/crypto/sha2-ce-core.S
223 +++ b/arch/arm/crypto/sha2-ce-core.S
224 @@ -10,6 +10,7 @@
225 #include <asm/assembler.h>
226
227 .text
228 + .arch armv8-a
229 .fpu crypto-neon-fp-armv8
230
231 k0 .req q7
232 diff --git a/arch/arm/crypto/sha256-armv4.pl b/arch/arm/crypto/sha256-armv4.pl
233 index a03cf4dfb7818..d927483985c2d 100644
234 --- a/arch/arm/crypto/sha256-armv4.pl
235 +++ b/arch/arm/crypto/sha256-armv4.pl
236 @@ -175,7 +175,6 @@ $code=<<___;
237 #else
238 .syntax unified
239 # ifdef __thumb2__
240 -# define adrl adr
241 .thumb
242 # else
243 .code 32
244 @@ -471,7 +470,8 @@ sha256_block_data_order_neon:
245 stmdb sp!,{r4-r12,lr}
246
247 sub $H,sp,#16*4+16
248 - adrl $Ktbl,K256
249 + adr $Ktbl,.Lsha256_block_data_order
250 + sub $Ktbl,$Ktbl,#.Lsha256_block_data_order-K256
251 bic $H,$H,#15 @ align for 128-bit stores
252 mov $t2,sp
253 mov sp,$H @ alloca
254 diff --git a/arch/arm/crypto/sha256-core.S_shipped b/arch/arm/crypto/sha256-core.S_shipped
255 index 054aae0edfce5..9deb515f3c9f2 100644
256 --- a/arch/arm/crypto/sha256-core.S_shipped
257 +++ b/arch/arm/crypto/sha256-core.S_shipped
258 @@ -56,7 +56,6 @@
259 #else
260 .syntax unified
261 # ifdef __thumb2__
262 -# define adrl adr
263 .thumb
264 # else
265 .code 32
266 @@ -1885,7 +1884,8 @@ sha256_block_data_order_neon:
267 stmdb sp!,{r4-r12,lr}
268
269 sub r11,sp,#16*4+16
270 - adrl r14,K256
271 + adr r14,.Lsha256_block_data_order
272 + sub r14,r14,#.Lsha256_block_data_order-K256
273 bic r11,r11,#15 @ align for 128-bit stores
274 mov r12,sp
275 mov sp,r11 @ alloca
276 diff --git a/arch/arm/crypto/sha512-armv4.pl b/arch/arm/crypto/sha512-armv4.pl
277 index 788c17b56ecce..2a0bdf7dd87c3 100644
278 --- a/arch/arm/crypto/sha512-armv4.pl
279 +++ b/arch/arm/crypto/sha512-armv4.pl
280 @@ -212,7 +212,6 @@ $code=<<___;
281 #else
282 .syntax unified
283 # ifdef __thumb2__
284 -# define adrl adr
285 .thumb
286 # else
287 .code 32
288 @@ -602,7 +601,8 @@ sha512_block_data_order_neon:
289 dmb @ errata #451034 on early Cortex A8
290 add $len,$inp,$len,lsl#7 @ len to point at the end of inp
291 VFP_ABI_PUSH
292 - adrl $Ktbl,K512
293 + adr $Ktbl,.Lsha512_block_data_order
294 + sub $Ktbl,$Ktbl,.Lsha512_block_data_order-K512
295 vldmia $ctx,{$A-$H} @ load context
296 .Loop_neon:
297 ___
298 diff --git a/arch/arm/crypto/sha512-core.S_shipped b/arch/arm/crypto/sha512-core.S_shipped
299 index 710ea309769e7..cf5a7a70ff008 100644
300 --- a/arch/arm/crypto/sha512-core.S_shipped
301 +++ b/arch/arm/crypto/sha512-core.S_shipped
302 @@ -79,7 +79,6 @@
303 #else
304 .syntax unified
305 # ifdef __thumb2__
306 -# define adrl adr
307 .thumb
308 # else
309 .code 32
310 @@ -543,7 +542,8 @@ sha512_block_data_order_neon:
311 dmb @ errata #451034 on early Cortex A8
312 add r2,r1,r2,lsl#7 @ len to point at the end of inp
313 VFP_ABI_PUSH
314 - adrl r3,K512
315 + adr r3,.Lsha512_block_data_order
316 + sub r3,r3,.Lsha512_block_data_order-K512
317 vldmia r0,{d16-d23} @ load context
318 .Loop_neon:
319 vshr.u64 d24,d20,#14 @ 0
320 diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
321 index 6b3e64e19fb6f..70e1c23feedb7 100644
322 --- a/arch/arm/include/asm/assembler.h
323 +++ b/arch/arm/include/asm/assembler.h
324 @@ -279,10 +279,9 @@
325 .endif ;\
326 .popsection
327 #define ALT_UP_B(label) \
328 - .equ up_b_offset, label - 9998b ;\
329 .pushsection ".alt.smp.init", "a" ;\
330 .long 9998b ;\
331 - W(b) . + up_b_offset ;\
332 + W(b) . + (label - 9998b) ;\
333 .popsection
334 #else
335 #define ALT_SMP(instr...)
336 diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
337 index 628c336e8e3b2..947ee5395e1fb 100644
338 --- a/arch/arm/include/asm/vfpmacros.h
339 +++ b/arch/arm/include/asm/vfpmacros.h
340 @@ -19,23 +19,25 @@
341
342 @ read all the working registers back into the VFP
343 .macro VFPFLDMIA, base, tmp
344 + .fpu vfpv2
345 #if __LINUX_ARM_ARCH__ < 6
346 - LDC p11, cr0, [\base],#33*4 @ FLDMIAX \base!, {d0-d15}
347 + fldmiax \base!, {d0-d15}
348 #else
349 - LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15}
350 + vldmia \base!, {d0-d15}
351 #endif
352 #ifdef CONFIG_VFPv3
353 + .fpu vfpv3
354 #if __LINUX_ARM_ARCH__ <= 6
355 ldr \tmp, =elf_hwcap @ may not have MVFR regs
356 ldr \tmp, [\tmp, #0]
357 tst \tmp, #HWCAP_VFPD32
358 - ldclne p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
359 + vldmiane \base!, {d16-d31}
360 addeq \base, \base, #32*4 @ step over unused register space
361 #else
362 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
363 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
364 cmp \tmp, #2 @ 32 x 64bit registers?
365 - ldcleq p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
366 + vldmiaeq \base!, {d16-d31}
367 addne \base, \base, #32*4 @ step over unused register space
368 #endif
369 #endif
370 @@ -44,22 +46,23 @@
371 @ write all the working registers out of the VFP
372 .macro VFPFSTMIA, base, tmp
373 #if __LINUX_ARM_ARCH__ < 6
374 - STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15}
375 + fstmiax \base!, {d0-d15}
376 #else
377 - STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15}
378 + vstmia \base!, {d0-d15}
379 #endif
380 #ifdef CONFIG_VFPv3
381 + .fpu vfpv3
382 #if __LINUX_ARM_ARCH__ <= 6
383 ldr \tmp, =elf_hwcap @ may not have MVFR regs
384 ldr \tmp, [\tmp, #0]
385 tst \tmp, #HWCAP_VFPD32
386 - stclne p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
387 + vstmiane \base!, {d16-d31}
388 addeq \base, \base, #32*4 @ step over unused register space
389 #else
390 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
391 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
392 cmp \tmp, #2 @ 32 x 64bit registers?
393 - stcleq p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
394 + vstmiaeq \base!, {d16-d31}
395 addne \base, \base, #32*4 @ step over unused register space
396 #endif
397 #endif
398 diff --git a/arch/arm/kernel/iwmmxt.S b/arch/arm/kernel/iwmmxt.S
399 index 0dcae787b004d..d2b4ac06e4ed8 100644
400 --- a/arch/arm/kernel/iwmmxt.S
401 +++ b/arch/arm/kernel/iwmmxt.S
402 @@ -16,6 +16,7 @@
403 #include <asm/thread_info.h>
404 #include <asm/asm-offsets.h>
405 #include <asm/assembler.h>
406 +#include "iwmmxt.h"
407
408 #if defined(CONFIG_CPU_PJ4) || defined(CONFIG_CPU_PJ4B)
409 #define PJ4(code...) code
410 @@ -113,33 +114,33 @@ concan_save:
411
412 concan_dump:
413
414 - wstrw wCSSF, [r1, #MMX_WCSSF]
415 - wstrw wCASF, [r1, #MMX_WCASF]
416 - wstrw wCGR0, [r1, #MMX_WCGR0]
417 - wstrw wCGR1, [r1, #MMX_WCGR1]
418 - wstrw wCGR2, [r1, #MMX_WCGR2]
419 - wstrw wCGR3, [r1, #MMX_WCGR3]
420 + wstrw wCSSF, r1, MMX_WCSSF
421 + wstrw wCASF, r1, MMX_WCASF
422 + wstrw wCGR0, r1, MMX_WCGR0
423 + wstrw wCGR1, r1, MMX_WCGR1
424 + wstrw wCGR2, r1, MMX_WCGR2
425 + wstrw wCGR3, r1, MMX_WCGR3
426
427 1: @ MUP? wRn
428 tst r2, #0x2
429 beq 2f
430
431 - wstrd wR0, [r1, #MMX_WR0]
432 - wstrd wR1, [r1, #MMX_WR1]
433 - wstrd wR2, [r1, #MMX_WR2]
434 - wstrd wR3, [r1, #MMX_WR3]
435 - wstrd wR4, [r1, #MMX_WR4]
436 - wstrd wR5, [r1, #MMX_WR5]
437 - wstrd wR6, [r1, #MMX_WR6]
438 - wstrd wR7, [r1, #MMX_WR7]
439 - wstrd wR8, [r1, #MMX_WR8]
440 - wstrd wR9, [r1, #MMX_WR9]
441 - wstrd wR10, [r1, #MMX_WR10]
442 - wstrd wR11, [r1, #MMX_WR11]
443 - wstrd wR12, [r1, #MMX_WR12]
444 - wstrd wR13, [r1, #MMX_WR13]
445 - wstrd wR14, [r1, #MMX_WR14]
446 - wstrd wR15, [r1, #MMX_WR15]
447 + wstrd wR0, r1, MMX_WR0
448 + wstrd wR1, r1, MMX_WR1
449 + wstrd wR2, r1, MMX_WR2
450 + wstrd wR3, r1, MMX_WR3
451 + wstrd wR4, r1, MMX_WR4
452 + wstrd wR5, r1, MMX_WR5
453 + wstrd wR6, r1, MMX_WR6
454 + wstrd wR7, r1, MMX_WR7
455 + wstrd wR8, r1, MMX_WR8
456 + wstrd wR9, r1, MMX_WR9
457 + wstrd wR10, r1, MMX_WR10
458 + wstrd wR11, r1, MMX_WR11
459 + wstrd wR12, r1, MMX_WR12
460 + wstrd wR13, r1, MMX_WR13
461 + wstrd wR14, r1, MMX_WR14
462 + wstrd wR15, r1, MMX_WR15
463
464 2: teq r0, #0 @ anything to load?
465 reteq lr @ if not, return
466 @@ -147,30 +148,30 @@ concan_dump:
467 concan_load:
468
469 @ Load wRn
470 - wldrd wR0, [r0, #MMX_WR0]
471 - wldrd wR1, [r0, #MMX_WR1]
472 - wldrd wR2, [r0, #MMX_WR2]
473 - wldrd wR3, [r0, #MMX_WR3]
474 - wldrd wR4, [r0, #MMX_WR4]
475 - wldrd wR5, [r0, #MMX_WR5]
476 - wldrd wR6, [r0, #MMX_WR6]
477 - wldrd wR7, [r0, #MMX_WR7]
478 - wldrd wR8, [r0, #MMX_WR8]
479 - wldrd wR9, [r0, #MMX_WR9]
480 - wldrd wR10, [r0, #MMX_WR10]
481 - wldrd wR11, [r0, #MMX_WR11]
482 - wldrd wR12, [r0, #MMX_WR12]
483 - wldrd wR13, [r0, #MMX_WR13]
484 - wldrd wR14, [r0, #MMX_WR14]
485 - wldrd wR15, [r0, #MMX_WR15]
486 + wldrd wR0, r0, MMX_WR0
487 + wldrd wR1, r0, MMX_WR1
488 + wldrd wR2, r0, MMX_WR2
489 + wldrd wR3, r0, MMX_WR3
490 + wldrd wR4, r0, MMX_WR4
491 + wldrd wR5, r0, MMX_WR5
492 + wldrd wR6, r0, MMX_WR6
493 + wldrd wR7, r0, MMX_WR7
494 + wldrd wR8, r0, MMX_WR8
495 + wldrd wR9, r0, MMX_WR9
496 + wldrd wR10, r0, MMX_WR10
497 + wldrd wR11, r0, MMX_WR11
498 + wldrd wR12, r0, MMX_WR12
499 + wldrd wR13, r0, MMX_WR13
500 + wldrd wR14, r0, MMX_WR14
501 + wldrd wR15, r0, MMX_WR15
502
503 @ Load wCx
504 - wldrw wCSSF, [r0, #MMX_WCSSF]
505 - wldrw wCASF, [r0, #MMX_WCASF]
506 - wldrw wCGR0, [r0, #MMX_WCGR0]
507 - wldrw wCGR1, [r0, #MMX_WCGR1]
508 - wldrw wCGR2, [r0, #MMX_WCGR2]
509 - wldrw wCGR3, [r0, #MMX_WCGR3]
510 + wldrw wCSSF, r0, MMX_WCSSF
511 + wldrw wCASF, r0, MMX_WCASF
512 + wldrw wCGR0, r0, MMX_WCGR0
513 + wldrw wCGR1, r0, MMX_WCGR1
514 + wldrw wCGR2, r0, MMX_WCGR2
515 + wldrw wCGR3, r0, MMX_WCGR3
516
517 @ clear CUP/MUP (only if r1 != 0)
518 teq r1, #0
519 diff --git a/arch/arm/kernel/iwmmxt.h b/arch/arm/kernel/iwmmxt.h
520 new file mode 100644
521 index 0000000000000..fb627286f5bb9
522 --- /dev/null
523 +++ b/arch/arm/kernel/iwmmxt.h
524 @@ -0,0 +1,47 @@
525 +/* SPDX-License-Identifier: GPL-2.0 */
526 +
527 +#ifndef __IWMMXT_H__
528 +#define __IWMMXT_H__
529 +
530 +.irp b, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
531 +.set .LwR\b, \b
532 +.set .Lr\b, \b
533 +.endr
534 +
535 +.set .LwCSSF, 0x2
536 +.set .LwCASF, 0x3
537 +.set .LwCGR0, 0x8
538 +.set .LwCGR1, 0x9
539 +.set .LwCGR2, 0xa
540 +.set .LwCGR3, 0xb
541 +
542 +.macro wldrd, reg:req, base:req, offset:req
543 +.inst 0xedd00100 | (.L\reg << 12) | (.L\base << 16) | (\offset >> 2)
544 +.endm
545 +
546 +.macro wldrw, reg:req, base:req, offset:req
547 +.inst 0xfd900100 | (.L\reg << 12) | (.L\base << 16) | (\offset >> 2)
548 +.endm
549 +
550 +.macro wstrd, reg:req, base:req, offset:req
551 +.inst 0xedc00100 | (.L\reg << 12) | (.L\base << 16) | (\offset >> 2)
552 +.endm
553 +
554 +.macro wstrw, reg:req, base:req, offset:req
555 +.inst 0xfd800100 | (.L\reg << 12) | (.L\base << 16) | (\offset >> 2)
556 +.endm
557 +
558 +#ifdef __clang__
559 +
560 +#define wCon c1
561 +
562 +.macro tmrc, dest:req, control:req
563 +mrc p1, 0, \dest, \control, c0, 0
564 +.endm
565 +
566 +.macro tmcr, control:req, src:req
567 +mcr p1, 0, \src, \control, c0, 0
568 +.endm
569 +#endif
570 +
571 +#endif
572 diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
573 index ac1324c6453b5..c4e97d35c310d 100644
574 --- a/arch/arm/mach-omap2/sleep34xx.S
575 +++ b/arch/arm/mach-omap2/sleep34xx.S
576 @@ -72,7 +72,7 @@ ENTRY(enable_omap3630_toggle_l2_on_restore)
577 stmfd sp!, {lr} @ save registers on stack
578 /* Setup so that we will disable and enable l2 */
579 mov r1, #0x1
580 - adrl r3, l2dis_3630_offset @ may be too distant for plain adr
581 + adr r3, l2dis_3630_offset
582 ldr r2, [r3] @ value for offset
583 str r1, [r2, r3] @ write to l2dis_3630
584 ldmfd sp!, {pc} @ restore regs and return
585 diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
586 index 4fa5371bc6624..2785da387c910 100644
587 --- a/arch/arm/mm/proc-arm1020.S
588 +++ b/arch/arm/mm/proc-arm1020.S
589 @@ -491,7 +491,7 @@ cpu_arm1020_name:
590
591 .align
592
593 - .section ".proc.info.init", #alloc
594 + .section ".proc.info.init", "a"
595
596 .type __arm1020_proc_info,#object
597 __arm1020_proc_info:
598 diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
599 index 5d8a8339e09a4..e9ea237ed7852 100644
600 --- a/arch/arm/mm/proc-arm1020e.S
601 +++ b/arch/arm/mm/proc-arm1020e.S
602 @@ -449,7 +449,7 @@ arm1020e_crval:
603
604 .align
605
606 - .section ".proc.info.init", #alloc
607 + .section ".proc.info.init", "a"
608
609 .type __arm1020e_proc_info,#object
610 __arm1020e_proc_info:
611 diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S
612 index b3dd95c345e48..920c279e7879d 100644
613 --- a/arch/arm/mm/proc-arm1022.S
614 +++ b/arch/arm/mm/proc-arm1022.S
615 @@ -443,7 +443,7 @@ arm1022_crval:
616
617 .align
618
619 - .section ".proc.info.init", #alloc
620 + .section ".proc.info.init", "a"
621
622 .type __arm1022_proc_info,#object
623 __arm1022_proc_info:
624 diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S
625 index ac5afde12f35c..0bdf25a95b107 100644
626 --- a/arch/arm/mm/proc-arm1026.S
627 +++ b/arch/arm/mm/proc-arm1026.S
628 @@ -138,7 +138,7 @@ ENTRY(arm1026_flush_kern_cache_all)
629 mov ip, #0
630 __flush_whole_cache:
631 #ifndef CONFIG_CPU_DCACHE_DISABLE
632 -1: mrc p15, 0, r15, c7, c14, 3 @ test, clean, invalidate
633 +1: mrc p15, 0, APSR_nzcv, c7, c14, 3 @ test, clean, invalidate
634 bne 1b
635 #endif
636 tst r2, #VM_EXEC
637 @@ -363,7 +363,7 @@ ENTRY(cpu_arm1026_switch_mm)
638 #ifdef CONFIG_MMU
639 mov r1, #0
640 #ifndef CONFIG_CPU_DCACHE_DISABLE
641 -1: mrc p15, 0, r15, c7, c14, 3 @ test, clean, invalidate
642 +1: mrc p15, 0, APSR_nzcv, c7, c14, 3 @ test, clean, invalidate
643 bne 1b
644 #endif
645 #ifndef CONFIG_CPU_ICACHE_DISABLE
646 @@ -437,7 +437,7 @@ arm1026_crval:
647 string cpu_arm1026_name, "ARM1026EJ-S"
648 .align
649
650 - .section ".proc.info.init", #alloc
651 + .section ".proc.info.init", "a"
652
653 .type __arm1026_proc_info,#object
654 __arm1026_proc_info:
655 diff --git a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S
656 index c99d24363f32e..39361e196d61b 100644
657 --- a/arch/arm/mm/proc-arm720.S
658 +++ b/arch/arm/mm/proc-arm720.S
659 @@ -172,7 +172,7 @@ arm720_crval:
660 * See <asm/procinfo.h> for a definition of this structure.
661 */
662
663 - .section ".proc.info.init", #alloc
664 + .section ".proc.info.init", "a"
665
666 .macro arm720_proc_info name:req, cpu_val:req, cpu_mask:req, cpu_name:req, cpu_flush:req
667 .type __\name\()_proc_info,#object
668 diff --git a/arch/arm/mm/proc-arm740.S b/arch/arm/mm/proc-arm740.S
669 index 1b4a3838393fb..1a94bbf6e53fc 100644
670 --- a/arch/arm/mm/proc-arm740.S
671 +++ b/arch/arm/mm/proc-arm740.S
672 @@ -128,7 +128,7 @@ __arm740_setup:
673
674 .align
675
676 - .section ".proc.info.init", #alloc
677 + .section ".proc.info.init", "a"
678 .type __arm740_proc_info,#object
679 __arm740_proc_info:
680 .long 0x41807400
681 diff --git a/arch/arm/mm/proc-arm7tdmi.S b/arch/arm/mm/proc-arm7tdmi.S
682 index 17a4687065c7f..52b66cf0259e3 100644
683 --- a/arch/arm/mm/proc-arm7tdmi.S
684 +++ b/arch/arm/mm/proc-arm7tdmi.S
685 @@ -72,7 +72,7 @@ __arm7tdmi_setup:
686
687 .align
688
689 - .section ".proc.info.init", #alloc
690 + .section ".proc.info.init", "a"
691
692 .macro arm7tdmi_proc_info name:req, cpu_val:req, cpu_mask:req, cpu_name:req, \
693 extra_hwcaps=0
694 diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
695 index 298c76b47749f..31ac8acc34dc5 100644
696 --- a/arch/arm/mm/proc-arm920.S
697 +++ b/arch/arm/mm/proc-arm920.S
698 @@ -434,7 +434,7 @@ arm920_crval:
699
700 .align
701
702 - .section ".proc.info.init", #alloc
703 + .section ".proc.info.init", "a"
704
705 .type __arm920_proc_info,#object
706 __arm920_proc_info:
707 diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S
708 index 824be3a0bc238..ca2c7ca8af214 100644
709 --- a/arch/arm/mm/proc-arm922.S
710 +++ b/arch/arm/mm/proc-arm922.S
711 @@ -412,7 +412,7 @@ arm922_crval:
712
713 .align
714
715 - .section ".proc.info.init", #alloc
716 + .section ".proc.info.init", "a"
717
718 .type __arm922_proc_info,#object
719 __arm922_proc_info:
720 diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S
721 index d40cff8f102c2..a381a0c9f1092 100644
722 --- a/arch/arm/mm/proc-arm925.S
723 +++ b/arch/arm/mm/proc-arm925.S
724 @@ -477,7 +477,7 @@ arm925_crval:
725
726 .align
727
728 - .section ".proc.info.init", #alloc
729 + .section ".proc.info.init", "a"
730
731 .macro arm925_proc_info name:req, cpu_val:req, cpu_mask:req, cpu_name:req, cache
732 .type __\name\()_proc_info,#object
733 diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
734 index f3cd08f353f00..1ba253c2bce19 100644
735 --- a/arch/arm/mm/proc-arm926.S
736 +++ b/arch/arm/mm/proc-arm926.S
737 @@ -131,7 +131,7 @@ __flush_whole_cache:
738 #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
739 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
740 #else
741 -1: mrc p15, 0, r15, c7, c14, 3 @ test,clean,invalidate
742 +1: mrc p15, 0, APSR_nzcv, c7, c14, 3 @ test,clean,invalidate
743 bne 1b
744 #endif
745 tst r2, #VM_EXEC
746 @@ -358,7 +358,7 @@ ENTRY(cpu_arm926_switch_mm)
747 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
748 #else
749 @ && 'Clean & Invalidate whole DCache'
750 -1: mrc p15, 0, r15, c7, c14, 3 @ test,clean,invalidate
751 +1: mrc p15, 0, APSR_nzcv, c7, c14, 3 @ test,clean,invalidate
752 bne 1b
753 #endif
754 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
755 @@ -460,7 +460,7 @@ arm926_crval:
756
757 .align
758
759 - .section ".proc.info.init", #alloc
760 + .section ".proc.info.init", "a"
761
762 .type __arm926_proc_info,#object
763 __arm926_proc_info:
764 diff --git a/arch/arm/mm/proc-arm940.S b/arch/arm/mm/proc-arm940.S
765 index 1c26d991386d7..4b8a00220cc97 100644
766 --- a/arch/arm/mm/proc-arm940.S
767 +++ b/arch/arm/mm/proc-arm940.S
768 @@ -340,7 +340,7 @@ __arm940_setup:
769
770 .align
771
772 - .section ".proc.info.init", #alloc
773 + .section ".proc.info.init", "a"
774
775 .type __arm940_proc_info,#object
776 __arm940_proc_info:
777 diff --git a/arch/arm/mm/proc-arm946.S b/arch/arm/mm/proc-arm946.S
778 index 2dc1c75a4fd4a..555becf9c758d 100644
779 --- a/arch/arm/mm/proc-arm946.S
780 +++ b/arch/arm/mm/proc-arm946.S
781 @@ -395,7 +395,7 @@ __arm946_setup:
782
783 .align
784
785 - .section ".proc.info.init", #alloc
786 + .section ".proc.info.init", "a"
787 .type __arm946_proc_info,#object
788 __arm946_proc_info:
789 .long 0x41009460
790 diff --git a/arch/arm/mm/proc-arm9tdmi.S b/arch/arm/mm/proc-arm9tdmi.S
791 index 913c06e590af5..ef517530130b0 100644
792 --- a/arch/arm/mm/proc-arm9tdmi.S
793 +++ b/arch/arm/mm/proc-arm9tdmi.S
794 @@ -66,7 +66,7 @@ __arm9tdmi_setup:
795
796 .align
797
798 - .section ".proc.info.init", #alloc
799 + .section ".proc.info.init", "a"
800
801 .macro arm9tdmi_proc_info name:req, cpu_val:req, cpu_mask:req, cpu_name:req
802 .type __\name\()_proc_info, #object
803 diff --git a/arch/arm/mm/proc-fa526.S b/arch/arm/mm/proc-fa526.S
804 index 8120b6f4dbb83..dddf833fe0007 100644
805 --- a/arch/arm/mm/proc-fa526.S
806 +++ b/arch/arm/mm/proc-fa526.S
807 @@ -185,7 +185,7 @@ fa526_cr1_set:
808
809 .align
810
811 - .section ".proc.info.init", #alloc
812 + .section ".proc.info.init", "a"
813
814 .type __fa526_proc_info,#object
815 __fa526_proc_info:
816 diff --git a/arch/arm/mm/proc-feroceon.S b/arch/arm/mm/proc-feroceon.S
817 index bb6dc34d42a37..b12b76bc8d30c 100644
818 --- a/arch/arm/mm/proc-feroceon.S
819 +++ b/arch/arm/mm/proc-feroceon.S
820 @@ -571,7 +571,7 @@ feroceon_crval:
821
822 .align
823
824 - .section ".proc.info.init", #alloc
825 + .section ".proc.info.init", "a"
826
827 .macro feroceon_proc_info name:req, cpu_val:req, cpu_mask:req, cpu_name:req, cache:req
828 .type __\name\()_proc_info,#object
829 diff --git a/arch/arm/mm/proc-mohawk.S b/arch/arm/mm/proc-mohawk.S
830 index f083085788857..d47d6c5cee63a 100644
831 --- a/arch/arm/mm/proc-mohawk.S
832 +++ b/arch/arm/mm/proc-mohawk.S
833 @@ -416,7 +416,7 @@ mohawk_crval:
834
835 .align
836
837 - .section ".proc.info.init", #alloc
838 + .section ".proc.info.init", "a"
839
840 .type __88sv331x_proc_info,#object
841 __88sv331x_proc_info:
842 diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S
843 index d5bc5d7025639..baba503ba8166 100644
844 --- a/arch/arm/mm/proc-sa110.S
845 +++ b/arch/arm/mm/proc-sa110.S
846 @@ -196,7 +196,7 @@ sa110_crval:
847
848 .align
849
850 - .section ".proc.info.init", #alloc
851 + .section ".proc.info.init", "a"
852
853 .type __sa110_proc_info,#object
854 __sa110_proc_info:
855 diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S
856 index be7b611c76c76..75ebacc8e4e5c 100644
857 --- a/arch/arm/mm/proc-sa1100.S
858 +++ b/arch/arm/mm/proc-sa1100.S
859 @@ -239,7 +239,7 @@ sa1100_crval:
860
861 .align
862
863 - .section ".proc.info.init", #alloc
864 + .section ".proc.info.init", "a"
865
866 .macro sa1100_proc_info name:req, cpu_val:req, cpu_mask:req, cpu_name:req
867 .type __\name\()_proc_info,#object
868 diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
869 index c1c85eb3484f3..1dd0d5ca27da8 100644
870 --- a/arch/arm/mm/proc-v6.S
871 +++ b/arch/arm/mm/proc-v6.S
872 @@ -261,7 +261,7 @@ v6_crval:
873 string cpu_elf_name, "v6"
874 .align
875
876 - .section ".proc.info.init", #alloc
877 + .section ".proc.info.init", "a"
878
879 /*
880 * Match any ARMv6 processor core.
881 diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
882 index c4e8006a1a8cd..48e0ef6f0dccf 100644
883 --- a/arch/arm/mm/proc-v7.S
884 +++ b/arch/arm/mm/proc-v7.S
885 @@ -644,7 +644,7 @@ __v7_setup_stack:
886 string cpu_elf_name, "v7"
887 .align
888
889 - .section ".proc.info.init", #alloc
890 + .section ".proc.info.init", "a"
891
892 /*
893 * Standard v7 proc info content
894 diff --git a/arch/arm/mm/proc-v7m.S b/arch/arm/mm/proc-v7m.S
895 index 1a49d503eafc8..84459c1d31b87 100644
896 --- a/arch/arm/mm/proc-v7m.S
897 +++ b/arch/arm/mm/proc-v7m.S
898 @@ -93,7 +93,7 @@ ENTRY(cpu_cm7_proc_fin)
899 ret lr
900 ENDPROC(cpu_cm7_proc_fin)
901
902 - .section ".init.text", #alloc, #execinstr
903 + .section ".init.text", "ax"
904
905 __v7m_cm7_setup:
906 mov r8, #(V7M_SCB_CCR_DC | V7M_SCB_CCR_IC| V7M_SCB_CCR_BP)
907 @@ -177,7 +177,7 @@ ENDPROC(__v7m_setup)
908 string cpu_elf_name "v7m"
909 string cpu_v7m_name "ARMv7-M"
910
911 - .section ".proc.info.init", #alloc
912 + .section ".proc.info.init", "a"
913
914 .macro __v7m_proc name, initfunc, cache_fns = nop_cache_fns, hwcaps = 0, proc_fns = v7m_processor_functions
915 .long 0 /* proc_info_list.__cpu_mm_mmu_flags */
916 diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S
917 index 1ac0fbbe9f127..42eaecc43cfef 100644
918 --- a/arch/arm/mm/proc-xsc3.S
919 +++ b/arch/arm/mm/proc-xsc3.S
920 @@ -496,7 +496,7 @@ xsc3_crval:
921
922 .align
923
924 - .section ".proc.info.init", #alloc
925 + .section ".proc.info.init", "a"
926
927 .macro xsc3_proc_info name:req, cpu_val:req, cpu_mask:req
928 .type __\name\()_proc_info,#object
929 diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
930 index bdb2b7749b039..18ac5a1f89225 100644
931 --- a/arch/arm/mm/proc-xscale.S
932 +++ b/arch/arm/mm/proc-xscale.S
933 @@ -610,7 +610,7 @@ xscale_crval:
934
935 .align
936
937 - .section ".proc.info.init", #alloc
938 + .section ".proc.info.init", "a"
939
940 .macro xscale_proc_info name:req, cpu_val:req, cpu_mask:req, cpu_name:req, cache
941 .type __\name\()_proc_info,#object
942 diff --git a/arch/arm/vfp/Makefile b/arch/arm/vfp/Makefile
943 index 9975b63ac3b0d..749901a72d6dc 100644
944 --- a/arch/arm/vfp/Makefile
945 +++ b/arch/arm/vfp/Makefile
946 @@ -8,6 +8,4 @@
947 # ccflags-y := -DDEBUG
948 # asflags-y := -DDEBUG
949
950 -KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp -mfloat-abi=soft)
951 -
952 obj-y += vfpmodule.o entry.o vfphw.o vfpsingle.o vfpdouble.o
953 diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
954 index b530db8f2c6c8..772c6a3b1f724 100644
955 --- a/arch/arm/vfp/vfphw.S
956 +++ b/arch/arm/vfp/vfphw.S
957 @@ -253,11 +253,14 @@ vfp_current_hw_state_address:
958
959 ENTRY(vfp_get_float)
960 tbl_branch r0, r3, #3
961 + .fpu vfpv2
962 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
963 -1: mrc p10, 0, r0, c\dr, c0, 0 @ fmrs r0, s0
964 +1: vmov r0, s\dr
965 ret lr
966 .org 1b + 8
967 -1: mrc p10, 0, r0, c\dr, c0, 4 @ fmrs r0, s1
968 + .endr
969 + .irp dr,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
970 +1: vmov r0, s\dr
971 ret lr
972 .org 1b + 8
973 .endr
974 @@ -265,11 +268,14 @@ ENDPROC(vfp_get_float)
975
976 ENTRY(vfp_put_float)
977 tbl_branch r1, r3, #3
978 + .fpu vfpv2
979 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
980 -1: mcr p10, 0, r0, c\dr, c0, 0 @ fmsr r0, s0
981 +1: vmov s\dr, r0
982 ret lr
983 .org 1b + 8
984 -1: mcr p10, 0, r0, c\dr, c0, 4 @ fmsr r0, s1
985 + .endr
986 + .irp dr,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
987 +1: vmov s\dr, r0
988 ret lr
989 .org 1b + 8
990 .endr
991 @@ -277,15 +283,17 @@ ENDPROC(vfp_put_float)
992
993 ENTRY(vfp_get_double)
994 tbl_branch r0, r3, #3
995 + .fpu vfpv2
996 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
997 -1: fmrrd r0, r1, d\dr
998 +1: vmov r0, r1, d\dr
999 ret lr
1000 .org 1b + 8
1001 .endr
1002 #ifdef CONFIG_VFPv3
1003 @ d16 - d31 registers
1004 - .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
1005 -1: mrrc p11, 3, r0, r1, c\dr @ fmrrd r0, r1, d\dr
1006 + .fpu vfpv3
1007 + .irp dr,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
1008 +1: vmov r0, r1, d\dr
1009 ret lr
1010 .org 1b + 8
1011 .endr
1012 @@ -299,15 +307,17 @@ ENDPROC(vfp_get_double)
1013
1014 ENTRY(vfp_put_double)
1015 tbl_branch r2, r3, #3
1016 + .fpu vfpv2
1017 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
1018 -1: fmdrr d\dr, r0, r1
1019 +1: vmov d\dr, r0, r1
1020 ret lr
1021 .org 1b + 8
1022 .endr
1023 #ifdef CONFIG_VFPv3
1024 + .fpu vfpv3
1025 @ d16 - d31 registers
1026 - .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
1027 -1: mcrr p11, 3, r0, r1, c\dr @ fmdrr r0, r1, d\dr
1028 + .irp dr,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
1029 +1: vmov d\dr, r0, r1
1030 ret lr
1031 .org 1b + 8
1032 .endr
1033 diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h
1034 index f54a08a2cd709..017336f2b0864 100644
1035 --- a/arch/powerpc/include/asm/ftrace.h
1036 +++ b/arch/powerpc/include/asm/ftrace.h
1037 @@ -96,7 +96,7 @@ static inline bool arch_syscall_match_sym_name(const char *sym, const char *name
1038 #endif /* PPC64_ELF_ABI_v1 */
1039 #endif /* CONFIG_FTRACE_SYSCALLS */
1040
1041 -#ifdef CONFIG_PPC64
1042 +#if defined(CONFIG_PPC64) && defined(CONFIG_FUNCTION_TRACER)
1043 #include <asm/paca.h>
1044
1045 static inline void this_cpu_disable_ftrace(void)
1046 @@ -108,9 +108,12 @@ static inline void this_cpu_enable_ftrace(void)
1047 {
1048 get_paca()->ftrace_enabled = 1;
1049 }
1050 +
1051 +void ftrace_free_init_tramp(void);
1052 #else /* CONFIG_PPC64 */
1053 static inline void this_cpu_disable_ftrace(void) { }
1054 static inline void this_cpu_enable_ftrace(void) { }
1055 +static inline void ftrace_free_init_tramp(void) { }
1056 #endif /* CONFIG_PPC64 */
1057 #endif /* !__ASSEMBLY__ */
1058
1059 diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c
1060 index 7ea0ca044b650..d816e714f2f48 100644
1061 --- a/arch/powerpc/kernel/trace/ftrace.c
1062 +++ b/arch/powerpc/kernel/trace/ftrace.c
1063 @@ -328,9 +328,7 @@ static int setup_mcount_compiler_tramp(unsigned long tramp)
1064
1065 /* Is this a known long jump tramp? */
1066 for (i = 0; i < NUM_FTRACE_TRAMPS; i++)
1067 - if (!ftrace_tramps[i])
1068 - break;
1069 - else if (ftrace_tramps[i] == tramp)
1070 + if (ftrace_tramps[i] == tramp)
1071 return 0;
1072
1073 /* Is this a known plt tramp? */
1074 @@ -868,6 +866,17 @@ void arch_ftrace_update_code(int command)
1075
1076 extern unsigned int ftrace_tramp_text[], ftrace_tramp_init[];
1077
1078 +void ftrace_free_init_tramp(void)
1079 +{
1080 + int i;
1081 +
1082 + for (i = 0; i < NUM_FTRACE_TRAMPS && ftrace_tramps[i]; i++)
1083 + if (ftrace_tramps[i] == (unsigned long)ftrace_tramp_init) {
1084 + ftrace_tramps[i] = 0;
1085 + return;
1086 + }
1087 +}
1088 +
1089 int __init ftrace_dyn_arch_init(void)
1090 {
1091 int i;
1092 diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
1093 index c48705c726ac6..d427f70556eab 100644
1094 --- a/arch/powerpc/mm/mem.c
1095 +++ b/arch/powerpc/mm/mem.c
1096 @@ -48,6 +48,7 @@
1097 #include <asm/fixmap.h>
1098 #include <asm/swiotlb.h>
1099 #include <asm/rtas.h>
1100 +#include <asm/ftrace.h>
1101
1102 #include <mm/mmu_decl.h>
1103
1104 @@ -346,6 +347,7 @@ void free_initmem(void)
1105 mark_initmem_nx();
1106 init_mem_is_free = true;
1107 free_initmem_default(POISON_FREE_INITMEM);
1108 + ftrace_free_init_tramp();
1109 }
1110
1111 /**
1112 diff --git a/arch/s390/include/asm/kexec.h b/arch/s390/include/asm/kexec.h
1113 index 7f3c9ac34bd8d..63098df81c9f2 100644
1114 --- a/arch/s390/include/asm/kexec.h
1115 +++ b/arch/s390/include/asm/kexec.h
1116 @@ -9,6 +9,8 @@
1117 #ifndef _S390_KEXEC_H
1118 #define _S390_KEXEC_H
1119
1120 +#include <linux/module.h>
1121 +
1122 #include <asm/processor.h>
1123 #include <asm/page.h>
1124 #include <asm/setup.h>
1125 @@ -83,4 +85,12 @@ struct kimage_arch {
1126 extern const struct kexec_file_ops s390_kexec_image_ops;
1127 extern const struct kexec_file_ops s390_kexec_elf_ops;
1128
1129 +#ifdef CONFIG_KEXEC_FILE
1130 +struct purgatory_info;
1131 +int arch_kexec_apply_relocations_add(struct purgatory_info *pi,
1132 + Elf_Shdr *section,
1133 + const Elf_Shdr *relsec,
1134 + const Elf_Shdr *symtab);
1135 +#define arch_kexec_apply_relocations_add arch_kexec_apply_relocations_add
1136 +#endif
1137 #endif /*_S390_KEXEC_H */
1138 diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h
1139 index 5e7d6b46de97d..367da081f7d9d 100644
1140 --- a/arch/x86/include/asm/kexec.h
1141 +++ b/arch/x86/include/asm/kexec.h
1142 @@ -22,6 +22,7 @@
1143
1144 #include <linux/string.h>
1145 #include <linux/kernel.h>
1146 +#include <linux/module.h>
1147
1148 #include <asm/page.h>
1149 #include <asm/ptrace.h>
1150 @@ -201,6 +202,14 @@ extern int arch_kexec_post_alloc_pages(void *vaddr, unsigned int pages,
1151 extern void arch_kexec_pre_free_pages(void *vaddr, unsigned int pages);
1152 #define arch_kexec_pre_free_pages arch_kexec_pre_free_pages
1153
1154 +#ifdef CONFIG_KEXEC_FILE
1155 +struct purgatory_info;
1156 +int arch_kexec_apply_relocations_add(struct purgatory_info *pi,
1157 + Elf_Shdr *section,
1158 + const Elf_Shdr *relsec,
1159 + const Elf_Shdr *symtab);
1160 +#define arch_kexec_apply_relocations_add arch_kexec_apply_relocations_add
1161 +#endif
1162 #endif
1163
1164 typedef void crash_vmclear_fn(void);
1165 diff --git a/drivers/gpu/drm/drm_crtc_helper_internal.h b/drivers/gpu/drm/drm_crtc_helper_internal.h
1166 index b5ac1581e6231..d595697d3d7e0 100644
1167 --- a/drivers/gpu/drm/drm_crtc_helper_internal.h
1168 +++ b/drivers/gpu/drm/drm_crtc_helper_internal.h
1169 @@ -32,16 +32,6 @@
1170 #include <drm/drm_encoder.h>
1171 #include <drm/drm_modes.h>
1172
1173 -/* drm_fb_helper.c */
1174 -#ifdef CONFIG_DRM_FBDEV_EMULATION
1175 -int drm_fb_helper_modinit(void);
1176 -#else
1177 -static inline int drm_fb_helper_modinit(void)
1178 -{
1179 - return 0;
1180 -}
1181 -#endif
1182 -
1183 /* drm_dp_aux_dev.c */
1184 #ifdef CONFIG_DRM_DP_AUX_CHARDEV
1185 int drm_dp_aux_dev_init(void);
1186 diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
1187 index 02ffde5fd7226..4ae68bf048920 100644
1188 --- a/drivers/gpu/drm/drm_fb_helper.c
1189 +++ b/drivers/gpu/drm/drm_fb_helper.c
1190 @@ -2415,24 +2415,3 @@ int drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp)
1191 return 0;
1192 }
1193 EXPORT_SYMBOL(drm_fbdev_generic_setup);
1194 -
1195 -/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT)
1196 - * but the module doesn't depend on any fb console symbols. At least
1197 - * attempt to load fbcon to avoid leaving the system without a usable console.
1198 - */
1199 -int __init drm_fb_helper_modinit(void)
1200 -{
1201 -#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT)
1202 - const char name[] = "fbcon";
1203 - struct module *fbcon;
1204 -
1205 - mutex_lock(&module_mutex);
1206 - fbcon = find_module(name);
1207 - mutex_unlock(&module_mutex);
1208 -
1209 - if (!fbcon)
1210 - request_module_nowait(name);
1211 -#endif
1212 - return 0;
1213 -}
1214 -EXPORT_SYMBOL(drm_fb_helper_modinit);
1215 diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c
1216 index 221a8528c9937..f933da1656eb5 100644
1217 --- a/drivers/gpu/drm/drm_kms_helper_common.c
1218 +++ b/drivers/gpu/drm/drm_kms_helper_common.c
1219 @@ -64,19 +64,18 @@ MODULE_PARM_DESC(edid_firmware,
1220
1221 static int __init drm_kms_helper_init(void)
1222 {
1223 - int ret;
1224 -
1225 - /* Call init functions from specific kms helpers here */
1226 - ret = drm_fb_helper_modinit();
1227 - if (ret < 0)
1228 - goto out;
1229 -
1230 - ret = drm_dp_aux_dev_init();
1231 - if (ret < 0)
1232 - goto out;
1233 -
1234 -out:
1235 - return ret;
1236 + /*
1237 + * The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT)
1238 + * but the module doesn't depend on any fb console symbols. At least
1239 + * attempt to load fbcon to avoid leaving the system without a usable
1240 + * console.
1241 + */
1242 + if (IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) &&
1243 + IS_MODULE(CONFIG_FRAMEBUFFER_CONSOLE) &&
1244 + !IS_ENABLED(CONFIG_EXPERT))
1245 + request_module_nowait("fbcon");
1246 +
1247 + return drm_dp_aux_dev_init();
1248 }
1249
1250 static void __exit drm_kms_helper_exit(void)
1251 diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
1252 index bf7832b34a000..acddb3aa53de4 100644
1253 --- a/drivers/net/ethernet/mscc/ocelot.c
1254 +++ b/drivers/net/ethernet/mscc/ocelot.c
1255 @@ -2153,8 +2153,12 @@ int ocelot_init(struct ocelot *ocelot)
1256 ocelot_write_rix(ocelot,
1257 ANA_PGID_PGID_PGID(GENMASK(ocelot->num_phys_ports, 0)),
1258 ANA_PGID_PGID, PGID_MC);
1259 - ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_MCIPV4);
1260 - ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_MCIPV6);
1261 + ocelot_write_rix(ocelot,
1262 + ANA_PGID_PGID_PGID(GENMASK(ocelot->num_phys_ports, 0)),
1263 + ANA_PGID_PGID, PGID_MCIPV4);
1264 + ocelot_write_rix(ocelot,
1265 + ANA_PGID_PGID_PGID(GENMASK(ocelot->num_phys_ports, 0)),
1266 + ANA_PGID_PGID, PGID_MCIPV6);
1267
1268 /* CPU port Injection/Extraction configuration */
1269 ocelot_write_rix(ocelot, QSYS_SWITCH_PORT_MODE_INGRESS_DROP_MODE |
1270 diff --git a/include/linux/kexec.h b/include/linux/kexec.h
1271 index a1cffce3de8cd..64f23bab6255d 100644
1272 --- a/include/linux/kexec.h
1273 +++ b/include/linux/kexec.h
1274 @@ -186,14 +186,6 @@ void *kexec_purgatory_get_symbol_addr(struct kimage *image, const char *name);
1275 int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,
1276 unsigned long buf_len);
1277 void * __weak arch_kexec_kernel_image_load(struct kimage *image);
1278 -int __weak arch_kexec_apply_relocations_add(struct purgatory_info *pi,
1279 - Elf_Shdr *section,
1280 - const Elf_Shdr *relsec,
1281 - const Elf_Shdr *symtab);
1282 -int __weak arch_kexec_apply_relocations(struct purgatory_info *pi,
1283 - Elf_Shdr *section,
1284 - const Elf_Shdr *relsec,
1285 - const Elf_Shdr *symtab);
1286
1287 extern int kexec_add_buffer(struct kexec_buf *kbuf);
1288 int kexec_locate_mem_hole(struct kexec_buf *kbuf);
1289 @@ -216,6 +208,44 @@ extern int crash_exclude_mem_range(struct crash_mem *mem,
1290 unsigned long long mend);
1291 extern int crash_prepare_elf64_headers(struct crash_mem *mem, int kernel_map,
1292 void **addr, unsigned long *sz);
1293 +
1294 +#ifndef arch_kexec_apply_relocations_add
1295 +/*
1296 + * arch_kexec_apply_relocations_add - apply relocations of type RELA
1297 + * @pi: Purgatory to be relocated.
1298 + * @section: Section relocations applying to.
1299 + * @relsec: Section containing RELAs.
1300 + * @symtab: Corresponding symtab.
1301 + *
1302 + * Return: 0 on success, negative errno on error.
1303 + */
1304 +static inline int
1305 +arch_kexec_apply_relocations_add(struct purgatory_info *pi, Elf_Shdr *section,
1306 + const Elf_Shdr *relsec, const Elf_Shdr *symtab)
1307 +{
1308 + pr_err("RELA relocation unsupported.\n");
1309 + return -ENOEXEC;
1310 +}
1311 +#endif
1312 +
1313 +#ifndef arch_kexec_apply_relocations
1314 +/*
1315 + * arch_kexec_apply_relocations - apply relocations of type REL
1316 + * @pi: Purgatory to be relocated.
1317 + * @section: Section relocations applying to.
1318 + * @relsec: Section containing RELs.
1319 + * @symtab: Corresponding symtab.
1320 + *
1321 + * Return: 0 on success, negative errno on error.
1322 + */
1323 +static inline int
1324 +arch_kexec_apply_relocations(struct purgatory_info *pi, Elf_Shdr *section,
1325 + const Elf_Shdr *relsec, const Elf_Shdr *symtab)
1326 +{
1327 + pr_err("REL relocation unsupported.\n");
1328 + return -ENOEXEC;
1329 +}
1330 +#endif
1331 #endif /* CONFIG_KEXEC_FILE */
1332
1333 #ifdef CONFIG_KEXEC_ELF
1334 diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
1335 index b17998fa03f12..5b58149bcd900 100644
1336 --- a/kernel/kexec_file.c
1337 +++ b/kernel/kexec_file.c
1338 @@ -107,40 +107,6 @@ int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf,
1339 }
1340 #endif
1341
1342 -/*
1343 - * arch_kexec_apply_relocations_add - apply relocations of type RELA
1344 - * @pi: Purgatory to be relocated.
1345 - * @section: Section relocations applying to.
1346 - * @relsec: Section containing RELAs.
1347 - * @symtab: Corresponding symtab.
1348 - *
1349 - * Return: 0 on success, negative errno on error.
1350 - */
1351 -int __weak
1352 -arch_kexec_apply_relocations_add(struct purgatory_info *pi, Elf_Shdr *section,
1353 - const Elf_Shdr *relsec, const Elf_Shdr *symtab)
1354 -{
1355 - pr_err("RELA relocation unsupported.\n");
1356 - return -ENOEXEC;
1357 -}
1358 -
1359 -/*
1360 - * arch_kexec_apply_relocations - apply relocations of type REL
1361 - * @pi: Purgatory to be relocated.
1362 - * @section: Section relocations applying to.
1363 - * @relsec: Section containing RELs.
1364 - * @symtab: Corresponding symtab.
1365 - *
1366 - * Return: 0 on success, negative errno on error.
1367 - */
1368 -int __weak
1369 -arch_kexec_apply_relocations(struct purgatory_info *pi, Elf_Shdr *section,
1370 - const Elf_Shdr *relsec, const Elf_Shdr *symtab)
1371 -{
1372 - pr_err("REL relocation unsupported.\n");
1373 - return -ENOEXEC;
1374 -}
1375 -
1376 /*
1377 * Free up memory used by kernel, initrd, and command line. This is temporary
1378 * memory allocation which is not needed any more after these buffers have