1 |
commit: 3e2fc91a7740493d363b499e66775cf6fa896fa3 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 22 14:06:49 2021 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 22 14:06:49 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=3e2fc91a |
7 |
|
8 |
Linux 4.19.222 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1221_linux-4.19.222.patch | 2422 +++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 2426 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 03cf027a..7dda2480 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -923,6 +923,10 @@ Patch: 1220_linux-4.19.221.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 4.19.221 |
23 |
|
24 |
+Patch: 1221_linux-4.19.222.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 4.19.222 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1221_linux-4.19.222.patch b/1221_linux-4.19.222.patch |
33 |
new file mode 100644 |
34 |
index 00000000..1a273590 |
35 |
--- /dev/null |
36 |
+++ b/1221_linux-4.19.222.patch |
37 |
@@ -0,0 +1,2422 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index c0676abcf60ff..aa6cdaebe18b2 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 19 |
46 |
+-SUBLEVEL = 221 |
47 |
++SUBLEVEL = 222 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = "People's Front" |
50 |
+ |
51 |
+@@ -1158,7 +1158,7 @@ endef |
52 |
+ |
53 |
+ define filechk_version.h |
54 |
+ (echo \#define LINUX_VERSION_CODE $(shell \ |
55 |
+- expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \ |
56 |
++ expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 255); \ |
57 |
+ echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) |
58 |
+ endef |
59 |
+ |
60 |
+diff --git a/arch/Kconfig b/arch/Kconfig |
61 |
+index e3a030f7a7226..dd71b34fe4f5f 100644 |
62 |
+--- a/arch/Kconfig |
63 |
++++ b/arch/Kconfig |
64 |
+@@ -870,6 +870,9 @@ config HAVE_ARCH_PREL32_RELOCATIONS |
65 |
+ architectures, and don't require runtime relocation on relocatable |
66 |
+ kernels. |
67 |
+ |
68 |
++config ARCH_USE_MEMREMAP_PROT |
69 |
++ bool |
70 |
++ |
71 |
+ source "kernel/gcov/Kconfig" |
72 |
+ |
73 |
+ source "scripts/gcc-plugins/Kconfig" |
74 |
+diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug |
75 |
+index bee0ba1d1cfb7..01c760929c9e4 100644 |
76 |
+--- a/arch/arm/Kconfig.debug |
77 |
++++ b/arch/arm/Kconfig.debug |
78 |
+@@ -45,30 +45,42 @@ config DEBUG_WX |
79 |
+ |
80 |
+ If in doubt, say "Y". |
81 |
+ |
82 |
+-# RMK wants arm kernels compiled with frame pointers or stack unwinding. |
83 |
+-# If you know what you are doing and are willing to live without stack |
84 |
+-# traces, you can get a slightly smaller kernel by setting this option to |
85 |
+-# n, but then RMK will have to kill you ;). |
86 |
+-config FRAME_POINTER |
87 |
+- bool |
88 |
+- depends on !THUMB2_KERNEL |
89 |
+- default y if !ARM_UNWIND || FUNCTION_GRAPH_TRACER |
90 |
++choice |
91 |
++ prompt "Choose kernel unwinder" |
92 |
++ default UNWINDER_ARM if AEABI && !FUNCTION_GRAPH_TRACER |
93 |
++ default UNWINDER_FRAME_POINTER if !AEABI || FUNCTION_GRAPH_TRACER |
94 |
++ help |
95 |
++ This determines which method will be used for unwinding kernel stack |
96 |
++ traces for panics, oopses, bugs, warnings, perf, /proc/<pid>/stack, |
97 |
++ livepatch, lockdep, and more. |
98 |
++ |
99 |
++config UNWINDER_FRAME_POINTER |
100 |
++ bool "Frame pointer unwinder" |
101 |
++ depends on !THUMB2_KERNEL && !CC_IS_CLANG |
102 |
++ select ARCH_WANT_FRAME_POINTERS |
103 |
++ select FRAME_POINTER |
104 |
+ help |
105 |
+- If you say N here, the resulting kernel will be slightly smaller and |
106 |
+- faster. However, if neither FRAME_POINTER nor ARM_UNWIND are enabled, |
107 |
+- when a problem occurs with the kernel, the information that is |
108 |
+- reported is severely limited. |
109 |
++ This option enables the frame pointer unwinder for unwinding |
110 |
++ kernel stack traces. |
111 |
+ |
112 |
+-config ARM_UNWIND |
113 |
+- bool "Enable stack unwinding support (EXPERIMENTAL)" |
114 |
++config UNWINDER_ARM |
115 |
++ bool "ARM EABI stack unwinder" |
116 |
+ depends on AEABI |
117 |
+- default y |
118 |
++ select ARM_UNWIND |
119 |
+ help |
120 |
+ This option enables stack unwinding support in the kernel |
121 |
+ using the information automatically generated by the |
122 |
+ compiler. The resulting kernel image is slightly bigger but |
123 |
+ the performance is not affected. Currently, this feature |
124 |
+- only works with EABI compilers. If unsure say Y. |
125 |
++ only works with EABI compilers. |
126 |
++ |
127 |
++endchoice |
128 |
++ |
129 |
++config ARM_UNWIND |
130 |
++ bool |
131 |
++ |
132 |
++config FRAME_POINTER |
133 |
++ bool |
134 |
+ |
135 |
+ config OLD_MCOUNT |
136 |
+ bool |
137 |
+diff --git a/arch/arm/boot/dts/imx6ull-pinfunc.h b/arch/arm/boot/dts/imx6ull-pinfunc.h |
138 |
+index 3c12a6fb0b618..1aea67f8ac236 100644 |
139 |
+--- a/arch/arm/boot/dts/imx6ull-pinfunc.h |
140 |
++++ b/arch/arm/boot/dts/imx6ull-pinfunc.h |
141 |
+@@ -68,6 +68,6 @@ |
142 |
+ #define MX6ULL_PAD_CSI_DATA04__ESAI_TX_FS 0x01F4 0x0480 0x0000 0x9 0x0 |
143 |
+ #define MX6ULL_PAD_CSI_DATA05__ESAI_TX_CLK 0x01F8 0x0484 0x0000 0x9 0x0 |
144 |
+ #define MX6ULL_PAD_CSI_DATA06__ESAI_TX5_RX0 0x01FC 0x0488 0x0000 0x9 0x0 |
145 |
+-#define MX6ULL_PAD_CSI_DATA07__ESAI_T0 0x0200 0x048C 0x0000 0x9 0x0 |
146 |
++#define MX6ULL_PAD_CSI_DATA07__ESAI_TX0 0x0200 0x048C 0x0000 0x9 0x0 |
147 |
+ |
148 |
+ #endif /* __DTS_IMX6ULL_PINFUNC_H */ |
149 |
+diff --git a/arch/arm/boot/dts/socfpga_arria10_socdk_qspi.dts b/arch/arm/boot/dts/socfpga_arria10_socdk_qspi.dts |
150 |
+index beb2fc6b9eb63..adfdc43ac052f 100644 |
151 |
+--- a/arch/arm/boot/dts/socfpga_arria10_socdk_qspi.dts |
152 |
++++ b/arch/arm/boot/dts/socfpga_arria10_socdk_qspi.dts |
153 |
+@@ -23,7 +23,7 @@ |
154 |
+ flash0: n25q00@0 { |
155 |
+ #address-cells = <1>; |
156 |
+ #size-cells = <1>; |
157 |
+- compatible = "n25q00aa"; |
158 |
++ compatible = "micron,mt25qu02g", "jedec,spi-nor"; |
159 |
+ reg = <0>; |
160 |
+ spi-max-frequency = <100000000>; |
161 |
+ |
162 |
+diff --git a/arch/arm/boot/dts/socfpga_arria5_socdk.dts b/arch/arm/boot/dts/socfpga_arria5_socdk.dts |
163 |
+index aac4feea86f38..09ffa79240c84 100644 |
164 |
+--- a/arch/arm/boot/dts/socfpga_arria5_socdk.dts |
165 |
++++ b/arch/arm/boot/dts/socfpga_arria5_socdk.dts |
166 |
+@@ -131,7 +131,7 @@ |
167 |
+ flash: flash@0 { |
168 |
+ #address-cells = <1>; |
169 |
+ #size-cells = <1>; |
170 |
+- compatible = "n25q256a"; |
171 |
++ compatible = "micron,n25q256a", "jedec,spi-nor"; |
172 |
+ reg = <0>; |
173 |
+ spi-max-frequency = <100000000>; |
174 |
+ |
175 |
+diff --git a/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts b/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts |
176 |
+index 155829f9eba16..907d8aa6d9fc8 100644 |
177 |
+--- a/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts |
178 |
++++ b/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts |
179 |
+@@ -136,7 +136,7 @@ |
180 |
+ flash0: n25q00@0 { |
181 |
+ #address-cells = <1>; |
182 |
+ #size-cells = <1>; |
183 |
+- compatible = "n25q00"; |
184 |
++ compatible = "micron,mt25qu02g", "jedec,spi-nor"; |
185 |
+ reg = <0>; /* chip select */ |
186 |
+ spi-max-frequency = <100000000>; |
187 |
+ |
188 |
+diff --git a/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts b/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts |
189 |
+index a4a555c19d943..fe5fe4559969d 100644 |
190 |
+--- a/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts |
191 |
++++ b/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts |
192 |
+@@ -181,7 +181,7 @@ |
193 |
+ flash: flash@0 { |
194 |
+ #address-cells = <1>; |
195 |
+ #size-cells = <1>; |
196 |
+- compatible = "n25q00"; |
197 |
++ compatible = "micron,mt25qu02g", "jedec,spi-nor"; |
198 |
+ reg = <0>; |
199 |
+ spi-max-frequency = <100000000>; |
200 |
+ |
201 |
+diff --git a/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts b/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts |
202 |
+index 53bf99eef66de..0992cae3e60ef 100644 |
203 |
+--- a/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts |
204 |
++++ b/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts |
205 |
+@@ -87,7 +87,7 @@ |
206 |
+ flash: flash@0 { |
207 |
+ #address-cells = <1>; |
208 |
+ #size-cells = <1>; |
209 |
+- compatible = "n25q256a"; |
210 |
++ compatible = "micron,n25q256a", "jedec,spi-nor"; |
211 |
+ reg = <0>; |
212 |
+ spi-max-frequency = <100000000>; |
213 |
+ m25p,fast-read; |
214 |
+diff --git a/arch/arm/boot/dts/socfpga_cyclone5_sodia.dts b/arch/arm/boot/dts/socfpga_cyclone5_sodia.dts |
215 |
+index 8860dd2e242c4..22bfef024913a 100644 |
216 |
+--- a/arch/arm/boot/dts/socfpga_cyclone5_sodia.dts |
217 |
++++ b/arch/arm/boot/dts/socfpga_cyclone5_sodia.dts |
218 |
+@@ -128,7 +128,7 @@ |
219 |
+ flash0: n25q512a@0 { |
220 |
+ #address-cells = <1>; |
221 |
+ #size-cells = <1>; |
222 |
+- compatible = "n25q512a"; |
223 |
++ compatible = "micron,n25q512a", "jedec,spi-nor"; |
224 |
+ reg = <0>; |
225 |
+ spi-max-frequency = <100000000>; |
226 |
+ |
227 |
+diff --git a/arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts b/arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts |
228 |
+index f50b19447de69..3412eb17a1587 100644 |
229 |
+--- a/arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts |
230 |
++++ b/arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts |
231 |
+@@ -249,7 +249,7 @@ |
232 |
+ n25q128@0 { |
233 |
+ #address-cells = <1>; |
234 |
+ #size-cells = <1>; |
235 |
+- compatible = "n25q128"; |
236 |
++ compatible = "micron,n25q128", "jedec,spi-nor"; |
237 |
+ reg = <0>; /* chip select */ |
238 |
+ spi-max-frequency = <100000000>; |
239 |
+ m25p,fast-read; |
240 |
+@@ -266,7 +266,7 @@ |
241 |
+ n25q00@1 { |
242 |
+ #address-cells = <1>; |
243 |
+ #size-cells = <1>; |
244 |
+- compatible = "n25q00"; |
245 |
++ compatible = "micron,mt25qu02g", "jedec,spi-nor"; |
246 |
+ reg = <1>; /* chip select */ |
247 |
+ spi-max-frequency = <100000000>; |
248 |
+ m25p,fast-read; |
249 |
+diff --git a/arch/arm/mm/copypage-fa.c b/arch/arm/mm/copypage-fa.c |
250 |
+index d130a5ece5d55..bf24690ec83af 100644 |
251 |
+--- a/arch/arm/mm/copypage-fa.c |
252 |
++++ b/arch/arm/mm/copypage-fa.c |
253 |
+@@ -17,26 +17,25 @@ |
254 |
+ /* |
255 |
+ * Faraday optimised copy_user_page |
256 |
+ */ |
257 |
+-static void __naked |
258 |
+-fa_copy_user_page(void *kto, const void *kfrom) |
259 |
++static void fa_copy_user_page(void *kto, const void *kfrom) |
260 |
+ { |
261 |
+- asm("\ |
262 |
+- stmfd sp!, {r4, lr} @ 2\n\ |
263 |
+- mov r2, %0 @ 1\n\ |
264 |
+-1: ldmia r1!, {r3, r4, ip, lr} @ 4\n\ |
265 |
+- stmia r0, {r3, r4, ip, lr} @ 4\n\ |
266 |
+- mcr p15, 0, r0, c7, c14, 1 @ 1 clean and invalidate D line\n\ |
267 |
+- add r0, r0, #16 @ 1\n\ |
268 |
+- ldmia r1!, {r3, r4, ip, lr} @ 4\n\ |
269 |
+- stmia r0, {r3, r4, ip, lr} @ 4\n\ |
270 |
+- mcr p15, 0, r0, c7, c14, 1 @ 1 clean and invalidate D line\n\ |
271 |
+- add r0, r0, #16 @ 1\n\ |
272 |
+- subs r2, r2, #1 @ 1\n\ |
273 |
++ int tmp; |
274 |
++ |
275 |
++ asm volatile ("\ |
276 |
++1: ldmia %1!, {r3, r4, ip, lr} @ 4\n\ |
277 |
++ stmia %0, {r3, r4, ip, lr} @ 4\n\ |
278 |
++ mcr p15, 0, %0, c7, c14, 1 @ 1 clean and invalidate D line\n\ |
279 |
++ add %0, %0, #16 @ 1\n\ |
280 |
++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\ |
281 |
++ stmia %0, {r3, r4, ip, lr} @ 4\n\ |
282 |
++ mcr p15, 0, %0, c7, c14, 1 @ 1 clean and invalidate D line\n\ |
283 |
++ add %0, %0, #16 @ 1\n\ |
284 |
++ subs %2, %2, #1 @ 1\n\ |
285 |
+ bne 1b @ 1\n\ |
286 |
+- mcr p15, 0, r2, c7, c10, 4 @ 1 drain WB\n\ |
287 |
+- ldmfd sp!, {r4, pc} @ 3" |
288 |
+- : |
289 |
+- : "I" (PAGE_SIZE / 32)); |
290 |
++ mcr p15, 0, %2, c7, c10, 4 @ 1 drain WB" |
291 |
++ : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp) |
292 |
++ : "2" (PAGE_SIZE / 32) |
293 |
++ : "r3", "r4", "ip", "lr"); |
294 |
+ } |
295 |
+ |
296 |
+ void fa_copy_user_highpage(struct page *to, struct page *from, |
297 |
+diff --git a/arch/arm/mm/copypage-feroceon.c b/arch/arm/mm/copypage-feroceon.c |
298 |
+index 49ee0c1a72097..cc819732d9b82 100644 |
299 |
+--- a/arch/arm/mm/copypage-feroceon.c |
300 |
++++ b/arch/arm/mm/copypage-feroceon.c |
301 |
+@@ -13,58 +13,56 @@ |
302 |
+ #include <linux/init.h> |
303 |
+ #include <linux/highmem.h> |
304 |
+ |
305 |
+-static void __naked |
306 |
+-feroceon_copy_user_page(void *kto, const void *kfrom) |
307 |
++static void feroceon_copy_user_page(void *kto, const void *kfrom) |
308 |
+ { |
309 |
+- asm("\ |
310 |
+- stmfd sp!, {r4-r9, lr} \n\ |
311 |
+- mov ip, %2 \n\ |
312 |
+-1: mov lr, r1 \n\ |
313 |
+- ldmia r1!, {r2 - r9} \n\ |
314 |
+- pld [lr, #32] \n\ |
315 |
+- pld [lr, #64] \n\ |
316 |
+- pld [lr, #96] \n\ |
317 |
+- pld [lr, #128] \n\ |
318 |
+- pld [lr, #160] \n\ |
319 |
+- pld [lr, #192] \n\ |
320 |
+- pld [lr, #224] \n\ |
321 |
+- stmia r0, {r2 - r9} \n\ |
322 |
+- ldmia r1!, {r2 - r9} \n\ |
323 |
+- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\ |
324 |
+- add r0, r0, #32 \n\ |
325 |
+- stmia r0, {r2 - r9} \n\ |
326 |
+- ldmia r1!, {r2 - r9} \n\ |
327 |
+- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\ |
328 |
+- add r0, r0, #32 \n\ |
329 |
+- stmia r0, {r2 - r9} \n\ |
330 |
+- ldmia r1!, {r2 - r9} \n\ |
331 |
+- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\ |
332 |
+- add r0, r0, #32 \n\ |
333 |
+- stmia r0, {r2 - r9} \n\ |
334 |
+- ldmia r1!, {r2 - r9} \n\ |
335 |
+- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\ |
336 |
+- add r0, r0, #32 \n\ |
337 |
+- stmia r0, {r2 - r9} \n\ |
338 |
+- ldmia r1!, {r2 - r9} \n\ |
339 |
+- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\ |
340 |
+- add r0, r0, #32 \n\ |
341 |
+- stmia r0, {r2 - r9} \n\ |
342 |
+- ldmia r1!, {r2 - r9} \n\ |
343 |
+- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\ |
344 |
+- add r0, r0, #32 \n\ |
345 |
+- stmia r0, {r2 - r9} \n\ |
346 |
+- ldmia r1!, {r2 - r9} \n\ |
347 |
+- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\ |
348 |
+- add r0, r0, #32 \n\ |
349 |
+- stmia r0, {r2 - r9} \n\ |
350 |
+- subs ip, ip, #(32 * 8) \n\ |
351 |
+- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\ |
352 |
+- add r0, r0, #32 \n\ |
353 |
++ int tmp; |
354 |
++ |
355 |
++ asm volatile ("\ |
356 |
++1: ldmia %1!, {r2 - r7, ip, lr} \n\ |
357 |
++ pld [%1, #0] \n\ |
358 |
++ pld [%1, #32] \n\ |
359 |
++ pld [%1, #64] \n\ |
360 |
++ pld [%1, #96] \n\ |
361 |
++ pld [%1, #128] \n\ |
362 |
++ pld [%1, #160] \n\ |
363 |
++ pld [%1, #192] \n\ |
364 |
++ stmia %0, {r2 - r7, ip, lr} \n\ |
365 |
++ ldmia %1!, {r2 - r7, ip, lr} \n\ |
366 |
++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\ |
367 |
++ add %0, %0, #32 \n\ |
368 |
++ stmia %0, {r2 - r7, ip, lr} \n\ |
369 |
++ ldmia %1!, {r2 - r7, ip, lr} \n\ |
370 |
++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\ |
371 |
++ add %0, %0, #32 \n\ |
372 |
++ stmia %0, {r2 - r7, ip, lr} \n\ |
373 |
++ ldmia %1!, {r2 - r7, ip, lr} \n\ |
374 |
++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\ |
375 |
++ add %0, %0, #32 \n\ |
376 |
++ stmia %0, {r2 - r7, ip, lr} \n\ |
377 |
++ ldmia %1!, {r2 - r7, ip, lr} \n\ |
378 |
++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\ |
379 |
++ add %0, %0, #32 \n\ |
380 |
++ stmia %0, {r2 - r7, ip, lr} \n\ |
381 |
++ ldmia %1!, {r2 - r7, ip, lr} \n\ |
382 |
++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\ |
383 |
++ add %0, %0, #32 \n\ |
384 |
++ stmia %0, {r2 - r7, ip, lr} \n\ |
385 |
++ ldmia %1!, {r2 - r7, ip, lr} \n\ |
386 |
++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\ |
387 |
++ add %0, %0, #32 \n\ |
388 |
++ stmia %0, {r2 - r7, ip, lr} \n\ |
389 |
++ ldmia %1!, {r2 - r7, ip, lr} \n\ |
390 |
++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\ |
391 |
++ add %0, %0, #32 \n\ |
392 |
++ stmia %0, {r2 - r7, ip, lr} \n\ |
393 |
++ subs %2, %2, #(32 * 8) \n\ |
394 |
++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\ |
395 |
++ add %0, %0, #32 \n\ |
396 |
+ bne 1b \n\ |
397 |
+- mcr p15, 0, ip, c7, c10, 4 @ drain WB\n\ |
398 |
+- ldmfd sp!, {r4-r9, pc}" |
399 |
+- : |
400 |
+- : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE)); |
401 |
++ mcr p15, 0, %2, c7, c10, 4 @ drain WB" |
402 |
++ : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp) |
403 |
++ : "2" (PAGE_SIZE) |
404 |
++ : "r2", "r3", "r4", "r5", "r6", "r7", "ip", "lr"); |
405 |
+ } |
406 |
+ |
407 |
+ void feroceon_copy_user_highpage(struct page *to, struct page *from, |
408 |
+diff --git a/arch/arm/mm/copypage-v4mc.c b/arch/arm/mm/copypage-v4mc.c |
409 |
+index 0224416cba3c8..b03202cddddb2 100644 |
410 |
+--- a/arch/arm/mm/copypage-v4mc.c |
411 |
++++ b/arch/arm/mm/copypage-v4mc.c |
412 |
+@@ -40,12 +40,11 @@ static DEFINE_RAW_SPINLOCK(minicache_lock); |
413 |
+ * instruction. If your processor does not supply this, you have to write your |
414 |
+ * own copy_user_highpage that does the right thing. |
415 |
+ */ |
416 |
+-static void __naked |
417 |
+-mc_copy_user_page(void *from, void *to) |
418 |
++static void mc_copy_user_page(void *from, void *to) |
419 |
+ { |
420 |
+- asm volatile( |
421 |
+- "stmfd sp!, {r4, lr} @ 2\n\ |
422 |
+- mov r4, %2 @ 1\n\ |
423 |
++ int tmp; |
424 |
++ |
425 |
++ asm volatile ("\ |
426 |
+ ldmia %0!, {r2, r3, ip, lr} @ 4\n\ |
427 |
+ 1: mcr p15, 0, %1, c7, c6, 1 @ 1 invalidate D line\n\ |
428 |
+ stmia %1!, {r2, r3, ip, lr} @ 4\n\ |
429 |
+@@ -55,13 +54,13 @@ mc_copy_user_page(void *from, void *to) |
430 |
+ mcr p15, 0, %1, c7, c6, 1 @ 1 invalidate D line\n\ |
431 |
+ stmia %1!, {r2, r3, ip, lr} @ 4\n\ |
432 |
+ ldmia %0!, {r2, r3, ip, lr} @ 4\n\ |
433 |
+- subs r4, r4, #1 @ 1\n\ |
434 |
++ subs %2, %2, #1 @ 1\n\ |
435 |
+ stmia %1!, {r2, r3, ip, lr} @ 4\n\ |
436 |
+ ldmneia %0!, {r2, r3, ip, lr} @ 4\n\ |
437 |
+- bne 1b @ 1\n\ |
438 |
+- ldmfd sp!, {r4, pc} @ 3" |
439 |
+- : |
440 |
+- : "r" (from), "r" (to), "I" (PAGE_SIZE / 64)); |
441 |
++ bne 1b @ " |
442 |
++ : "+&r" (from), "+&r" (to), "=&r" (tmp) |
443 |
++ : "2" (PAGE_SIZE / 64) |
444 |
++ : "r2", "r3", "ip", "lr"); |
445 |
+ } |
446 |
+ |
447 |
+ void v4_mc_copy_user_highpage(struct page *to, struct page *from, |
448 |
+diff --git a/arch/arm/mm/copypage-v4wb.c b/arch/arm/mm/copypage-v4wb.c |
449 |
+index 067d0fdd630c1..cd3e165afeede 100644 |
450 |
+--- a/arch/arm/mm/copypage-v4wb.c |
451 |
++++ b/arch/arm/mm/copypage-v4wb.c |
452 |
+@@ -22,29 +22,28 @@ |
453 |
+ * instruction. If your processor does not supply this, you have to write your |
454 |
+ * own copy_user_highpage that does the right thing. |
455 |
+ */ |
456 |
+-static void __naked |
457 |
+-v4wb_copy_user_page(void *kto, const void *kfrom) |
458 |
++static void v4wb_copy_user_page(void *kto, const void *kfrom) |
459 |
+ { |
460 |
+- asm("\ |
461 |
+- stmfd sp!, {r4, lr} @ 2\n\ |
462 |
+- mov r2, %2 @ 1\n\ |
463 |
+- ldmia r1!, {r3, r4, ip, lr} @ 4\n\ |
464 |
+-1: mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\ |
465 |
+- stmia r0!, {r3, r4, ip, lr} @ 4\n\ |
466 |
+- ldmia r1!, {r3, r4, ip, lr} @ 4+1\n\ |
467 |
+- stmia r0!, {r3, r4, ip, lr} @ 4\n\ |
468 |
+- ldmia r1!, {r3, r4, ip, lr} @ 4\n\ |
469 |
+- mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\ |
470 |
+- stmia r0!, {r3, r4, ip, lr} @ 4\n\ |
471 |
+- ldmia r1!, {r3, r4, ip, lr} @ 4\n\ |
472 |
+- subs r2, r2, #1 @ 1\n\ |
473 |
+- stmia r0!, {r3, r4, ip, lr} @ 4\n\ |
474 |
+- ldmneia r1!, {r3, r4, ip, lr} @ 4\n\ |
475 |
++ int tmp; |
476 |
++ |
477 |
++ asm volatile ("\ |
478 |
++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\ |
479 |
++1: mcr p15, 0, %0, c7, c6, 1 @ 1 invalidate D line\n\ |
480 |
++ stmia %0!, {r3, r4, ip, lr} @ 4\n\ |
481 |
++ ldmia %1!, {r3, r4, ip, lr} @ 4+1\n\ |
482 |
++ stmia %0!, {r3, r4, ip, lr} @ 4\n\ |
483 |
++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\ |
484 |
++ mcr p15, 0, %0, c7, c6, 1 @ 1 invalidate D line\n\ |
485 |
++ stmia %0!, {r3, r4, ip, lr} @ 4\n\ |
486 |
++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\ |
487 |
++ subs %2, %2, #1 @ 1\n\ |
488 |
++ stmia %0!, {r3, r4, ip, lr} @ 4\n\ |
489 |
++ ldmneia %1!, {r3, r4, ip, lr} @ 4\n\ |
490 |
+ bne 1b @ 1\n\ |
491 |
+- mcr p15, 0, r1, c7, c10, 4 @ 1 drain WB\n\ |
492 |
+- ldmfd sp!, {r4, pc} @ 3" |
493 |
+- : |
494 |
+- : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64)); |
495 |
++ mcr p15, 0, %1, c7, c10, 4 @ 1 drain WB" |
496 |
++ : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp) |
497 |
++ : "2" (PAGE_SIZE / 64) |
498 |
++ : "r3", "r4", "ip", "lr"); |
499 |
+ } |
500 |
+ |
501 |
+ void v4wb_copy_user_highpage(struct page *to, struct page *from, |
502 |
+diff --git a/arch/arm/mm/copypage-v4wt.c b/arch/arm/mm/copypage-v4wt.c |
503 |
+index b85c5da2e510e..8614572e1296b 100644 |
504 |
+--- a/arch/arm/mm/copypage-v4wt.c |
505 |
++++ b/arch/arm/mm/copypage-v4wt.c |
506 |
+@@ -20,27 +20,26 @@ |
507 |
+ * dirty data in the cache. However, we do have to ensure that |
508 |
+ * subsequent reads are up to date. |
509 |
+ */ |
510 |
+-static void __naked |
511 |
+-v4wt_copy_user_page(void *kto, const void *kfrom) |
512 |
++static void v4wt_copy_user_page(void *kto, const void *kfrom) |
513 |
+ { |
514 |
+- asm("\ |
515 |
+- stmfd sp!, {r4, lr} @ 2\n\ |
516 |
+- mov r2, %2 @ 1\n\ |
517 |
+- ldmia r1!, {r3, r4, ip, lr} @ 4\n\ |
518 |
+-1: stmia r0!, {r3, r4, ip, lr} @ 4\n\ |
519 |
+- ldmia r1!, {r3, r4, ip, lr} @ 4+1\n\ |
520 |
+- stmia r0!, {r3, r4, ip, lr} @ 4\n\ |
521 |
+- ldmia r1!, {r3, r4, ip, lr} @ 4\n\ |
522 |
+- stmia r0!, {r3, r4, ip, lr} @ 4\n\ |
523 |
+- ldmia r1!, {r3, r4, ip, lr} @ 4\n\ |
524 |
+- subs r2, r2, #1 @ 1\n\ |
525 |
+- stmia r0!, {r3, r4, ip, lr} @ 4\n\ |
526 |
+- ldmneia r1!, {r3, r4, ip, lr} @ 4\n\ |
527 |
++ int tmp; |
528 |
++ |
529 |
++ asm volatile ("\ |
530 |
++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\ |
531 |
++1: stmia %0!, {r3, r4, ip, lr} @ 4\n\ |
532 |
++ ldmia %1!, {r3, r4, ip, lr} @ 4+1\n\ |
533 |
++ stmia %0!, {r3, r4, ip, lr} @ 4\n\ |
534 |
++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\ |
535 |
++ stmia %0!, {r3, r4, ip, lr} @ 4\n\ |
536 |
++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\ |
537 |
++ subs %2, %2, #1 @ 1\n\ |
538 |
++ stmia %0!, {r3, r4, ip, lr} @ 4\n\ |
539 |
++ ldmneia %1!, {r3, r4, ip, lr} @ 4\n\ |
540 |
+ bne 1b @ 1\n\ |
541 |
+- mcr p15, 0, r2, c7, c7, 0 @ flush ID cache\n\ |
542 |
+- ldmfd sp!, {r4, pc} @ 3" |
543 |
+- : |
544 |
+- : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64)); |
545 |
++ mcr p15, 0, %2, c7, c7, 0 @ flush ID cache" |
546 |
++ : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp) |
547 |
++ : "2" (PAGE_SIZE / 64) |
548 |
++ : "r3", "r4", "ip", "lr"); |
549 |
+ } |
550 |
+ |
551 |
+ void v4wt_copy_user_highpage(struct page *to, struct page *from, |
552 |
+diff --git a/arch/arm/mm/copypage-xsc3.c b/arch/arm/mm/copypage-xsc3.c |
553 |
+index 03a2042aced5f..55cbc3a89d858 100644 |
554 |
+--- a/arch/arm/mm/copypage-xsc3.c |
555 |
++++ b/arch/arm/mm/copypage-xsc3.c |
556 |
+@@ -21,53 +21,46 @@ |
557 |
+ |
558 |
+ /* |
559 |
+ * XSC3 optimised copy_user_highpage |
560 |
+- * r0 = destination |
561 |
+- * r1 = source |
562 |
+ * |
563 |
+ * The source page may have some clean entries in the cache already, but we |
564 |
+ * can safely ignore them - break_cow() will flush them out of the cache |
565 |
+ * if we eventually end up using our copied page. |
566 |
+ * |
567 |
+ */ |
568 |
+-static void __naked |
569 |
+-xsc3_mc_copy_user_page(void *kto, const void *kfrom) |
570 |
++static void xsc3_mc_copy_user_page(void *kto, const void *kfrom) |
571 |
+ { |
572 |
+- asm("\ |
573 |
+- stmfd sp!, {r4, r5, lr} \n\ |
574 |
+- mov lr, %2 \n\ |
575 |
+- \n\ |
576 |
+- pld [r1, #0] \n\ |
577 |
+- pld [r1, #32] \n\ |
578 |
+-1: pld [r1, #64] \n\ |
579 |
+- pld [r1, #96] \n\ |
580 |
++ int tmp; |
581 |
++ |
582 |
++ asm volatile ("\ |
583 |
++ pld [%1, #0] \n\ |
584 |
++ pld [%1, #32] \n\ |
585 |
++1: pld [%1, #64] \n\ |
586 |
++ pld [%1, #96] \n\ |
587 |
+ \n\ |
588 |
+-2: ldrd r2, [r1], #8 \n\ |
589 |
+- mov ip, r0 \n\ |
590 |
+- ldrd r4, [r1], #8 \n\ |
591 |
+- mcr p15, 0, ip, c7, c6, 1 @ invalidate\n\ |
592 |
+- strd r2, [r0], #8 \n\ |
593 |
+- ldrd r2, [r1], #8 \n\ |
594 |
+- strd r4, [r0], #8 \n\ |
595 |
+- ldrd r4, [r1], #8 \n\ |
596 |
+- strd r2, [r0], #8 \n\ |
597 |
+- strd r4, [r0], #8 \n\ |
598 |
+- ldrd r2, [r1], #8 \n\ |
599 |
+- mov ip, r0 \n\ |
600 |
+- ldrd r4, [r1], #8 \n\ |
601 |
+- mcr p15, 0, ip, c7, c6, 1 @ invalidate\n\ |
602 |
+- strd r2, [r0], #8 \n\ |
603 |
+- ldrd r2, [r1], #8 \n\ |
604 |
+- subs lr, lr, #1 \n\ |
605 |
+- strd r4, [r0], #8 \n\ |
606 |
+- ldrd r4, [r1], #8 \n\ |
607 |
+- strd r2, [r0], #8 \n\ |
608 |
+- strd r4, [r0], #8 \n\ |
609 |
++2: ldrd r2, [%1], #8 \n\ |
610 |
++ ldrd r4, [%1], #8 \n\ |
611 |
++ mcr p15, 0, %0, c7, c6, 1 @ invalidate\n\ |
612 |
++ strd r2, [%0], #8 \n\ |
613 |
++ ldrd r2, [%1], #8 \n\ |
614 |
++ strd r4, [%0], #8 \n\ |
615 |
++ ldrd r4, [%1], #8 \n\ |
616 |
++ strd r2, [%0], #8 \n\ |
617 |
++ strd r4, [%0], #8 \n\ |
618 |
++ ldrd r2, [%1], #8 \n\ |
619 |
++ ldrd r4, [%1], #8 \n\ |
620 |
++ mcr p15, 0, %0, c7, c6, 1 @ invalidate\n\ |
621 |
++ strd r2, [%0], #8 \n\ |
622 |
++ ldrd r2, [%1], #8 \n\ |
623 |
++ subs %2, %2, #1 \n\ |
624 |
++ strd r4, [%0], #8 \n\ |
625 |
++ ldrd r4, [%1], #8 \n\ |
626 |
++ strd r2, [%0], #8 \n\ |
627 |
++ strd r4, [%0], #8 \n\ |
628 |
+ bgt 1b \n\ |
629 |
+- beq 2b \n\ |
630 |
+- \n\ |
631 |
+- ldmfd sp!, {r4, r5, pc}" |
632 |
+- : |
633 |
+- : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64 - 1)); |
634 |
++ beq 2b " |
635 |
++ : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp) |
636 |
++ : "2" (PAGE_SIZE / 64 - 1) |
637 |
++ : "r2", "r3", "r4", "r5"); |
638 |
+ } |
639 |
+ |
640 |
+ void xsc3_mc_copy_user_highpage(struct page *to, struct page *from, |
641 |
+@@ -85,8 +78,6 @@ void xsc3_mc_copy_user_highpage(struct page *to, struct page *from, |
642 |
+ |
643 |
+ /* |
644 |
+ * XScale optimised clear_user_page |
645 |
+- * r0 = destination |
646 |
+- * r1 = virtual user address of ultimate destination page |
647 |
+ */ |
648 |
+ void xsc3_mc_clear_user_highpage(struct page *page, unsigned long vaddr) |
649 |
+ { |
650 |
+diff --git a/arch/arm/mm/copypage-xscale.c b/arch/arm/mm/copypage-xscale.c |
651 |
+index 97972379f4d6a..b0ae8c7acb488 100644 |
652 |
+--- a/arch/arm/mm/copypage-xscale.c |
653 |
++++ b/arch/arm/mm/copypage-xscale.c |
654 |
+@@ -36,52 +36,51 @@ static DEFINE_RAW_SPINLOCK(minicache_lock); |
655 |
+ * Dcache aliasing issue. The writes will be forwarded to the write buffer, |
656 |
+ * and merged as appropriate. |
657 |
+ */ |
658 |
+-static void __naked |
659 |
+-mc_copy_user_page(void *from, void *to) |
660 |
++static void mc_copy_user_page(void *from, void *to) |
661 |
+ { |
662 |
++ int tmp; |
663 |
++ |
664 |
+ /* |
665 |
+ * Strangely enough, best performance is achieved |
666 |
+ * when prefetching destination as well. (NP) |
667 |
+ */ |
668 |
+- asm volatile( |
669 |
+- "stmfd sp!, {r4, r5, lr} \n\ |
670 |
+- mov lr, %2 \n\ |
671 |
+- pld [r0, #0] \n\ |
672 |
+- pld [r0, #32] \n\ |
673 |
+- pld [r1, #0] \n\ |
674 |
+- pld [r1, #32] \n\ |
675 |
+-1: pld [r0, #64] \n\ |
676 |
+- pld [r0, #96] \n\ |
677 |
+- pld [r1, #64] \n\ |
678 |
+- pld [r1, #96] \n\ |
679 |
+-2: ldrd r2, [r0], #8 \n\ |
680 |
+- ldrd r4, [r0], #8 \n\ |
681 |
+- mov ip, r1 \n\ |
682 |
+- strd r2, [r1], #8 \n\ |
683 |
+- ldrd r2, [r0], #8 \n\ |
684 |
+- strd r4, [r1], #8 \n\ |
685 |
+- ldrd r4, [r0], #8 \n\ |
686 |
+- strd r2, [r1], #8 \n\ |
687 |
+- strd r4, [r1], #8 \n\ |
688 |
++ asm volatile ("\ |
689 |
++ pld [%0, #0] \n\ |
690 |
++ pld [%0, #32] \n\ |
691 |
++ pld [%1, #0] \n\ |
692 |
++ pld [%1, #32] \n\ |
693 |
++1: pld [%0, #64] \n\ |
694 |
++ pld [%0, #96] \n\ |
695 |
++ pld [%1, #64] \n\ |
696 |
++ pld [%1, #96] \n\ |
697 |
++2: ldrd r2, [%0], #8 \n\ |
698 |
++ ldrd r4, [%0], #8 \n\ |
699 |
++ mov ip, %1 \n\ |
700 |
++ strd r2, [%1], #8 \n\ |
701 |
++ ldrd r2, [%0], #8 \n\ |
702 |
++ strd r4, [%1], #8 \n\ |
703 |
++ ldrd r4, [%0], #8 \n\ |
704 |
++ strd r2, [%1], #8 \n\ |
705 |
++ strd r4, [%1], #8 \n\ |
706 |
+ mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\ |
707 |
+- ldrd r2, [r0], #8 \n\ |
708 |
++ ldrd r2, [%0], #8 \n\ |
709 |
+ mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\ |
710 |
+- ldrd r4, [r0], #8 \n\ |
711 |
+- mov ip, r1 \n\ |
712 |
+- strd r2, [r1], #8 \n\ |
713 |
+- ldrd r2, [r0], #8 \n\ |
714 |
+- strd r4, [r1], #8 \n\ |
715 |
+- ldrd r4, [r0], #8 \n\ |
716 |
+- strd r2, [r1], #8 \n\ |
717 |
+- strd r4, [r1], #8 \n\ |
718 |
++ ldrd r4, [%0], #8 \n\ |
719 |
++ mov ip, %1 \n\ |
720 |
++ strd r2, [%1], #8 \n\ |
721 |
++ ldrd r2, [%0], #8 \n\ |
722 |
++ strd r4, [%1], #8 \n\ |
723 |
++ ldrd r4, [%0], #8 \n\ |
724 |
++ strd r2, [%1], #8 \n\ |
725 |
++ strd r4, [%1], #8 \n\ |
726 |
+ mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\ |
727 |
+- subs lr, lr, #1 \n\ |
728 |
++ subs %2, %2, #1 \n\ |
729 |
+ mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\ |
730 |
+ bgt 1b \n\ |
731 |
+- beq 2b \n\ |
732 |
+- ldmfd sp!, {r4, r5, pc} " |
733 |
+- : |
734 |
+- : "r" (from), "r" (to), "I" (PAGE_SIZE / 64 - 1)); |
735 |
++ beq 2b " |
736 |
++ : "+&r" (from), "+&r" (to), "=&r" (tmp) |
737 |
++ : "2" (PAGE_SIZE / 64 - 1) |
738 |
++ : "r2", "r3", "r4", "r5", "ip"); |
739 |
+ } |
740 |
+ |
741 |
+ void xscale_mc_copy_user_highpage(struct page *to, struct page *from, |
742 |
+diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig |
743 |
+index 6348b0964e9cb..be4403a8e1b41 100644 |
744 |
+--- a/arch/x86/Kconfig |
745 |
++++ b/arch/x86/Kconfig |
746 |
+@@ -1489,6 +1489,7 @@ config AMD_MEM_ENCRYPT |
747 |
+ bool "AMD Secure Memory Encryption (SME) support" |
748 |
+ depends on X86_64 && CPU_SUP_AMD |
749 |
+ select DYNAMIC_PHYSICAL_MASK |
750 |
++ select ARCH_USE_MEMREMAP_PROT |
751 |
+ ---help--- |
752 |
+ Say yes to enable support for the encryption of system memory. |
753 |
+ This requires an AMD processor that supports Secure Memory |
754 |
+@@ -1507,10 +1508,6 @@ config AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT |
755 |
+ If set to N, then the encryption of system memory can be |
756 |
+ activated with the mem_encrypt=on command line option. |
757 |
+ |
758 |
+-config ARCH_USE_MEMREMAP_PROT |
759 |
+- def_bool y |
760 |
+- depends on AMD_MEM_ENCRYPT |
761 |
+- |
762 |
+ # Common NUMA Features |
763 |
+ config NUMA |
764 |
+ bool "Numa Memory Allocation and Scheduler Support" |
765 |
+@@ -1953,6 +1950,7 @@ config EFI |
766 |
+ depends on ACPI |
767 |
+ select UCS2_STRING |
768 |
+ select EFI_RUNTIME_WRAPPERS |
769 |
++ select ARCH_USE_MEMREMAP_PROT |
770 |
+ ---help--- |
771 |
+ This enables the kernel to use EFI runtime services that are |
772 |
+ available (such as the EFI variable services). |
773 |
+diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c |
774 |
+index c63a545ec1995..adc77904fc3ed 100644 |
775 |
+--- a/arch/x86/mm/ioremap.c |
776 |
++++ b/arch/x86/mm/ioremap.c |
777 |
+@@ -697,7 +697,7 @@ bool phys_mem_access_encrypted(unsigned long phys_addr, unsigned long size) |
778 |
+ return arch_memremap_can_ram_remap(phys_addr, size, 0); |
779 |
+ } |
780 |
+ |
781 |
+-#ifdef CONFIG_ARCH_USE_MEMREMAP_PROT |
782 |
++#ifdef CONFIG_AMD_MEM_ENCRYPT |
783 |
+ /* Remap memory with encryption */ |
784 |
+ void __init *early_memremap_encrypted(resource_size_t phys_addr, |
785 |
+ unsigned long size) |
786 |
+@@ -739,7 +739,7 @@ void __init *early_memremap_decrypted_wp(resource_size_t phys_addr, |
787 |
+ |
788 |
+ return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_NOENC_WP); |
789 |
+ } |
790 |
+-#endif /* CONFIG_ARCH_USE_MEMREMAP_PROT */ |
791 |
++#endif /* CONFIG_AMD_MEM_ENCRYPT */ |
792 |
+ |
793 |
+ static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)] __page_aligned_bss; |
794 |
+ |
795 |
+diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c |
796 |
+index c9873c9168ad9..006eb09e95879 100644 |
797 |
+--- a/arch/x86/platform/efi/quirks.c |
798 |
++++ b/arch/x86/platform/efi/quirks.c |
799 |
+@@ -278,7 +278,8 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size) |
800 |
+ return; |
801 |
+ } |
802 |
+ |
803 |
+- new = early_memremap(new_phys, new_size); |
804 |
++ new = early_memremap_prot(new_phys, new_size, |
805 |
++ pgprot_val(pgprot_encrypted(FIXMAP_PAGE_NORMAL))); |
806 |
+ if (!new) { |
807 |
+ pr_err("Failed to map new boot services memmap\n"); |
808 |
+ return; |
809 |
+diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c |
810 |
+index e7af41d95490d..0950d6fda89cf 100644 |
811 |
+--- a/drivers/ata/libata-scsi.c |
812 |
++++ b/drivers/ata/libata-scsi.c |
813 |
+@@ -3181,8 +3181,19 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc) |
814 |
+ goto invalid_fld; |
815 |
+ } |
816 |
+ |
817 |
+- if (ata_is_ncq(tf->protocol) && (cdb[2 + cdb_offset] & 0x3) == 0) |
818 |
+- tf->protocol = ATA_PROT_NCQ_NODATA; |
819 |
++ if ((cdb[2 + cdb_offset] & 0x3) == 0) { |
820 |
++ /* |
821 |
++ * When T_LENGTH is zero (No data is transferred), dir should |
822 |
++ * be DMA_NONE. |
823 |
++ */ |
824 |
++ if (scmd->sc_data_direction != DMA_NONE) { |
825 |
++ fp = 2 + cdb_offset; |
826 |
++ goto invalid_fld; |
827 |
++ } |
828 |
++ |
829 |
++ if (ata_is_ncq(tf->protocol)) |
830 |
++ tf->protocol = ATA_PROT_NCQ_NODATA; |
831 |
++ } |
832 |
+ |
833 |
+ /* enable LBA */ |
834 |
+ tf->flags |= ATA_TFLAG_LBA; |
835 |
+diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c |
836 |
+index bd756b294d307..a9e07d09b230d 100644 |
837 |
+--- a/drivers/block/xen-blkfront.c |
838 |
++++ b/drivers/block/xen-blkfront.c |
839 |
+@@ -1565,9 +1565,12 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
840 |
+ unsigned long flags; |
841 |
+ struct blkfront_ring_info *rinfo = (struct blkfront_ring_info *)dev_id; |
842 |
+ struct blkfront_info *info = rinfo->dev_info; |
843 |
++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS; |
844 |
+ |
845 |
+- if (unlikely(info->connected != BLKIF_STATE_CONNECTED)) |
846 |
++ if (unlikely(info->connected != BLKIF_STATE_CONNECTED)) { |
847 |
++ xen_irq_lateeoi(irq, XEN_EOI_FLAG_SPURIOUS); |
848 |
+ return IRQ_HANDLED; |
849 |
++ } |
850 |
+ |
851 |
+ spin_lock_irqsave(&rinfo->ring_lock, flags); |
852 |
+ again: |
853 |
+@@ -1583,6 +1586,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
854 |
+ unsigned long id; |
855 |
+ unsigned int op; |
856 |
+ |
857 |
++ eoiflag = 0; |
858 |
++ |
859 |
+ RING_COPY_RESPONSE(&rinfo->ring, i, &bret); |
860 |
+ id = bret.id; |
861 |
+ |
862 |
+@@ -1698,6 +1703,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
863 |
+ |
864 |
+ spin_unlock_irqrestore(&rinfo->ring_lock, flags); |
865 |
+ |
866 |
++ xen_irq_lateeoi(irq, eoiflag); |
867 |
++ |
868 |
+ return IRQ_HANDLED; |
869 |
+ |
870 |
+ err: |
871 |
+@@ -1705,6 +1712,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
872 |
+ |
873 |
+ spin_unlock_irqrestore(&rinfo->ring_lock, flags); |
874 |
+ |
875 |
++ /* No EOI in order to avoid further interrupts. */ |
876 |
++ |
877 |
+ pr_alert("%s disabled for further use\n", info->gd->disk_name); |
878 |
+ return IRQ_HANDLED; |
879 |
+ } |
880 |
+@@ -1744,8 +1753,8 @@ static int setup_blkring(struct xenbus_device *dev, |
881 |
+ if (err) |
882 |
+ goto fail; |
883 |
+ |
884 |
+- err = bind_evtchn_to_irqhandler(rinfo->evtchn, blkif_interrupt, 0, |
885 |
+- "blkif", rinfo); |
886 |
++ err = bind_evtchn_to_irqhandler_lateeoi(rinfo->evtchn, blkif_interrupt, |
887 |
++ 0, "blkif", rinfo); |
888 |
+ if (err <= 0) { |
889 |
+ xenbus_dev_fatal(dev, err, |
890 |
+ "bind_evtchn_to_irqhandler failed"); |
891 |
+diff --git a/drivers/char/agp/parisc-agp.c b/drivers/char/agp/parisc-agp.c |
892 |
+index 15f2e7025b78e..1d5510cb6db4e 100644 |
893 |
+--- a/drivers/char/agp/parisc-agp.c |
894 |
++++ b/drivers/char/agp/parisc-agp.c |
895 |
+@@ -285,7 +285,7 @@ agp_ioc_init(void __iomem *ioc_regs) |
896 |
+ return 0; |
897 |
+ } |
898 |
+ |
899 |
+-static int |
900 |
++static int __init |
901 |
+ lba_find_capability(int cap) |
902 |
+ { |
903 |
+ struct _parisc_agp_info *info = &parisc_agp_info; |
904 |
+@@ -370,7 +370,7 @@ fail: |
905 |
+ return error; |
906 |
+ } |
907 |
+ |
908 |
+-static int |
909 |
++static int __init |
910 |
+ find_quicksilver(struct device *dev, void *data) |
911 |
+ { |
912 |
+ struct parisc_device **lba = data; |
913 |
+@@ -382,7 +382,7 @@ find_quicksilver(struct device *dev, void *data) |
914 |
+ return 0; |
915 |
+ } |
916 |
+ |
917 |
+-static int |
918 |
++static int __init |
919 |
+ parisc_agp_init(void) |
920 |
+ { |
921 |
+ extern struct sba_device *sba_list; |
922 |
+diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c |
923 |
+index bfb79bd0c6de5..087d22ba8a2f6 100644 |
924 |
+--- a/drivers/dma/st_fdma.c |
925 |
++++ b/drivers/dma/st_fdma.c |
926 |
+@@ -886,4 +886,4 @@ MODULE_LICENSE("GPL v2"); |
927 |
+ MODULE_DESCRIPTION("STMicroelectronics FDMA engine driver"); |
928 |
+ MODULE_AUTHOR("Ludovic.barre <Ludovic.barre@××.com>"); |
929 |
+ MODULE_AUTHOR("Peter Griffin <peter.griffin@××××××.org>"); |
930 |
+-MODULE_ALIAS("platform: " DRIVER_NAME); |
931 |
++MODULE_ALIAS("platform:" DRIVER_NAME); |
932 |
+diff --git a/drivers/firmware/scpi_pm_domain.c b/drivers/firmware/scpi_pm_domain.c |
933 |
+index f395dec271131..a6e62a793fbe6 100644 |
934 |
+--- a/drivers/firmware/scpi_pm_domain.c |
935 |
++++ b/drivers/firmware/scpi_pm_domain.c |
936 |
+@@ -27,7 +27,6 @@ struct scpi_pm_domain { |
937 |
+ struct generic_pm_domain genpd; |
938 |
+ struct scpi_ops *ops; |
939 |
+ u32 domain; |
940 |
+- char name[30]; |
941 |
+ }; |
942 |
+ |
943 |
+ /* |
944 |
+@@ -121,8 +120,13 @@ static int scpi_pm_domain_probe(struct platform_device *pdev) |
945 |
+ |
946 |
+ scpi_pd->domain = i; |
947 |
+ scpi_pd->ops = scpi_ops; |
948 |
+- sprintf(scpi_pd->name, "%s.%d", np->name, i); |
949 |
+- scpi_pd->genpd.name = scpi_pd->name; |
950 |
++ scpi_pd->genpd.name = devm_kasprintf(dev, GFP_KERNEL, |
951 |
++ "%s.%d", np->name, i); |
952 |
++ if (!scpi_pd->genpd.name) { |
953 |
++ dev_err(dev, "Failed to allocate genpd name:%s.%d\n", |
954 |
++ np->name, i); |
955 |
++ continue; |
956 |
++ } |
957 |
+ scpi_pd->genpd.power_off = scpi_pd_power_off; |
958 |
+ scpi_pd->genpd.power_on = scpi_pd_power_on; |
959 |
+ |
960 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c |
961 |
+index 28794b1b15c10..d8ae6a23e6133 100644 |
962 |
+--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c |
963 |
++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c |
964 |
+@@ -2198,8 +2198,8 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev) |
965 |
+ AMD_PG_SUPPORT_CP | |
966 |
+ AMD_PG_SUPPORT_GDS | |
967 |
+ AMD_PG_SUPPORT_RLC_SMU_HS)) { |
968 |
+- WREG32(mmRLC_JUMP_TABLE_RESTORE, |
969 |
+- adev->gfx.rlc.cp_table_gpu_addr >> 8); |
970 |
++ WREG32_SOC15(GC, 0, mmRLC_JUMP_TABLE_RESTORE, |
971 |
++ adev->gfx.rlc.cp_table_gpu_addr >> 8); |
972 |
+ gfx_v9_0_init_gfx_power_gating(adev); |
973 |
+ } |
974 |
+ } |
975 |
+diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c |
976 |
+index 77dae147caf90..9abfb19ea7ede 100644 |
977 |
+--- a/drivers/gpu/drm/msm/dsi/dsi_host.c |
978 |
++++ b/drivers/gpu/drm/msm/dsi/dsi_host.c |
979 |
+@@ -1677,6 +1677,8 @@ static int dsi_host_parse_lane_data(struct msm_dsi_host *msm_host, |
980 |
+ if (!prop) { |
981 |
+ dev_dbg(dev, |
982 |
+ "failed to find data lane mapping, using default\n"); |
983 |
++ /* Set the number of date lanes to 4 by default. */ |
984 |
++ msm_host->num_data_lanes = 4; |
985 |
+ return 0; |
986 |
+ } |
987 |
+ |
988 |
+diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c |
989 |
+index 9d3ef879dc51e..f4d0b4986affd 100644 |
990 |
+--- a/drivers/hwmon/dell-smm-hwmon.c |
991 |
++++ b/drivers/hwmon/dell-smm-hwmon.c |
992 |
+@@ -591,15 +591,18 @@ static const struct file_operations i8k_fops = { |
993 |
+ .unlocked_ioctl = i8k_ioctl, |
994 |
+ }; |
995 |
+ |
996 |
++static struct proc_dir_entry *entry; |
997 |
++ |
998 |
+ static void __init i8k_init_procfs(void) |
999 |
+ { |
1000 |
+ /* Register the proc entry */ |
1001 |
+- proc_create("i8k", 0, NULL, &i8k_fops); |
1002 |
++ entry = proc_create("i8k", 0, NULL, &i8k_fops); |
1003 |
+ } |
1004 |
+ |
1005 |
+ static void __exit i8k_exit_procfs(void) |
1006 |
+ { |
1007 |
+- remove_proc_entry("i8k", NULL); |
1008 |
++ if (entry) |
1009 |
++ remove_proc_entry("i8k", NULL); |
1010 |
+ } |
1011 |
+ |
1012 |
+ #else |
1013 |
+diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c |
1014 |
+index b8a2728dd4b69..e76ad020a5420 100644 |
1015 |
+--- a/drivers/i2c/busses/i2c-rk3x.c |
1016 |
++++ b/drivers/i2c/busses/i2c-rk3x.c |
1017 |
+@@ -425,8 +425,8 @@ static void rk3x_i2c_handle_read(struct rk3x_i2c *i2c, unsigned int ipd) |
1018 |
+ if (!(ipd & REG_INT_MBRF)) |
1019 |
+ return; |
1020 |
+ |
1021 |
+- /* ack interrupt */ |
1022 |
+- i2c_writel(i2c, REG_INT_MBRF, REG_IPD); |
1023 |
++ /* ack interrupt (read also produces a spurious START flag, clear it too) */ |
1024 |
++ i2c_writel(i2c, REG_INT_MBRF | REG_INT_START, REG_IPD); |
1025 |
+ |
1026 |
+ /* Can only handle a maximum of 32 bytes at a time */ |
1027 |
+ if (len > 32) |
1028 |
+diff --git a/drivers/input/touchscreen/of_touchscreen.c b/drivers/input/touchscreen/of_touchscreen.c |
1029 |
+index 9642f103b7268..b9baad7d34a75 100644 |
1030 |
+--- a/drivers/input/touchscreen/of_touchscreen.c |
1031 |
++++ b/drivers/input/touchscreen/of_touchscreen.c |
1032 |
+@@ -80,8 +80,8 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch, |
1033 |
+ data_present = touchscreen_get_prop_u32(dev, "touchscreen-size-x", |
1034 |
+ input_abs_get_max(input, |
1035 |
+ axis) + 1, |
1036 |
+- &maximum) | |
1037 |
+- touchscreen_get_prop_u32(dev, "touchscreen-fuzz-x", |
1038 |
++ &maximum); |
1039 |
++ data_present |= touchscreen_get_prop_u32(dev, "touchscreen-fuzz-x", |
1040 |
+ input_abs_get_fuzz(input, axis), |
1041 |
+ &fuzz); |
1042 |
+ if (data_present) |
1043 |
+@@ -91,8 +91,8 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch, |
1044 |
+ data_present = touchscreen_get_prop_u32(dev, "touchscreen-size-y", |
1045 |
+ input_abs_get_max(input, |
1046 |
+ axis) + 1, |
1047 |
+- &maximum) | |
1048 |
+- touchscreen_get_prop_u32(dev, "touchscreen-fuzz-y", |
1049 |
++ &maximum); |
1050 |
++ data_present |= touchscreen_get_prop_u32(dev, "touchscreen-fuzz-y", |
1051 |
+ input_abs_get_fuzz(input, axis), |
1052 |
+ &fuzz); |
1053 |
+ if (data_present) |
1054 |
+@@ -102,11 +102,11 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch, |
1055 |
+ data_present = touchscreen_get_prop_u32(dev, |
1056 |
+ "touchscreen-max-pressure", |
1057 |
+ input_abs_get_max(input, axis), |
1058 |
+- &maximum) | |
1059 |
+- touchscreen_get_prop_u32(dev, |
1060 |
+- "touchscreen-fuzz-pressure", |
1061 |
+- input_abs_get_fuzz(input, axis), |
1062 |
+- &fuzz); |
1063 |
++ &maximum); |
1064 |
++ data_present |= touchscreen_get_prop_u32(dev, |
1065 |
++ "touchscreen-fuzz-pressure", |
1066 |
++ input_abs_get_fuzz(input, axis), |
1067 |
++ &fuzz); |
1068 |
+ if (data_present) |
1069 |
+ touchscreen_set_params(input, axis, maximum, fuzz); |
1070 |
+ |
1071 |
+diff --git a/drivers/md/persistent-data/dm-btree-remove.c b/drivers/md/persistent-data/dm-btree-remove.c |
1072 |
+index 9e4d1212f4c16..63f2baed3c8a6 100644 |
1073 |
+--- a/drivers/md/persistent-data/dm-btree-remove.c |
1074 |
++++ b/drivers/md/persistent-data/dm-btree-remove.c |
1075 |
+@@ -423,9 +423,9 @@ static int rebalance_children(struct shadow_spine *s, |
1076 |
+ |
1077 |
+ memcpy(n, dm_block_data(child), |
1078 |
+ dm_bm_block_size(dm_tm_get_bm(info->tm))); |
1079 |
+- dm_tm_unlock(info->tm, child); |
1080 |
+ |
1081 |
+ dm_tm_dec(info->tm, dm_block_location(child)); |
1082 |
++ dm_tm_unlock(info->tm, child); |
1083 |
+ return 0; |
1084 |
+ } |
1085 |
+ |
1086 |
+diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c |
1087 |
+index 4713ba65e1c22..da2f282b1b3c3 100644 |
1088 |
+--- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c |
1089 |
++++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c |
1090 |
+@@ -932,8 +932,6 @@ static int mxl111sf_init(struct dvb_usb_device *d) |
1091 |
+ .len = sizeof(eeprom), .buf = eeprom }, |
1092 |
+ }; |
1093 |
+ |
1094 |
+- mutex_init(&state->msg_lock); |
1095 |
+- |
1096 |
+ ret = get_chip_info(state); |
1097 |
+ if (mxl_fail(ret)) |
1098 |
+ pr_err("failed to get chip info during probe"); |
1099 |
+@@ -1075,6 +1073,14 @@ static int mxl111sf_get_stream_config_dvbt(struct dvb_frontend *fe, |
1100 |
+ return 0; |
1101 |
+ } |
1102 |
+ |
1103 |
++static int mxl111sf_probe(struct dvb_usb_device *dev) |
1104 |
++{ |
1105 |
++ struct mxl111sf_state *state = d_to_priv(dev); |
1106 |
++ |
1107 |
++ mutex_init(&state->msg_lock); |
1108 |
++ return 0; |
1109 |
++} |
1110 |
++ |
1111 |
+ static struct dvb_usb_device_properties mxl111sf_props_dvbt = { |
1112 |
+ .driver_name = KBUILD_MODNAME, |
1113 |
+ .owner = THIS_MODULE, |
1114 |
+@@ -1084,6 +1090,7 @@ static struct dvb_usb_device_properties mxl111sf_props_dvbt = { |
1115 |
+ .generic_bulk_ctrl_endpoint = 0x02, |
1116 |
+ .generic_bulk_ctrl_endpoint_response = 0x81, |
1117 |
+ |
1118 |
++ .probe = mxl111sf_probe, |
1119 |
+ .i2c_algo = &mxl111sf_i2c_algo, |
1120 |
+ .frontend_attach = mxl111sf_frontend_attach_dvbt, |
1121 |
+ .tuner_attach = mxl111sf_attach_tuner, |
1122 |
+@@ -1125,6 +1132,7 @@ static struct dvb_usb_device_properties mxl111sf_props_atsc = { |
1123 |
+ .generic_bulk_ctrl_endpoint = 0x02, |
1124 |
+ .generic_bulk_ctrl_endpoint_response = 0x81, |
1125 |
+ |
1126 |
++ .probe = mxl111sf_probe, |
1127 |
+ .i2c_algo = &mxl111sf_i2c_algo, |
1128 |
+ .frontend_attach = mxl111sf_frontend_attach_atsc, |
1129 |
+ .tuner_attach = mxl111sf_attach_tuner, |
1130 |
+@@ -1166,6 +1174,7 @@ static struct dvb_usb_device_properties mxl111sf_props_mh = { |
1131 |
+ .generic_bulk_ctrl_endpoint = 0x02, |
1132 |
+ .generic_bulk_ctrl_endpoint_response = 0x81, |
1133 |
+ |
1134 |
++ .probe = mxl111sf_probe, |
1135 |
+ .i2c_algo = &mxl111sf_i2c_algo, |
1136 |
+ .frontend_attach = mxl111sf_frontend_attach_mh, |
1137 |
+ .tuner_attach = mxl111sf_attach_tuner, |
1138 |
+@@ -1234,6 +1243,7 @@ static struct dvb_usb_device_properties mxl111sf_props_atsc_mh = { |
1139 |
+ .generic_bulk_ctrl_endpoint = 0x02, |
1140 |
+ .generic_bulk_ctrl_endpoint_response = 0x81, |
1141 |
+ |
1142 |
++ .probe = mxl111sf_probe, |
1143 |
+ .i2c_algo = &mxl111sf_i2c_algo, |
1144 |
+ .frontend_attach = mxl111sf_frontend_attach_atsc_mh, |
1145 |
+ .tuner_attach = mxl111sf_attach_tuner, |
1146 |
+@@ -1312,6 +1322,7 @@ static struct dvb_usb_device_properties mxl111sf_props_mercury = { |
1147 |
+ .generic_bulk_ctrl_endpoint = 0x02, |
1148 |
+ .generic_bulk_ctrl_endpoint_response = 0x81, |
1149 |
+ |
1150 |
++ .probe = mxl111sf_probe, |
1151 |
+ .i2c_algo = &mxl111sf_i2c_algo, |
1152 |
+ .frontend_attach = mxl111sf_frontend_attach_mercury, |
1153 |
+ .tuner_attach = mxl111sf_attach_tuner, |
1154 |
+@@ -1382,6 +1393,7 @@ static struct dvb_usb_device_properties mxl111sf_props_mercury_mh = { |
1155 |
+ .generic_bulk_ctrl_endpoint = 0x02, |
1156 |
+ .generic_bulk_ctrl_endpoint_response = 0x81, |
1157 |
+ |
1158 |
++ .probe = mxl111sf_probe, |
1159 |
+ .i2c_algo = &mxl111sf_i2c_algo, |
1160 |
+ .frontend_attach = mxl111sf_frontend_attach_mercury_mh, |
1161 |
+ .tuner_attach = mxl111sf_attach_tuner, |
1162 |
+diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c |
1163 |
+index 0c69becc3c177..b3fc8745b5807 100644 |
1164 |
+--- a/drivers/net/ethernet/broadcom/bcmsysport.c |
1165 |
++++ b/drivers/net/ethernet/broadcom/bcmsysport.c |
1166 |
+@@ -120,9 +120,13 @@ static inline void tdma_port_write_desc_addr(struct bcm_sysport_priv *priv, |
1167 |
+ struct dma_desc *desc, |
1168 |
+ unsigned int port) |
1169 |
+ { |
1170 |
++ unsigned long desc_flags; |
1171 |
++ |
1172 |
+ /* Ports are latched, so write upper address first */ |
1173 |
++ spin_lock_irqsave(&priv->desc_lock, desc_flags); |
1174 |
+ tdma_writel(priv, desc->addr_status_len, TDMA_WRITE_PORT_HI(port)); |
1175 |
+ tdma_writel(priv, desc->addr_lo, TDMA_WRITE_PORT_LO(port)); |
1176 |
++ spin_unlock_irqrestore(&priv->desc_lock, desc_flags); |
1177 |
+ } |
1178 |
+ |
1179 |
+ /* Ethtool operations */ |
1180 |
+@@ -2003,6 +2007,7 @@ static int bcm_sysport_open(struct net_device *dev) |
1181 |
+ } |
1182 |
+ |
1183 |
+ /* Initialize both hardware and software ring */ |
1184 |
++ spin_lock_init(&priv->desc_lock); |
1185 |
+ for (i = 0; i < dev->num_tx_queues; i++) { |
1186 |
+ ret = bcm_sysport_init_tx_ring(priv, i); |
1187 |
+ if (ret) { |
1188 |
+diff --git a/drivers/net/ethernet/broadcom/bcmsysport.h b/drivers/net/ethernet/broadcom/bcmsysport.h |
1189 |
+index 36e0adf5c9b8e..f438b818136ae 100644 |
1190 |
+--- a/drivers/net/ethernet/broadcom/bcmsysport.h |
1191 |
++++ b/drivers/net/ethernet/broadcom/bcmsysport.h |
1192 |
+@@ -751,6 +751,7 @@ struct bcm_sysport_priv { |
1193 |
+ int wol_irq; |
1194 |
+ |
1195 |
+ /* Transmit rings */ |
1196 |
++ spinlock_t desc_lock; |
1197 |
+ struct bcm_sysport_tx_ring *tx_rings; |
1198 |
+ |
1199 |
+ /* Receive queue */ |
1200 |
+diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c |
1201 |
+index 6221dafc76b95..74b50f17832d1 100644 |
1202 |
+--- a/drivers/net/ethernet/intel/igb/igb_main.c |
1203 |
++++ b/drivers/net/ethernet/intel/igb/igb_main.c |
1204 |
+@@ -7406,6 +7406,20 @@ static int igb_set_vf_mac_filter(struct igb_adapter *adapter, const int vf, |
1205 |
+ struct vf_mac_filter *entry = NULL; |
1206 |
+ int ret = 0; |
1207 |
+ |
1208 |
++ if ((vf_data->flags & IGB_VF_FLAG_PF_SET_MAC) && |
1209 |
++ !vf_data->trusted) { |
1210 |
++ dev_warn(&pdev->dev, |
1211 |
++ "VF %d requested MAC filter but is administratively denied\n", |
1212 |
++ vf); |
1213 |
++ return -EINVAL; |
1214 |
++ } |
1215 |
++ if (!is_valid_ether_addr(addr)) { |
1216 |
++ dev_warn(&pdev->dev, |
1217 |
++ "VF %d attempted to set invalid MAC filter\n", |
1218 |
++ vf); |
1219 |
++ return -EINVAL; |
1220 |
++ } |
1221 |
++ |
1222 |
+ switch (info) { |
1223 |
+ case E1000_VF_MAC_FILTER_CLR: |
1224 |
+ /* remove all unicast MAC filters related to the current VF */ |
1225 |
+@@ -7419,20 +7433,6 @@ static int igb_set_vf_mac_filter(struct igb_adapter *adapter, const int vf, |
1226 |
+ } |
1227 |
+ break; |
1228 |
+ case E1000_VF_MAC_FILTER_ADD: |
1229 |
+- if ((vf_data->flags & IGB_VF_FLAG_PF_SET_MAC) && |
1230 |
+- !vf_data->trusted) { |
1231 |
+- dev_warn(&pdev->dev, |
1232 |
+- "VF %d requested MAC filter but is administratively denied\n", |
1233 |
+- vf); |
1234 |
+- return -EINVAL; |
1235 |
+- } |
1236 |
+- if (!is_valid_ether_addr(addr)) { |
1237 |
+- dev_warn(&pdev->dev, |
1238 |
+- "VF %d attempted to set invalid MAC filter\n", |
1239 |
+- vf); |
1240 |
+- return -EINVAL; |
1241 |
+- } |
1242 |
+- |
1243 |
+ /* try to find empty slot in the list */ |
1244 |
+ list_for_each(pos, &adapter->vf_macs.l) { |
1245 |
+ entry = list_entry(pos, struct vf_mac_filter, l); |
1246 |
+diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c |
1247 |
+index e0c989ffb2b3e..df827c2541628 100644 |
1248 |
+--- a/drivers/net/ethernet/intel/igbvf/netdev.c |
1249 |
++++ b/drivers/net/ethernet/intel/igbvf/netdev.c |
1250 |
+@@ -2888,6 +2888,7 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
1251 |
+ return 0; |
1252 |
+ |
1253 |
+ err_hw_init: |
1254 |
++ netif_napi_del(&adapter->rx_ring->napi); |
1255 |
+ kfree(adapter->tx_ring); |
1256 |
+ kfree(adapter->rx_ring); |
1257 |
+ err_sw_init: |
1258 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c |
1259 |
+index 9772016222c30..9277d57c4a70b 100644 |
1260 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c |
1261 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c |
1262 |
+@@ -3391,6 +3391,9 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw) |
1263 |
+ /* flush pending Tx transactions */ |
1264 |
+ ixgbe_clear_tx_pending(hw); |
1265 |
+ |
1266 |
++ /* set MDIO speed before talking to the PHY in case it's the 1st time */ |
1267 |
++ ixgbe_set_mdio_speed(hw); |
1268 |
++ |
1269 |
+ /* PHY ops must be identified and initialized prior to reset */ |
1270 |
+ status = hw->phy.ops.init(hw); |
1271 |
+ if (status == IXGBE_ERR_SFP_NOT_SUPPORTED || |
1272 |
+diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c |
1273 |
+index 6a005014d46af..f652cfd8127bf 100644 |
1274 |
+--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c |
1275 |
++++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c |
1276 |
+@@ -663,7 +663,7 @@ void __init mlx4_en_init_ptys2ethtool_map(void) |
1277 |
+ MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_1000BASE_T, SPEED_1000, |
1278 |
+ ETHTOOL_LINK_MODE_1000baseT_Full_BIT); |
1279 |
+ MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_1000BASE_CX_SGMII, SPEED_1000, |
1280 |
+- ETHTOOL_LINK_MODE_1000baseKX_Full_BIT); |
1281 |
++ ETHTOOL_LINK_MODE_1000baseX_Full_BIT); |
1282 |
+ MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_1000BASE_KX, SPEED_1000, |
1283 |
+ ETHTOOL_LINK_MODE_1000baseKX_Full_BIT); |
1284 |
+ MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_10GBASE_T, SPEED_10000, |
1285 |
+@@ -675,9 +675,9 @@ void __init mlx4_en_init_ptys2ethtool_map(void) |
1286 |
+ MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_10GBASE_KR, SPEED_10000, |
1287 |
+ ETHTOOL_LINK_MODE_10000baseKR_Full_BIT); |
1288 |
+ MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_10GBASE_CR, SPEED_10000, |
1289 |
+- ETHTOOL_LINK_MODE_10000baseKR_Full_BIT); |
1290 |
++ ETHTOOL_LINK_MODE_10000baseCR_Full_BIT); |
1291 |
+ MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_10GBASE_SR, SPEED_10000, |
1292 |
+- ETHTOOL_LINK_MODE_10000baseKR_Full_BIT); |
1293 |
++ ETHTOOL_LINK_MODE_10000baseSR_Full_BIT); |
1294 |
+ MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_20GBASE_KR2, SPEED_20000, |
1295 |
+ ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT, |
1296 |
+ ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT); |
1297 |
+diff --git a/drivers/net/netdevsim/bpf.c b/drivers/net/netdevsim/bpf.c |
1298 |
+index 81444208b2162..12f100392ed11 100644 |
1299 |
+--- a/drivers/net/netdevsim/bpf.c |
1300 |
++++ b/drivers/net/netdevsim/bpf.c |
1301 |
+@@ -493,6 +493,7 @@ nsim_bpf_map_alloc(struct netdevsim *ns, struct bpf_offloaded_map *offmap) |
1302 |
+ goto err_free; |
1303 |
+ key = nmap->entry[i].key; |
1304 |
+ *key = i; |
1305 |
++ memset(nmap->entry[i].value, 0, offmap->map.value_size); |
1306 |
+ } |
1307 |
+ } |
1308 |
+ |
1309 |
+diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c |
1310 |
+index b328207c04555..f438be83d2594 100644 |
1311 |
+--- a/drivers/net/usb/lan78xx.c |
1312 |
++++ b/drivers/net/usb/lan78xx.c |
1313 |
+@@ -945,11 +945,9 @@ static int lan78xx_read_otp(struct lan78xx_net *dev, u32 offset, |
1314 |
+ ret = lan78xx_read_raw_otp(dev, 0, 1, &sig); |
1315 |
+ |
1316 |
+ if (ret == 0) { |
1317 |
+- if (sig == OTP_INDICATOR_1) |
1318 |
+- offset = offset; |
1319 |
+- else if (sig == OTP_INDICATOR_2) |
1320 |
++ if (sig == OTP_INDICATOR_2) |
1321 |
+ offset += 0x100; |
1322 |
+- else |
1323 |
++ else if (sig != OTP_INDICATOR_1) |
1324 |
+ ret = -EINVAL; |
1325 |
+ if (!ret) |
1326 |
+ ret = lan78xx_read_raw_otp(dev, offset, length, data); |
1327 |
+diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c |
1328 |
+index 60db2b969e20d..b7ced103b8143 100644 |
1329 |
+--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c |
1330 |
++++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c |
1331 |
+@@ -324,9 +324,9 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter) |
1332 |
+ |
1333 |
+ adapter->seq_num++; |
1334 |
+ sleep_cfm_buf->seq_num = |
1335 |
+- cpu_to_le16((HostCmd_SET_SEQ_NO_BSS_INFO |
1336 |
++ cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO |
1337 |
+ (adapter->seq_num, priv->bss_num, |
1338 |
+- priv->bss_type))); |
1339 |
++ priv->bss_type)); |
1340 |
+ |
1341 |
+ mwifiex_dbg(adapter, CMD, |
1342 |
+ "cmd: DNLD_CMD: %#x, act %#x, len %d, seqno %#x\n", |
1343 |
+diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h |
1344 |
+index 8b9d0809daf62..076ea1c4b921d 100644 |
1345 |
+--- a/drivers/net/wireless/marvell/mwifiex/fw.h |
1346 |
++++ b/drivers/net/wireless/marvell/mwifiex/fw.h |
1347 |
+@@ -512,10 +512,10 @@ enum mwifiex_channel_flags { |
1348 |
+ |
1349 |
+ #define RF_ANTENNA_AUTO 0xFFFF |
1350 |
+ |
1351 |
+-#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \ |
1352 |
+- (((seq) & 0x00ff) | \ |
1353 |
+- (((num) & 0x000f) << 8)) | \ |
1354 |
+- (((type) & 0x000f) << 12); } |
1355 |
++#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) \ |
1356 |
++ ((((seq) & 0x00ff) | \ |
1357 |
++ (((num) & 0x000f) << 8)) | \ |
1358 |
++ (((type) & 0x000f) << 12)) |
1359 |
+ |
1360 |
+ #define HostCmd_GET_SEQ_NO(seq) \ |
1361 |
+ ((seq) & HostCmd_SEQ_NUM_MASK) |
1362 |
+diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h |
1363 |
+index 86d23d0f563c4..751254dcee3b5 100644 |
1364 |
+--- a/drivers/net/xen-netback/common.h |
1365 |
++++ b/drivers/net/xen-netback/common.h |
1366 |
+@@ -203,6 +203,7 @@ struct xenvif_queue { /* Per-queue data for xenvif */ |
1367 |
+ unsigned int rx_queue_max; |
1368 |
+ unsigned int rx_queue_len; |
1369 |
+ unsigned long last_rx_time; |
1370 |
++ unsigned int rx_slots_needed; |
1371 |
+ bool stalled; |
1372 |
+ |
1373 |
+ struct xenvif_copy_state rx_copy; |
1374 |
+diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c |
1375 |
+index 48e2006f96ce6..7f68067c01745 100644 |
1376 |
+--- a/drivers/net/xen-netback/rx.c |
1377 |
++++ b/drivers/net/xen-netback/rx.c |
1378 |
+@@ -33,28 +33,36 @@ |
1379 |
+ #include <xen/xen.h> |
1380 |
+ #include <xen/events.h> |
1381 |
+ |
1382 |
+-static bool xenvif_rx_ring_slots_available(struct xenvif_queue *queue) |
1383 |
++/* |
1384 |
++ * Update the needed ring page slots for the first SKB queued. |
1385 |
++ * Note that any call sequence outside the RX thread calling this function |
1386 |
++ * needs to wake up the RX thread via a call of xenvif_kick_thread() |
1387 |
++ * afterwards in order to avoid a race with putting the thread to sleep. |
1388 |
++ */ |
1389 |
++static void xenvif_update_needed_slots(struct xenvif_queue *queue, |
1390 |
++ const struct sk_buff *skb) |
1391 |
+ { |
1392 |
+- RING_IDX prod, cons; |
1393 |
+- struct sk_buff *skb; |
1394 |
+- int needed; |
1395 |
+- unsigned long flags; |
1396 |
+- |
1397 |
+- spin_lock_irqsave(&queue->rx_queue.lock, flags); |
1398 |
++ unsigned int needed = 0; |
1399 |
+ |
1400 |
+- skb = skb_peek(&queue->rx_queue); |
1401 |
+- if (!skb) { |
1402 |
+- spin_unlock_irqrestore(&queue->rx_queue.lock, flags); |
1403 |
+- return false; |
1404 |
++ if (skb) { |
1405 |
++ needed = DIV_ROUND_UP(skb->len, XEN_PAGE_SIZE); |
1406 |
++ if (skb_is_gso(skb)) |
1407 |
++ needed++; |
1408 |
++ if (skb->sw_hash) |
1409 |
++ needed++; |
1410 |
+ } |
1411 |
+ |
1412 |
+- needed = DIV_ROUND_UP(skb->len, XEN_PAGE_SIZE); |
1413 |
+- if (skb_is_gso(skb)) |
1414 |
+- needed++; |
1415 |
+- if (skb->sw_hash) |
1416 |
+- needed++; |
1417 |
++ WRITE_ONCE(queue->rx_slots_needed, needed); |
1418 |
++} |
1419 |
+ |
1420 |
+- spin_unlock_irqrestore(&queue->rx_queue.lock, flags); |
1421 |
++static bool xenvif_rx_ring_slots_available(struct xenvif_queue *queue) |
1422 |
++{ |
1423 |
++ RING_IDX prod, cons; |
1424 |
++ unsigned int needed; |
1425 |
++ |
1426 |
++ needed = READ_ONCE(queue->rx_slots_needed); |
1427 |
++ if (!needed) |
1428 |
++ return false; |
1429 |
+ |
1430 |
+ do { |
1431 |
+ prod = queue->rx.sring->req_prod; |
1432 |
+@@ -80,13 +88,19 @@ void xenvif_rx_queue_tail(struct xenvif_queue *queue, struct sk_buff *skb) |
1433 |
+ |
1434 |
+ spin_lock_irqsave(&queue->rx_queue.lock, flags); |
1435 |
+ |
1436 |
+- __skb_queue_tail(&queue->rx_queue, skb); |
1437 |
+- |
1438 |
+- queue->rx_queue_len += skb->len; |
1439 |
+- if (queue->rx_queue_len > queue->rx_queue_max) { |
1440 |
++ if (queue->rx_queue_len >= queue->rx_queue_max) { |
1441 |
+ struct net_device *dev = queue->vif->dev; |
1442 |
+ |
1443 |
+ netif_tx_stop_queue(netdev_get_tx_queue(dev, queue->id)); |
1444 |
++ kfree_skb(skb); |
1445 |
++ queue->vif->dev->stats.rx_dropped++; |
1446 |
++ } else { |
1447 |
++ if (skb_queue_empty(&queue->rx_queue)) |
1448 |
++ xenvif_update_needed_slots(queue, skb); |
1449 |
++ |
1450 |
++ __skb_queue_tail(&queue->rx_queue, skb); |
1451 |
++ |
1452 |
++ queue->rx_queue_len += skb->len; |
1453 |
+ } |
1454 |
+ |
1455 |
+ spin_unlock_irqrestore(&queue->rx_queue.lock, flags); |
1456 |
+@@ -100,6 +114,8 @@ static struct sk_buff *xenvif_rx_dequeue(struct xenvif_queue *queue) |
1457 |
+ |
1458 |
+ skb = __skb_dequeue(&queue->rx_queue); |
1459 |
+ if (skb) { |
1460 |
++ xenvif_update_needed_slots(queue, skb_peek(&queue->rx_queue)); |
1461 |
++ |
1462 |
+ queue->rx_queue_len -= skb->len; |
1463 |
+ if (queue->rx_queue_len < queue->rx_queue_max) { |
1464 |
+ struct netdev_queue *txq; |
1465 |
+@@ -134,6 +150,7 @@ static void xenvif_rx_queue_drop_expired(struct xenvif_queue *queue) |
1466 |
+ break; |
1467 |
+ xenvif_rx_dequeue(queue); |
1468 |
+ kfree_skb(skb); |
1469 |
++ queue->vif->dev->stats.rx_dropped++; |
1470 |
+ } |
1471 |
+ } |
1472 |
+ |
1473 |
+@@ -474,27 +491,31 @@ void xenvif_rx_action(struct xenvif_queue *queue) |
1474 |
+ xenvif_rx_copy_flush(queue); |
1475 |
+ } |
1476 |
+ |
1477 |
+-static bool xenvif_rx_queue_stalled(struct xenvif_queue *queue) |
1478 |
++static RING_IDX xenvif_rx_queue_slots(const struct xenvif_queue *queue) |
1479 |
+ { |
1480 |
+ RING_IDX prod, cons; |
1481 |
+ |
1482 |
+ prod = queue->rx.sring->req_prod; |
1483 |
+ cons = queue->rx.req_cons; |
1484 |
+ |
1485 |
++ return prod - cons; |
1486 |
++} |
1487 |
++ |
1488 |
++static bool xenvif_rx_queue_stalled(const struct xenvif_queue *queue) |
1489 |
++{ |
1490 |
++ unsigned int needed = READ_ONCE(queue->rx_slots_needed); |
1491 |
++ |
1492 |
+ return !queue->stalled && |
1493 |
+- prod - cons < 1 && |
1494 |
++ xenvif_rx_queue_slots(queue) < needed && |
1495 |
+ time_after(jiffies, |
1496 |
+ queue->last_rx_time + queue->vif->stall_timeout); |
1497 |
+ } |
1498 |
+ |
1499 |
+ static bool xenvif_rx_queue_ready(struct xenvif_queue *queue) |
1500 |
+ { |
1501 |
+- RING_IDX prod, cons; |
1502 |
+- |
1503 |
+- prod = queue->rx.sring->req_prod; |
1504 |
+- cons = queue->rx.req_cons; |
1505 |
++ unsigned int needed = READ_ONCE(queue->rx_slots_needed); |
1506 |
+ |
1507 |
+- return queue->stalled && prod - cons >= 1; |
1508 |
++ return queue->stalled && xenvif_rx_queue_slots(queue) >= needed; |
1509 |
+ } |
1510 |
+ |
1511 |
+ bool xenvif_have_rx_work(struct xenvif_queue *queue, bool test_kthread) |
1512 |
+diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c |
1513 |
+index 434a009c52d90..0e357a022388a 100644 |
1514 |
+--- a/drivers/net/xen-netfront.c |
1515 |
++++ b/drivers/net/xen-netfront.c |
1516 |
+@@ -142,6 +142,9 @@ struct netfront_queue { |
1517 |
+ struct sk_buff *rx_skbs[NET_RX_RING_SIZE]; |
1518 |
+ grant_ref_t gref_rx_head; |
1519 |
+ grant_ref_t grant_rx_ref[NET_RX_RING_SIZE]; |
1520 |
++ |
1521 |
++ unsigned int rx_rsp_unconsumed; |
1522 |
++ spinlock_t rx_cons_lock; |
1523 |
+ }; |
1524 |
+ |
1525 |
+ struct netfront_info { |
1526 |
+@@ -366,12 +369,13 @@ static int xennet_open(struct net_device *dev) |
1527 |
+ return 0; |
1528 |
+ } |
1529 |
+ |
1530 |
+-static void xennet_tx_buf_gc(struct netfront_queue *queue) |
1531 |
++static bool xennet_tx_buf_gc(struct netfront_queue *queue) |
1532 |
+ { |
1533 |
+ RING_IDX cons, prod; |
1534 |
+ unsigned short id; |
1535 |
+ struct sk_buff *skb; |
1536 |
+ bool more_to_do; |
1537 |
++ bool work_done = false; |
1538 |
+ const struct device *dev = &queue->info->netdev->dev; |
1539 |
+ |
1540 |
+ BUG_ON(!netif_carrier_ok(queue->info->netdev)); |
1541 |
+@@ -388,6 +392,8 @@ static void xennet_tx_buf_gc(struct netfront_queue *queue) |
1542 |
+ for (cons = queue->tx.rsp_cons; cons != prod; cons++) { |
1543 |
+ struct xen_netif_tx_response txrsp; |
1544 |
+ |
1545 |
++ work_done = true; |
1546 |
++ |
1547 |
+ RING_COPY_RESPONSE(&queue->tx, cons, &txrsp); |
1548 |
+ if (txrsp.status == XEN_NETIF_RSP_NULL) |
1549 |
+ continue; |
1550 |
+@@ -431,11 +437,13 @@ static void xennet_tx_buf_gc(struct netfront_queue *queue) |
1551 |
+ |
1552 |
+ xennet_maybe_wake_tx(queue); |
1553 |
+ |
1554 |
+- return; |
1555 |
++ return work_done; |
1556 |
+ |
1557 |
+ err: |
1558 |
+ queue->info->broken = true; |
1559 |
+ dev_alert(dev, "Disabled for further use\n"); |
1560 |
++ |
1561 |
++ return work_done; |
1562 |
+ } |
1563 |
+ |
1564 |
+ struct xennet_gnttab_make_txreq { |
1565 |
+@@ -756,6 +764,16 @@ static int xennet_close(struct net_device *dev) |
1566 |
+ return 0; |
1567 |
+ } |
1568 |
+ |
1569 |
++static void xennet_set_rx_rsp_cons(struct netfront_queue *queue, RING_IDX val) |
1570 |
++{ |
1571 |
++ unsigned long flags; |
1572 |
++ |
1573 |
++ spin_lock_irqsave(&queue->rx_cons_lock, flags); |
1574 |
++ queue->rx.rsp_cons = val; |
1575 |
++ queue->rx_rsp_unconsumed = RING_HAS_UNCONSUMED_RESPONSES(&queue->rx); |
1576 |
++ spin_unlock_irqrestore(&queue->rx_cons_lock, flags); |
1577 |
++} |
1578 |
++ |
1579 |
+ static void xennet_move_rx_slot(struct netfront_queue *queue, struct sk_buff *skb, |
1580 |
+ grant_ref_t ref) |
1581 |
+ { |
1582 |
+@@ -807,7 +825,7 @@ static int xennet_get_extras(struct netfront_queue *queue, |
1583 |
+ xennet_move_rx_slot(queue, skb, ref); |
1584 |
+ } while (extra.flags & XEN_NETIF_EXTRA_FLAG_MORE); |
1585 |
+ |
1586 |
+- queue->rx.rsp_cons = cons; |
1587 |
++ xennet_set_rx_rsp_cons(queue, cons); |
1588 |
+ return err; |
1589 |
+ } |
1590 |
+ |
1591 |
+@@ -887,7 +905,7 @@ next: |
1592 |
+ } |
1593 |
+ |
1594 |
+ if (unlikely(err)) |
1595 |
+- queue->rx.rsp_cons = cons + slots; |
1596 |
++ xennet_set_rx_rsp_cons(queue, cons + slots); |
1597 |
+ |
1598 |
+ return err; |
1599 |
+ } |
1600 |
+@@ -941,7 +959,8 @@ static int xennet_fill_frags(struct netfront_queue *queue, |
1601 |
+ __pskb_pull_tail(skb, pull_to - skb_headlen(skb)); |
1602 |
+ } |
1603 |
+ if (unlikely(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS)) { |
1604 |
+- queue->rx.rsp_cons = ++cons + skb_queue_len(list); |
1605 |
++ xennet_set_rx_rsp_cons(queue, |
1606 |
++ ++cons + skb_queue_len(list)); |
1607 |
+ kfree_skb(nskb); |
1608 |
+ return -ENOENT; |
1609 |
+ } |
1610 |
+@@ -954,7 +973,7 @@ static int xennet_fill_frags(struct netfront_queue *queue, |
1611 |
+ kfree_skb(nskb); |
1612 |
+ } |
1613 |
+ |
1614 |
+- queue->rx.rsp_cons = cons; |
1615 |
++ xennet_set_rx_rsp_cons(queue, cons); |
1616 |
+ |
1617 |
+ return 0; |
1618 |
+ } |
1619 |
+@@ -1075,7 +1094,9 @@ err: |
1620 |
+ |
1621 |
+ if (unlikely(xennet_set_skb_gso(skb, gso))) { |
1622 |
+ __skb_queue_head(&tmpq, skb); |
1623 |
+- queue->rx.rsp_cons += skb_queue_len(&tmpq); |
1624 |
++ xennet_set_rx_rsp_cons(queue, |
1625 |
++ queue->rx.rsp_cons + |
1626 |
++ skb_queue_len(&tmpq)); |
1627 |
+ goto err; |
1628 |
+ } |
1629 |
+ } |
1630 |
+@@ -1099,7 +1120,8 @@ err: |
1631 |
+ |
1632 |
+ __skb_queue_tail(&rxq, skb); |
1633 |
+ |
1634 |
+- i = ++queue->rx.rsp_cons; |
1635 |
++ i = queue->rx.rsp_cons + 1; |
1636 |
++ xennet_set_rx_rsp_cons(queue, i); |
1637 |
+ work_done++; |
1638 |
+ } |
1639 |
+ |
1640 |
+@@ -1261,40 +1283,79 @@ static int xennet_set_features(struct net_device *dev, |
1641 |
+ return 0; |
1642 |
+ } |
1643 |
+ |
1644 |
+-static irqreturn_t xennet_tx_interrupt(int irq, void *dev_id) |
1645 |
++static bool xennet_handle_tx(struct netfront_queue *queue, unsigned int *eoi) |
1646 |
+ { |
1647 |
+- struct netfront_queue *queue = dev_id; |
1648 |
+ unsigned long flags; |
1649 |
+ |
1650 |
+- if (queue->info->broken) |
1651 |
+- return IRQ_HANDLED; |
1652 |
++ if (unlikely(queue->info->broken)) |
1653 |
++ return false; |
1654 |
+ |
1655 |
+ spin_lock_irqsave(&queue->tx_lock, flags); |
1656 |
+- xennet_tx_buf_gc(queue); |
1657 |
++ if (xennet_tx_buf_gc(queue)) |
1658 |
++ *eoi = 0; |
1659 |
+ spin_unlock_irqrestore(&queue->tx_lock, flags); |
1660 |
+ |
1661 |
++ return true; |
1662 |
++} |
1663 |
++ |
1664 |
++static irqreturn_t xennet_tx_interrupt(int irq, void *dev_id) |
1665 |
++{ |
1666 |
++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS; |
1667 |
++ |
1668 |
++ if (likely(xennet_handle_tx(dev_id, &eoiflag))) |
1669 |
++ xen_irq_lateeoi(irq, eoiflag); |
1670 |
++ |
1671 |
+ return IRQ_HANDLED; |
1672 |
+ } |
1673 |
+ |
1674 |
+-static irqreturn_t xennet_rx_interrupt(int irq, void *dev_id) |
1675 |
++static bool xennet_handle_rx(struct netfront_queue *queue, unsigned int *eoi) |
1676 |
+ { |
1677 |
+- struct netfront_queue *queue = dev_id; |
1678 |
+- struct net_device *dev = queue->info->netdev; |
1679 |
++ unsigned int work_queued; |
1680 |
++ unsigned long flags; |
1681 |
+ |
1682 |
+- if (queue->info->broken) |
1683 |
+- return IRQ_HANDLED; |
1684 |
++ if (unlikely(queue->info->broken)) |
1685 |
++ return false; |
1686 |
++ |
1687 |
++ spin_lock_irqsave(&queue->rx_cons_lock, flags); |
1688 |
++ work_queued = RING_HAS_UNCONSUMED_RESPONSES(&queue->rx); |
1689 |
++ if (work_queued > queue->rx_rsp_unconsumed) { |
1690 |
++ queue->rx_rsp_unconsumed = work_queued; |
1691 |
++ *eoi = 0; |
1692 |
++ } else if (unlikely(work_queued < queue->rx_rsp_unconsumed)) { |
1693 |
++ const struct device *dev = &queue->info->netdev->dev; |
1694 |
++ |
1695 |
++ spin_unlock_irqrestore(&queue->rx_cons_lock, flags); |
1696 |
++ dev_alert(dev, "RX producer index going backwards\n"); |
1697 |
++ dev_alert(dev, "Disabled for further use\n"); |
1698 |
++ queue->info->broken = true; |
1699 |
++ return false; |
1700 |
++ } |
1701 |
++ spin_unlock_irqrestore(&queue->rx_cons_lock, flags); |
1702 |
+ |
1703 |
+- if (likely(netif_carrier_ok(dev) && |
1704 |
+- RING_HAS_UNCONSUMED_RESPONSES(&queue->rx))) |
1705 |
++ if (likely(netif_carrier_ok(queue->info->netdev) && work_queued)) |
1706 |
+ napi_schedule(&queue->napi); |
1707 |
+ |
1708 |
++ return true; |
1709 |
++} |
1710 |
++ |
1711 |
++static irqreturn_t xennet_rx_interrupt(int irq, void *dev_id) |
1712 |
++{ |
1713 |
++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS; |
1714 |
++ |
1715 |
++ if (likely(xennet_handle_rx(dev_id, &eoiflag))) |
1716 |
++ xen_irq_lateeoi(irq, eoiflag); |
1717 |
++ |
1718 |
+ return IRQ_HANDLED; |
1719 |
+ } |
1720 |
+ |
1721 |
+ static irqreturn_t xennet_interrupt(int irq, void *dev_id) |
1722 |
+ { |
1723 |
+- xennet_tx_interrupt(irq, dev_id); |
1724 |
+- xennet_rx_interrupt(irq, dev_id); |
1725 |
++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS; |
1726 |
++ |
1727 |
++ if (xennet_handle_tx(dev_id, &eoiflag) && |
1728 |
++ xennet_handle_rx(dev_id, &eoiflag)) |
1729 |
++ xen_irq_lateeoi(irq, eoiflag); |
1730 |
++ |
1731 |
+ return IRQ_HANDLED; |
1732 |
+ } |
1733 |
+ |
1734 |
+@@ -1528,9 +1589,10 @@ static int setup_netfront_single(struct netfront_queue *queue) |
1735 |
+ if (err < 0) |
1736 |
+ goto fail; |
1737 |
+ |
1738 |
+- err = bind_evtchn_to_irqhandler(queue->tx_evtchn, |
1739 |
+- xennet_interrupt, |
1740 |
+- 0, queue->info->netdev->name, queue); |
1741 |
++ err = bind_evtchn_to_irqhandler_lateeoi(queue->tx_evtchn, |
1742 |
++ xennet_interrupt, 0, |
1743 |
++ queue->info->netdev->name, |
1744 |
++ queue); |
1745 |
+ if (err < 0) |
1746 |
+ goto bind_fail; |
1747 |
+ queue->rx_evtchn = queue->tx_evtchn; |
1748 |
+@@ -1558,18 +1620,18 @@ static int setup_netfront_split(struct netfront_queue *queue) |
1749 |
+ |
1750 |
+ snprintf(queue->tx_irq_name, sizeof(queue->tx_irq_name), |
1751 |
+ "%s-tx", queue->name); |
1752 |
+- err = bind_evtchn_to_irqhandler(queue->tx_evtchn, |
1753 |
+- xennet_tx_interrupt, |
1754 |
+- 0, queue->tx_irq_name, queue); |
1755 |
++ err = bind_evtchn_to_irqhandler_lateeoi(queue->tx_evtchn, |
1756 |
++ xennet_tx_interrupt, 0, |
1757 |
++ queue->tx_irq_name, queue); |
1758 |
+ if (err < 0) |
1759 |
+ goto bind_tx_fail; |
1760 |
+ queue->tx_irq = err; |
1761 |
+ |
1762 |
+ snprintf(queue->rx_irq_name, sizeof(queue->rx_irq_name), |
1763 |
+ "%s-rx", queue->name); |
1764 |
+- err = bind_evtchn_to_irqhandler(queue->rx_evtchn, |
1765 |
+- xennet_rx_interrupt, |
1766 |
+- 0, queue->rx_irq_name, queue); |
1767 |
++ err = bind_evtchn_to_irqhandler_lateeoi(queue->rx_evtchn, |
1768 |
++ xennet_rx_interrupt, 0, |
1769 |
++ queue->rx_irq_name, queue); |
1770 |
+ if (err < 0) |
1771 |
+ goto bind_rx_fail; |
1772 |
+ queue->rx_irq = err; |
1773 |
+@@ -1671,6 +1733,7 @@ static int xennet_init_queue(struct netfront_queue *queue) |
1774 |
+ |
1775 |
+ spin_lock_init(&queue->tx_lock); |
1776 |
+ spin_lock_init(&queue->rx_lock); |
1777 |
++ spin_lock_init(&queue->rx_cons_lock); |
1778 |
+ |
1779 |
+ timer_setup(&queue->rx_refill_timer, rx_refill_timeout, 0); |
1780 |
+ |
1781 |
+diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c |
1782 |
+index d42c84a2d2eba..c585ae3278de5 100644 |
1783 |
+--- a/drivers/pci/msi.c |
1784 |
++++ b/drivers/pci/msi.c |
1785 |
+@@ -799,9 +799,6 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries, |
1786 |
+ goto out_disable; |
1787 |
+ } |
1788 |
+ |
1789 |
+- /* Ensure that all table entries are masked. */ |
1790 |
+- msix_mask_all(base, tsize); |
1791 |
+- |
1792 |
+ ret = msix_setup_entries(dev, base, entries, nvec, affd); |
1793 |
+ if (ret) |
1794 |
+ goto out_disable; |
1795 |
+@@ -824,6 +821,16 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries, |
1796 |
+ /* Set MSI-X enabled bits and unmask the function */ |
1797 |
+ pci_intx_for_msi(dev, 0); |
1798 |
+ dev->msix_enabled = 1; |
1799 |
++ |
1800 |
++ /* |
1801 |
++ * Ensure that all table entries are masked to prevent |
1802 |
++ * stale entries from firing in a crash kernel. |
1803 |
++ * |
1804 |
++ * Done late to deal with a broken Marvell NVME device |
1805 |
++ * which takes the MSI-X mask bits into account even |
1806 |
++ * when MSI-X is disabled, which prevents MSI delivery. |
1807 |
++ */ |
1808 |
++ msix_mask_all(base, tsize); |
1809 |
+ pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL, 0); |
1810 |
+ |
1811 |
+ pcibios_free_irq(dev); |
1812 |
+@@ -850,7 +857,7 @@ out_free: |
1813 |
+ free_msi_irqs(dev); |
1814 |
+ |
1815 |
+ out_disable: |
1816 |
+- pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0); |
1817 |
++ pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL | PCI_MSIX_FLAGS_ENABLE, 0); |
1818 |
+ |
1819 |
+ return ret; |
1820 |
+ } |
1821 |
+diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c |
1822 |
+index d2b045eb72742..4d73a7f67dea9 100644 |
1823 |
+--- a/drivers/scsi/scsi_debug.c |
1824 |
++++ b/drivers/scsi/scsi_debug.c |
1825 |
+@@ -2300,11 +2300,11 @@ static int resp_mode_select(struct scsi_cmnd *scp, |
1826 |
+ __func__, param_len, res); |
1827 |
+ md_len = mselect6 ? (arr[0] + 1) : (get_unaligned_be16(arr + 0) + 2); |
1828 |
+ bd_len = mselect6 ? arr[3] : get_unaligned_be16(arr + 6); |
1829 |
+- if (md_len > 2) { |
1830 |
++ off = bd_len + (mselect6 ? 4 : 8); |
1831 |
++ if (md_len > 2 || off >= res) { |
1832 |
+ mk_sense_invalid_fld(scp, SDEB_IN_DATA, 0, -1); |
1833 |
+ return check_condition_result; |
1834 |
+ } |
1835 |
+- off = bd_len + (mselect6 ? 4 : 8); |
1836 |
+ mpage = arr[off] & 0x3f; |
1837 |
+ ps = !!(arr[off] & 0x80); |
1838 |
+ if (ps) { |
1839 |
+diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c |
1840 |
+index 51625703399e4..52130ec8c9049 100644 |
1841 |
+--- a/drivers/soc/tegra/fuse/fuse-tegra.c |
1842 |
++++ b/drivers/soc/tegra/fuse/fuse-tegra.c |
1843 |
+@@ -182,7 +182,7 @@ static struct platform_driver tegra_fuse_driver = { |
1844 |
+ }; |
1845 |
+ builtin_platform_driver(tegra_fuse_driver); |
1846 |
+ |
1847 |
+-bool __init tegra_fuse_read_spare(unsigned int spare) |
1848 |
++u32 __init tegra_fuse_read_spare(unsigned int spare) |
1849 |
+ { |
1850 |
+ unsigned int offset = fuse->soc->info->spare + spare * 4; |
1851 |
+ |
1852 |
+diff --git a/drivers/soc/tegra/fuse/fuse.h b/drivers/soc/tegra/fuse/fuse.h |
1853 |
+index f355b9d549151..bf489d50e6687 100644 |
1854 |
+--- a/drivers/soc/tegra/fuse/fuse.h |
1855 |
++++ b/drivers/soc/tegra/fuse/fuse.h |
1856 |
+@@ -62,7 +62,7 @@ struct tegra_fuse { |
1857 |
+ void tegra_init_revision(void); |
1858 |
+ void tegra_init_apbmisc(void); |
1859 |
+ |
1860 |
+-bool __init tegra_fuse_read_spare(unsigned int spare); |
1861 |
++u32 __init tegra_fuse_read_spare(unsigned int spare); |
1862 |
+ u32 __init tegra_fuse_read_early(unsigned int offset); |
1863 |
+ |
1864 |
+ #ifdef CONFIG_ARCH_TEGRA_2x_SOC |
1865 |
+diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c |
1866 |
+index 7874aaf30ef48..080adf7bcae43 100644 |
1867 |
+--- a/drivers/tty/hvc/hvc_xen.c |
1868 |
++++ b/drivers/tty/hvc/hvc_xen.c |
1869 |
+@@ -37,6 +37,8 @@ struct xencons_info { |
1870 |
+ struct xenbus_device *xbdev; |
1871 |
+ struct xencons_interface *intf; |
1872 |
+ unsigned int evtchn; |
1873 |
++ XENCONS_RING_IDX out_cons; |
1874 |
++ unsigned int out_cons_same; |
1875 |
+ struct hvc_struct *hvc; |
1876 |
+ int irq; |
1877 |
+ int vtermno; |
1878 |
+@@ -138,6 +140,8 @@ static int domU_read_console(uint32_t vtermno, char *buf, int len) |
1879 |
+ XENCONS_RING_IDX cons, prod; |
1880 |
+ int recv = 0; |
1881 |
+ struct xencons_info *xencons = vtermno_to_xencons(vtermno); |
1882 |
++ unsigned int eoiflag = 0; |
1883 |
++ |
1884 |
+ if (xencons == NULL) |
1885 |
+ return -EINVAL; |
1886 |
+ intf = xencons->intf; |
1887 |
+@@ -157,7 +161,27 @@ static int domU_read_console(uint32_t vtermno, char *buf, int len) |
1888 |
+ mb(); /* read ring before consuming */ |
1889 |
+ intf->in_cons = cons; |
1890 |
+ |
1891 |
+- notify_daemon(xencons); |
1892 |
++ /* |
1893 |
++ * When to mark interrupt having been spurious: |
1894 |
++ * - there was no new data to be read, and |
1895 |
++ * - the backend did not consume some output bytes, and |
1896 |
++ * - the previous round with no read data didn't see consumed bytes |
1897 |
++ * (we might have a race with an interrupt being in flight while |
1898 |
++ * updating xencons->out_cons, so account for that by allowing one |
1899 |
++ * round without any visible reason) |
1900 |
++ */ |
1901 |
++ if (intf->out_cons != xencons->out_cons) { |
1902 |
++ xencons->out_cons = intf->out_cons; |
1903 |
++ xencons->out_cons_same = 0; |
1904 |
++ } |
1905 |
++ if (recv) { |
1906 |
++ notify_daemon(xencons); |
1907 |
++ } else if (xencons->out_cons_same++ > 1) { |
1908 |
++ eoiflag = XEN_EOI_FLAG_SPURIOUS; |
1909 |
++ } |
1910 |
++ |
1911 |
++ xen_irq_lateeoi(xencons->irq, eoiflag); |
1912 |
++ |
1913 |
+ return recv; |
1914 |
+ } |
1915 |
+ |
1916 |
+@@ -386,7 +410,7 @@ static int xencons_connect_backend(struct xenbus_device *dev, |
1917 |
+ if (ret) |
1918 |
+ return ret; |
1919 |
+ info->evtchn = evtchn; |
1920 |
+- irq = bind_evtchn_to_irq(evtchn); |
1921 |
++ irq = bind_interdomain_evtchn_to_irq_lateeoi(dev->otherend_id, evtchn); |
1922 |
+ if (irq < 0) |
1923 |
+ return irq; |
1924 |
+ info->irq = irq; |
1925 |
+@@ -550,7 +574,7 @@ static int __init xen_hvc_init(void) |
1926 |
+ return r; |
1927 |
+ |
1928 |
+ info = vtermno_to_xencons(HVC_COOKIE); |
1929 |
+- info->irq = bind_evtchn_to_irq(info->evtchn); |
1930 |
++ info->irq = bind_evtchn_to_irq_lateeoi(info->evtchn); |
1931 |
+ } |
1932 |
+ if (info->irq < 0) |
1933 |
+ info->irq = 0; /* NO_IRQ */ |
1934 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
1935 |
+index e170c5b4d6f0c..a118c44c70e1e 100644 |
1936 |
+--- a/drivers/usb/core/quirks.c |
1937 |
++++ b/drivers/usb/core/quirks.c |
1938 |
+@@ -435,6 +435,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
1939 |
+ { USB_DEVICE(0x1532, 0x0116), .driver_info = |
1940 |
+ USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, |
1941 |
+ |
1942 |
++ /* Lenovo USB-C to Ethernet Adapter RTL8153-04 */ |
1943 |
++ { USB_DEVICE(0x17ef, 0x720c), .driver_info = USB_QUIRK_NO_LPM }, |
1944 |
++ |
1945 |
+ /* Lenovo Powered USB-C Travel Hub (4X90S92381, RTL8153 GigE) */ |
1946 |
+ { USB_DEVICE(0x17ef, 0x721e), .driver_info = USB_QUIRK_NO_LPM }, |
1947 |
+ |
1948 |
+diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c |
1949 |
+index 99550c9eb33ed..748f8fede5c23 100644 |
1950 |
+--- a/drivers/usb/gadget/composite.c |
1951 |
++++ b/drivers/usb/gadget/composite.c |
1952 |
+@@ -1635,14 +1635,14 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) |
1953 |
+ u8 endp; |
1954 |
+ |
1955 |
+ if (w_length > USB_COMP_EP0_BUFSIZ) { |
1956 |
+- if (ctrl->bRequestType == USB_DIR_OUT) { |
1957 |
+- goto done; |
1958 |
+- } else { |
1959 |
++ if (ctrl->bRequestType & USB_DIR_IN) { |
1960 |
+ /* Cast away the const, we are going to overwrite on purpose. */ |
1961 |
+ __le16 *temp = (__le16 *)&ctrl->wLength; |
1962 |
+ |
1963 |
+ *temp = cpu_to_le16(USB_COMP_EP0_BUFSIZ); |
1964 |
+ w_length = USB_COMP_EP0_BUFSIZ; |
1965 |
++ } else { |
1966 |
++ goto done; |
1967 |
+ } |
1968 |
+ } |
1969 |
+ |
1970 |
+diff --git a/drivers/usb/gadget/legacy/dbgp.c b/drivers/usb/gadget/legacy/dbgp.c |
1971 |
+index 355bc7dab9d5f..6bcbad3825802 100644 |
1972 |
+--- a/drivers/usb/gadget/legacy/dbgp.c |
1973 |
++++ b/drivers/usb/gadget/legacy/dbgp.c |
1974 |
+@@ -346,14 +346,14 @@ static int dbgp_setup(struct usb_gadget *gadget, |
1975 |
+ u16 len = 0; |
1976 |
+ |
1977 |
+ if (length > DBGP_REQ_LEN) { |
1978 |
+- if (ctrl->bRequestType == USB_DIR_OUT) { |
1979 |
+- return err; |
1980 |
+- } else { |
1981 |
++ if (ctrl->bRequestType & USB_DIR_IN) { |
1982 |
+ /* Cast away the const, we are going to overwrite on purpose. */ |
1983 |
+ __le16 *temp = (__le16 *)&ctrl->wLength; |
1984 |
+ |
1985 |
+ *temp = cpu_to_le16(DBGP_REQ_LEN); |
1986 |
+ length = DBGP_REQ_LEN; |
1987 |
++ } else { |
1988 |
++ return err; |
1989 |
+ } |
1990 |
+ } |
1991 |
+ |
1992 |
+diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c |
1993 |
+index 848562222015d..a456267b6b784 100644 |
1994 |
+--- a/drivers/usb/gadget/legacy/inode.c |
1995 |
++++ b/drivers/usb/gadget/legacy/inode.c |
1996 |
+@@ -1335,14 +1335,14 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) |
1997 |
+ u16 w_length = le16_to_cpu(ctrl->wLength); |
1998 |
+ |
1999 |
+ if (w_length > RBUF_SIZE) { |
2000 |
+- if (ctrl->bRequestType == USB_DIR_OUT) { |
2001 |
+- return value; |
2002 |
+- } else { |
2003 |
++ if (ctrl->bRequestType & USB_DIR_IN) { |
2004 |
+ /* Cast away the const, we are going to overwrite on purpose. */ |
2005 |
+ __le16 *temp = (__le16 *)&ctrl->wLength; |
2006 |
+ |
2007 |
+ *temp = cpu_to_le16(RBUF_SIZE); |
2008 |
+ w_length = RBUF_SIZE; |
2009 |
++ } else { |
2010 |
++ return value; |
2011 |
+ } |
2012 |
+ } |
2013 |
+ |
2014 |
+diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c |
2015 |
+index 894572a5e5c5c..cf1083639103b 100644 |
2016 |
+--- a/drivers/usb/serial/cp210x.c |
2017 |
++++ b/drivers/usb/serial/cp210x.c |
2018 |
+@@ -1535,6 +1535,8 @@ static int cp2105_gpioconf_init(struct usb_serial *serial) |
2019 |
+ |
2020 |
+ /* 2 banks of GPIO - One for the pins taken from each serial port */ |
2021 |
+ if (intf_num == 0) { |
2022 |
++ priv->gc.ngpio = 2; |
2023 |
++ |
2024 |
+ if (mode.eci == CP210X_PIN_MODE_MODEM) { |
2025 |
+ /* mark all GPIOs of this interface as reserved */ |
2026 |
+ priv->gpio_altfunc = 0xff; |
2027 |
+@@ -1545,8 +1547,9 @@ static int cp2105_gpioconf_init(struct usb_serial *serial) |
2028 |
+ priv->gpio_pushpull = (u8)((le16_to_cpu(config.gpio_mode) & |
2029 |
+ CP210X_ECI_GPIO_MODE_MASK) >> |
2030 |
+ CP210X_ECI_GPIO_MODE_OFFSET); |
2031 |
+- priv->gc.ngpio = 2; |
2032 |
+ } else if (intf_num == 1) { |
2033 |
++ priv->gc.ngpio = 3; |
2034 |
++ |
2035 |
+ if (mode.sci == CP210X_PIN_MODE_MODEM) { |
2036 |
+ /* mark all GPIOs of this interface as reserved */ |
2037 |
+ priv->gpio_altfunc = 0xff; |
2038 |
+@@ -1557,7 +1560,6 @@ static int cp2105_gpioconf_init(struct usb_serial *serial) |
2039 |
+ priv->gpio_pushpull = (u8)((le16_to_cpu(config.gpio_mode) & |
2040 |
+ CP210X_SCI_GPIO_MODE_MASK) >> |
2041 |
+ CP210X_SCI_GPIO_MODE_OFFSET); |
2042 |
+- priv->gc.ngpio = 3; |
2043 |
+ } else { |
2044 |
+ return -ENODEV; |
2045 |
+ } |
2046 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
2047 |
+index 818097e86cb58..6166ef71c1842 100644 |
2048 |
+--- a/drivers/usb/serial/option.c |
2049 |
++++ b/drivers/usb/serial/option.c |
2050 |
+@@ -1219,6 +1219,14 @@ static const struct usb_device_id option_ids[] = { |
2051 |
+ .driver_info = NCTRL(2) | RSVD(3) }, |
2052 |
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1063, 0xff), /* Telit LN920 (ECM) */ |
2053 |
+ .driver_info = NCTRL(0) | RSVD(1) }, |
2054 |
++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1070, 0xff), /* Telit FN990 (rmnet) */ |
2055 |
++ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, |
2056 |
++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1071, 0xff), /* Telit FN990 (MBIM) */ |
2057 |
++ .driver_info = NCTRL(0) | RSVD(1) }, |
2058 |
++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1072, 0xff), /* Telit FN990 (RNDIS) */ |
2059 |
++ .driver_info = NCTRL(2) | RSVD(3) }, |
2060 |
++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1073, 0xff), /* Telit FN990 (ECM) */ |
2061 |
++ .driver_info = NCTRL(0) | RSVD(1) }, |
2062 |
+ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), |
2063 |
+ .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) }, |
2064 |
+ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM), |
2065 |
+diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c |
2066 |
+index 6244345a5745b..f01ecc197a45b 100644 |
2067 |
+--- a/fs/fuse/dir.c |
2068 |
++++ b/fs/fuse/dir.c |
2069 |
+@@ -984,7 +984,7 @@ int fuse_reverse_inval_entry(struct super_block *sb, u64 parent_nodeid, |
2070 |
+ if (!parent) |
2071 |
+ return -ENOENT; |
2072 |
+ |
2073 |
+- inode_lock(parent); |
2074 |
++ inode_lock_nested(parent, I_MUTEX_PARENT); |
2075 |
+ if (!S_ISDIR(parent->i_mode)) |
2076 |
+ goto unlock; |
2077 |
+ |
2078 |
+diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c |
2079 |
+index 655079ae1dd1f..dfb2a790efc13 100644 |
2080 |
+--- a/fs/nfsd/nfs4state.c |
2081 |
++++ b/fs/nfsd/nfs4state.c |
2082 |
+@@ -975,6 +975,11 @@ hash_delegation_locked(struct nfs4_delegation *dp, struct nfs4_file *fp) |
2083 |
+ return 0; |
2084 |
+ } |
2085 |
+ |
2086 |
++static bool delegation_hashed(struct nfs4_delegation *dp) |
2087 |
++{ |
2088 |
++ return !(list_empty(&dp->dl_perfile)); |
2089 |
++} |
2090 |
++ |
2091 |
+ static bool |
2092 |
+ unhash_delegation_locked(struct nfs4_delegation *dp) |
2093 |
+ { |
2094 |
+@@ -982,7 +987,7 @@ unhash_delegation_locked(struct nfs4_delegation *dp) |
2095 |
+ |
2096 |
+ lockdep_assert_held(&state_lock); |
2097 |
+ |
2098 |
+- if (list_empty(&dp->dl_perfile)) |
2099 |
++ if (!delegation_hashed(dp)) |
2100 |
+ return false; |
2101 |
+ |
2102 |
+ dp->dl_stid.sc_type = NFS4_CLOSED_DELEG_STID; |
2103 |
+@@ -3912,7 +3917,7 @@ static void nfsd4_cb_recall_prepare(struct nfsd4_callback *cb) |
2104 |
+ * queued for a lease break. Don't queue it again. |
2105 |
+ */ |
2106 |
+ spin_lock(&state_lock); |
2107 |
+- if (dp->dl_time == 0) { |
2108 |
++ if (delegation_hashed(dp) && dp->dl_time == 0) { |
2109 |
+ dp->dl_time = get_seconds(); |
2110 |
+ list_add_tail(&dp->dl_recall_lru, &nn->del_recall_lru); |
2111 |
+ } |
2112 |
+diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c |
2113 |
+index 0578c15e1a676..06dc649629c74 100644 |
2114 |
+--- a/fs/overlayfs/dir.c |
2115 |
++++ b/fs/overlayfs/dir.c |
2116 |
+@@ -116,8 +116,7 @@ kill_whiteout: |
2117 |
+ goto out; |
2118 |
+ } |
2119 |
+ |
2120 |
+-static int ovl_mkdir_real(struct inode *dir, struct dentry **newdentry, |
2121 |
+- umode_t mode) |
2122 |
++int ovl_mkdir_real(struct inode *dir, struct dentry **newdentry, umode_t mode) |
2123 |
+ { |
2124 |
+ int err; |
2125 |
+ struct dentry *d, *dentry = *newdentry; |
2126 |
+diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h |
2127 |
+index 265bf9cfde089..8dcede7df2ca0 100644 |
2128 |
+--- a/fs/overlayfs/overlayfs.h |
2129 |
++++ b/fs/overlayfs/overlayfs.h |
2130 |
+@@ -402,6 +402,7 @@ struct ovl_cattr { |
2131 |
+ |
2132 |
+ #define OVL_CATTR(m) (&(struct ovl_cattr) { .mode = (m) }) |
2133 |
+ |
2134 |
++int ovl_mkdir_real(struct inode *dir, struct dentry **newdentry, umode_t mode); |
2135 |
+ struct dentry *ovl_create_real(struct inode *dir, struct dentry *newdentry, |
2136 |
+ struct ovl_cattr *attr); |
2137 |
+ int ovl_cleanup(struct inode *dir, struct dentry *dentry); |
2138 |
+diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c |
2139 |
+index c97d8d251eb95..1a7a1e2988855 100644 |
2140 |
+--- a/fs/overlayfs/super.c |
2141 |
++++ b/fs/overlayfs/super.c |
2142 |
+@@ -654,10 +654,14 @@ retry: |
2143 |
+ goto retry; |
2144 |
+ } |
2145 |
+ |
2146 |
+- work = ovl_create_real(dir, work, OVL_CATTR(attr.ia_mode)); |
2147 |
+- err = PTR_ERR(work); |
2148 |
+- if (IS_ERR(work)) |
2149 |
+- goto out_err; |
2150 |
++ err = ovl_mkdir_real(dir, &work, attr.ia_mode); |
2151 |
++ if (err) |
2152 |
++ goto out_dput; |
2153 |
++ |
2154 |
++ /* Weird filesystem returning with hashed negative (kernfs)? */ |
2155 |
++ err = -EINVAL; |
2156 |
++ if (d_really_is_negative(work)) |
2157 |
++ goto out_dput; |
2158 |
+ |
2159 |
+ /* |
2160 |
+ * Try to remove POSIX ACL xattrs from workdir. We are good if: |
2161 |
+diff --git a/kernel/audit.c b/kernel/audit.c |
2162 |
+index 45741c3c48a47..968921d376b98 100644 |
2163 |
+--- a/kernel/audit.c |
2164 |
++++ b/kernel/audit.c |
2165 |
+@@ -726,7 +726,7 @@ static int kauditd_send_queue(struct sock *sk, u32 portid, |
2166 |
+ { |
2167 |
+ int rc = 0; |
2168 |
+ struct sk_buff *skb; |
2169 |
+- static unsigned int failed = 0; |
2170 |
++ unsigned int failed = 0; |
2171 |
+ |
2172 |
+ /* NOTE: kauditd_thread takes care of all our locking, we just use |
2173 |
+ * the netlink info passed to us (e.g. sk and portid) */ |
2174 |
+@@ -743,32 +743,30 @@ static int kauditd_send_queue(struct sock *sk, u32 portid, |
2175 |
+ continue; |
2176 |
+ } |
2177 |
+ |
2178 |
++retry: |
2179 |
+ /* grab an extra skb reference in case of error */ |
2180 |
+ skb_get(skb); |
2181 |
+ rc = netlink_unicast(sk, skb, portid, 0); |
2182 |
+ if (rc < 0) { |
2183 |
+- /* fatal failure for our queue flush attempt? */ |
2184 |
++ /* send failed - try a few times unless fatal error */ |
2185 |
+ if (++failed >= retry_limit || |
2186 |
+ rc == -ECONNREFUSED || rc == -EPERM) { |
2187 |
+- /* yes - error processing for the queue */ |
2188 |
+ sk = NULL; |
2189 |
+ if (err_hook) |
2190 |
+ (*err_hook)(skb); |
2191 |
+- if (!skb_hook) |
2192 |
+- goto out; |
2193 |
+- /* keep processing with the skb_hook */ |
2194 |
++ if (rc == -EAGAIN) |
2195 |
++ rc = 0; |
2196 |
++ /* continue to drain the queue */ |
2197 |
+ continue; |
2198 |
+ } else |
2199 |
+- /* no - requeue to preserve ordering */ |
2200 |
+- skb_queue_head(queue, skb); |
2201 |
++ goto retry; |
2202 |
+ } else { |
2203 |
+- /* it worked - drop the extra reference and continue */ |
2204 |
++ /* skb sent - drop the extra reference and continue */ |
2205 |
+ consume_skb(skb); |
2206 |
+ failed = 0; |
2207 |
+ } |
2208 |
+ } |
2209 |
+ |
2210 |
+-out: |
2211 |
+ return (rc >= 0 ? 0 : rc); |
2212 |
+ } |
2213 |
+ |
2214 |
+@@ -1557,7 +1555,8 @@ static int __net_init audit_net_init(struct net *net) |
2215 |
+ audit_panic("cannot initialize netlink socket in namespace"); |
2216 |
+ return -ENOMEM; |
2217 |
+ } |
2218 |
+- aunet->sk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT; |
2219 |
++ /* limit the timeout in case auditd is blocked/stopped */ |
2220 |
++ aunet->sk->sk_sndtimeo = HZ / 10; |
2221 |
+ |
2222 |
+ return 0; |
2223 |
+ } |
2224 |
+diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c |
2225 |
+index c66fd11d94bc4..f246818e35dbc 100644 |
2226 |
+--- a/kernel/time/timekeeping.c |
2227 |
++++ b/kernel/time/timekeeping.c |
2228 |
+@@ -1235,8 +1235,7 @@ int do_settimeofday64(const struct timespec64 *ts) |
2229 |
+ timekeeping_forward_now(tk); |
2230 |
+ |
2231 |
+ xt = tk_xtime(tk); |
2232 |
+- ts_delta.tv_sec = ts->tv_sec - xt.tv_sec; |
2233 |
+- ts_delta.tv_nsec = ts->tv_nsec - xt.tv_nsec; |
2234 |
++ ts_delta = timespec64_sub(*ts, xt); |
2235 |
+ |
2236 |
+ if (timespec64_compare(&tk->wall_to_monotonic, &ts_delta) > 0) { |
2237 |
+ ret = -EINVAL; |
2238 |
+diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c |
2239 |
+index 10657b8dc2c2d..83c2a0598c648 100644 |
2240 |
+--- a/kernel/trace/tracing_map.c |
2241 |
++++ b/kernel/trace/tracing_map.c |
2242 |
+@@ -15,6 +15,7 @@ |
2243 |
+ #include <linux/jhash.h> |
2244 |
+ #include <linux/slab.h> |
2245 |
+ #include <linux/sort.h> |
2246 |
++#include <linux/kmemleak.h> |
2247 |
+ |
2248 |
+ #include "tracing_map.h" |
2249 |
+ #include "trace.h" |
2250 |
+@@ -307,6 +308,7 @@ void tracing_map_array_free(struct tracing_map_array *a) |
2251 |
+ for (i = 0; i < a->n_pages; i++) { |
2252 |
+ if (!a->pages[i]) |
2253 |
+ break; |
2254 |
++ kmemleak_free(a->pages[i]); |
2255 |
+ free_page((unsigned long)a->pages[i]); |
2256 |
+ } |
2257 |
+ |
2258 |
+@@ -342,6 +344,7 @@ struct tracing_map_array *tracing_map_array_alloc(unsigned int n_elts, |
2259 |
+ a->pages[i] = (void *)get_zeroed_page(GFP_KERNEL); |
2260 |
+ if (!a->pages[i]) |
2261 |
+ goto free; |
2262 |
++ kmemleak_alloc(a->pages[i], PAGE_SIZE, 1, GFP_KERNEL); |
2263 |
+ } |
2264 |
+ out: |
2265 |
+ return a; |
2266 |
+diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug |
2267 |
+index 6970759f296c5..621859a453f82 100644 |
2268 |
+--- a/lib/Kconfig.debug |
2269 |
++++ b/lib/Kconfig.debug |
2270 |
+@@ -1178,7 +1178,7 @@ config LOCKDEP |
2271 |
+ bool |
2272 |
+ depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT |
2273 |
+ select STACKTRACE |
2274 |
+- select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC && !X86 |
2275 |
++ select FRAME_POINTER if !MIPS && !PPC && !ARM && !S390 && !MICROBLAZE && !ARC && !X86 |
2276 |
+ select KALLSYMS |
2277 |
+ select KALLSYMS_ALL |
2278 |
+ |
2279 |
+@@ -1589,7 +1589,7 @@ config FAULT_INJECTION_STACKTRACE_FILTER |
2280 |
+ depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT |
2281 |
+ depends on !X86_64 |
2282 |
+ select STACKTRACE |
2283 |
+- select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !X86 |
2284 |
++ select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86 |
2285 |
+ help |
2286 |
+ Provide stacktrace filter for fault-injection capabilities |
2287 |
+ |
2288 |
+@@ -1598,7 +1598,7 @@ config LATENCYTOP |
2289 |
+ depends on DEBUG_KERNEL |
2290 |
+ depends on STACKTRACE_SUPPORT |
2291 |
+ depends on PROC_FS |
2292 |
+- select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !X86 |
2293 |
++ select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86 |
2294 |
+ select KALLSYMS |
2295 |
+ select KALLSYMS_ALL |
2296 |
+ select STACKTRACE |
2297 |
+diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c |
2298 |
+index 4a49200d0d11c..55c999cbe6e96 100644 |
2299 |
+--- a/net/ipv6/sit.c |
2300 |
++++ b/net/ipv6/sit.c |
2301 |
+@@ -1875,7 +1875,6 @@ static int __net_init sit_init_net(struct net *net) |
2302 |
+ return 0; |
2303 |
+ |
2304 |
+ err_reg_dev: |
2305 |
+- ipip6_dev_free(sitn->fb_tunnel_dev); |
2306 |
+ free_netdev(sitn->fb_tunnel_dev); |
2307 |
+ err_alloc_dev: |
2308 |
+ return err; |
2309 |
+diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c |
2310 |
+index 54821fb1a960d..79138225e8808 100644 |
2311 |
+--- a/net/mac80211/agg-tx.c |
2312 |
++++ b/net/mac80211/agg-tx.c |
2313 |
+@@ -109,7 +109,7 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata, |
2314 |
+ mgmt->u.action.u.addba_req.start_seq_num = |
2315 |
+ cpu_to_le16(start_seq_num << 4); |
2316 |
+ |
2317 |
+- ieee80211_tx_skb(sdata, skb); |
2318 |
++ ieee80211_tx_skb_tid(sdata, skb, tid); |
2319 |
+ } |
2320 |
+ |
2321 |
+ void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn) |
2322 |
+diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c |
2323 |
+index cbcb60face2c5..e5c4a72f8e571 100644 |
2324 |
+--- a/net/mac80211/mlme.c |
2325 |
++++ b/net/mac80211/mlme.c |
2326 |
+@@ -2351,11 +2351,18 @@ static void ieee80211_sta_tx_wmm_ac_notify(struct ieee80211_sub_if_data *sdata, |
2327 |
+ u16 tx_time) |
2328 |
+ { |
2329 |
+ struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
2330 |
+- u16 tid = ieee80211_get_tid(hdr); |
2331 |
+- int ac = ieee80211_ac_from_tid(tid); |
2332 |
+- struct ieee80211_sta_tx_tspec *tx_tspec = &ifmgd->tx_tspec[ac]; |
2333 |
++ u16 tid; |
2334 |
++ int ac; |
2335 |
++ struct ieee80211_sta_tx_tspec *tx_tspec; |
2336 |
+ unsigned long now = jiffies; |
2337 |
+ |
2338 |
++ if (!ieee80211_is_data_qos(hdr->frame_control)) |
2339 |
++ return; |
2340 |
++ |
2341 |
++ tid = ieee80211_get_tid(hdr); |
2342 |
++ ac = ieee80211_ac_from_tid(tid); |
2343 |
++ tx_tspec = &ifmgd->tx_tspec[ac]; |
2344 |
++ |
2345 |
+ if (likely(!tx_tspec->admitted_time)) |
2346 |
+ return; |
2347 |
+ |
2348 |
+diff --git a/net/mac80211/util.c b/net/mac80211/util.c |
2349 |
+index 7fa9871b1db9f..9c1a20ca63445 100644 |
2350 |
+--- a/net/mac80211/util.c |
2351 |
++++ b/net/mac80211/util.c |
2352 |
+@@ -1102,6 +1102,8 @@ u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action, |
2353 |
+ elems->max_idle_period_ie = (void *)pos; |
2354 |
+ break; |
2355 |
+ case WLAN_EID_EXTENSION: |
2356 |
++ if (!elen) |
2357 |
++ break; |
2358 |
+ if (pos[0] == WLAN_EID_EXT_HE_MU_EDCA && |
2359 |
+ elen >= (sizeof(*elems->mu_edca_param_set) + 1)) { |
2360 |
+ elems->mu_edca_param_set = (void *)&pos[1]; |
2361 |
+diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c |
2362 |
+index dd4e4289d0d2a..a7497361e4d78 100644 |
2363 |
+--- a/net/netlink/af_netlink.c |
2364 |
++++ b/net/netlink/af_netlink.c |
2365 |
+@@ -1853,6 +1853,11 @@ static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) |
2366 |
+ if (msg->msg_flags&MSG_OOB) |
2367 |
+ return -EOPNOTSUPP; |
2368 |
+ |
2369 |
++ if (len == 0) { |
2370 |
++ pr_warn_once("Zero length message leads to an empty skb\n"); |
2371 |
++ return -ENODATA; |
2372 |
++ } |
2373 |
++ |
2374 |
+ err = scm_send(sock, msg, &scm, true); |
2375 |
+ if (err < 0) |
2376 |
+ return err; |
2377 |
+diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c |
2378 |
+index b6313504faed1..0a3120117c13d 100644 |
2379 |
+--- a/net/nfc/netlink.c |
2380 |
++++ b/net/nfc/netlink.c |
2381 |
+@@ -655,8 +655,10 @@ static int nfc_genl_dump_devices_done(struct netlink_callback *cb) |
2382 |
+ { |
2383 |
+ struct class_dev_iter *iter = (struct class_dev_iter *) cb->args[0]; |
2384 |
+ |
2385 |
+- nfc_device_iter_exit(iter); |
2386 |
+- kfree(iter); |
2387 |
++ if (iter) { |
2388 |
++ nfc_device_iter_exit(iter); |
2389 |
++ kfree(iter); |
2390 |
++ } |
2391 |
+ |
2392 |
+ return 0; |
2393 |
+ } |
2394 |
+diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c |
2395 |
+index 8d9005019ef78..1309161032d50 100644 |
2396 |
+--- a/net/packet/af_packet.c |
2397 |
++++ b/net/packet/af_packet.c |
2398 |
+@@ -4439,9 +4439,10 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, |
2399 |
+ } |
2400 |
+ |
2401 |
+ out_free_pg_vec: |
2402 |
+- bitmap_free(rx_owner_map); |
2403 |
+- if (pg_vec) |
2404 |
++ if (pg_vec) { |
2405 |
++ bitmap_free(rx_owner_map); |
2406 |
+ free_pg_vec(pg_vec, order, req->tp_block_nr); |
2407 |
++ } |
2408 |
+ out: |
2409 |
+ return err; |
2410 |
+ } |
2411 |
+diff --git a/net/rds/connection.c b/net/rds/connection.c |
2412 |
+index ac3300b204a6f..af9f7d1840037 100644 |
2413 |
+--- a/net/rds/connection.c |
2414 |
++++ b/net/rds/connection.c |
2415 |
+@@ -250,6 +250,7 @@ static struct rds_connection *__rds_conn_create(struct net *net, |
2416 |
+ * should end up here, but if it |
2417 |
+ * does, reset/destroy the connection. |
2418 |
+ */ |
2419 |
++ kfree(conn->c_path); |
2420 |
+ kmem_cache_free(rds_conn_slab, conn); |
2421 |
+ conn = ERR_PTR(-EOPNOTSUPP); |
2422 |
+ goto out; |
2423 |
+diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c |
2424 |
+index 2025f0f559deb..18c207b85d513 100644 |
2425 |
+--- a/net/sched/sch_cake.c |
2426 |
++++ b/net/sched/sch_cake.c |
2427 |
+@@ -2675,7 +2675,7 @@ static int cake_init(struct Qdisc *sch, struct nlattr *opt, |
2428 |
+ q->tins = kvcalloc(CAKE_MAX_TINS, sizeof(struct cake_tin_data), |
2429 |
+ GFP_KERNEL); |
2430 |
+ if (!q->tins) |
2431 |
+- goto nomem; |
2432 |
++ return -ENOMEM; |
2433 |
+ |
2434 |
+ for (i = 0; i < CAKE_MAX_TINS; i++) { |
2435 |
+ struct cake_tin_data *b = q->tins + i; |
2436 |
+@@ -2705,10 +2705,6 @@ static int cake_init(struct Qdisc *sch, struct nlattr *opt, |
2437 |
+ q->min_netlen = ~0; |
2438 |
+ q->min_adjlen = ~0; |
2439 |
+ return 0; |
2440 |
+- |
2441 |
+-nomem: |
2442 |
+- cake_destroy(sch); |
2443 |
+- return -ENOMEM; |
2444 |
+ } |
2445 |
+ |
2446 |
+ static int cake_dump(struct Qdisc *sch, struct sk_buff *skb) |
2447 |
+diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl |
2448 |
+index 321c41562b972..d8cbbedef3161 100755 |
2449 |
+--- a/scripts/recordmcount.pl |
2450 |
++++ b/scripts/recordmcount.pl |
2451 |
+@@ -252,7 +252,7 @@ if ($arch eq "x86_64") { |
2452 |
+ |
2453 |
+ } elsif ($arch eq "s390" && $bits == 64) { |
2454 |
+ if ($cc =~ /-DCC_USING_HOTPATCH/) { |
2455 |
+- $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*brcl\\s*0,[0-9a-f]+ <([^\+]*)>\$"; |
2456 |
++ $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(bcrl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$"; |
2457 |
+ $mcount_adjust = 0; |
2458 |
+ } else { |
2459 |
+ $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$"; |