1 |
commit: 669b6ce0423f386158d729e907a47a74fbd2c10f |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Apr 21 11:42:37 2021 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Apr 21 11:42:37 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=669b6ce0 |
7 |
|
8 |
Linux patch 5.10.32 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1031_linux-5.10.32.patch | 3223 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 3227 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 69e2945..68ff733 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -167,6 +167,10 @@ Patch: 1030_linux-5.10.31.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.10.31 |
23 |
|
24 |
+Patch: 1031_linux-5.10.32.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.10.32 |
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/1031_linux-5.10.32.patch b/1031_linux-5.10.32.patch |
33 |
new file mode 100644 |
34 |
index 0000000..354de13 |
35 |
--- /dev/null |
36 |
+++ b/1031_linux-5.10.32.patch |
37 |
@@ -0,0 +1,3223 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index c4c0b47e6edea..cad90171b4b9b 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 5 |
45 |
+ PATCHLEVEL = 10 |
46 |
+-SUBLEVEL = 31 |
47 |
++SUBLEVEL = 32 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Dare mighty things |
50 |
+ |
51 |
+diff --git a/arch/arc/kernel/signal.c b/arch/arc/kernel/signal.c |
52 |
+index 2be55fb96d870..98e575dbcce51 100644 |
53 |
+--- a/arch/arc/kernel/signal.c |
54 |
++++ b/arch/arc/kernel/signal.c |
55 |
+@@ -96,7 +96,7 @@ stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs, |
56 |
+ sizeof(sf->uc.uc_mcontext.regs.scratch)); |
57 |
+ err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t)); |
58 |
+ |
59 |
+- return err; |
60 |
++ return err ? -EFAULT : 0; |
61 |
+ } |
62 |
+ |
63 |
+ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf) |
64 |
+@@ -110,7 +110,7 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf) |
65 |
+ &(sf->uc.uc_mcontext.regs.scratch), |
66 |
+ sizeof(sf->uc.uc_mcontext.regs.scratch)); |
67 |
+ if (err) |
68 |
+- return err; |
69 |
++ return -EFAULT; |
70 |
+ |
71 |
+ set_current_blocked(&set); |
72 |
+ regs->bta = uregs.scratch.bta; |
73 |
+diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi |
74 |
+index d6475cc6a91a7..049174086756d 100644 |
75 |
+--- a/arch/arm/boot/dts/omap4.dtsi |
76 |
++++ b/arch/arm/boot/dts/omap4.dtsi |
77 |
+@@ -22,6 +22,11 @@ |
78 |
+ i2c1 = &i2c2; |
79 |
+ i2c2 = &i2c3; |
80 |
+ i2c3 = &i2c4; |
81 |
++ mmc0 = &mmc1; |
82 |
++ mmc1 = &mmc2; |
83 |
++ mmc2 = &mmc3; |
84 |
++ mmc3 = &mmc4; |
85 |
++ mmc4 = &mmc5; |
86 |
+ serial0 = &uart1; |
87 |
+ serial1 = &uart2; |
88 |
+ serial2 = &uart3; |
89 |
+diff --git a/arch/arm/boot/dts/omap44xx-clocks.dtsi b/arch/arm/boot/dts/omap44xx-clocks.dtsi |
90 |
+index 532868591107b..1f1c04d8f4721 100644 |
91 |
+--- a/arch/arm/boot/dts/omap44xx-clocks.dtsi |
92 |
++++ b/arch/arm/boot/dts/omap44xx-clocks.dtsi |
93 |
+@@ -770,14 +770,6 @@ |
94 |
+ ti,max-div = <2>; |
95 |
+ }; |
96 |
+ |
97 |
+- sha2md5_fck: sha2md5_fck@15c8 { |
98 |
+- #clock-cells = <0>; |
99 |
+- compatible = "ti,gate-clock"; |
100 |
+- clocks = <&l3_div_ck>; |
101 |
+- ti,bit-shift = <1>; |
102 |
+- reg = <0x15c8>; |
103 |
+- }; |
104 |
+- |
105 |
+ usb_phy_cm_clk32k: usb_phy_cm_clk32k@640 { |
106 |
+ #clock-cells = <0>; |
107 |
+ compatible = "ti,gate-clock"; |
108 |
+diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi |
109 |
+index 2bf2e5839a7f1..530210db27198 100644 |
110 |
+--- a/arch/arm/boot/dts/omap5.dtsi |
111 |
++++ b/arch/arm/boot/dts/omap5.dtsi |
112 |
+@@ -25,6 +25,11 @@ |
113 |
+ i2c2 = &i2c3; |
114 |
+ i2c3 = &i2c4; |
115 |
+ i2c4 = &i2c5; |
116 |
++ mmc0 = &mmc1; |
117 |
++ mmc1 = &mmc2; |
118 |
++ mmc2 = &mmc3; |
119 |
++ mmc3 = &mmc4; |
120 |
++ mmc4 = &mmc5; |
121 |
+ serial0 = &uart1; |
122 |
+ serial1 = &uart2; |
123 |
+ serial2 = &uart3; |
124 |
+diff --git a/arch/arm/mach-footbridge/cats-pci.c b/arch/arm/mach-footbridge/cats-pci.c |
125 |
+index 0b2fd7e2e9b42..90b1e9be430e9 100644 |
126 |
+--- a/arch/arm/mach-footbridge/cats-pci.c |
127 |
++++ b/arch/arm/mach-footbridge/cats-pci.c |
128 |
+@@ -15,14 +15,14 @@ |
129 |
+ #include <asm/mach-types.h> |
130 |
+ |
131 |
+ /* cats host-specific stuff */ |
132 |
+-static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 }; |
133 |
++static int irqmap_cats[] = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 }; |
134 |
+ |
135 |
+ static u8 cats_no_swizzle(struct pci_dev *dev, u8 *pin) |
136 |
+ { |
137 |
+ return 0; |
138 |
+ } |
139 |
+ |
140 |
+-static int __init cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
141 |
++static int cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
142 |
+ { |
143 |
+ if (dev->irq >= 255) |
144 |
+ return -1; /* not a valid interrupt. */ |
145 |
+diff --git a/arch/arm/mach-footbridge/ebsa285-pci.c b/arch/arm/mach-footbridge/ebsa285-pci.c |
146 |
+index 6f28aaa9ca79b..c3f280d08fa7f 100644 |
147 |
+--- a/arch/arm/mach-footbridge/ebsa285-pci.c |
148 |
++++ b/arch/arm/mach-footbridge/ebsa285-pci.c |
149 |
+@@ -14,9 +14,9 @@ |
150 |
+ #include <asm/mach/pci.h> |
151 |
+ #include <asm/mach-types.h> |
152 |
+ |
153 |
+-static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI }; |
154 |
++static int irqmap_ebsa285[] = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI }; |
155 |
+ |
156 |
+-static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
157 |
++static int ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
158 |
+ { |
159 |
+ if (dev->vendor == PCI_VENDOR_ID_CONTAQ && |
160 |
+ dev->device == PCI_DEVICE_ID_CONTAQ_82C693) |
161 |
+diff --git a/arch/arm/mach-footbridge/netwinder-pci.c b/arch/arm/mach-footbridge/netwinder-pci.c |
162 |
+index 9473aa0305e5f..e8304392074b8 100644 |
163 |
+--- a/arch/arm/mach-footbridge/netwinder-pci.c |
164 |
++++ b/arch/arm/mach-footbridge/netwinder-pci.c |
165 |
+@@ -18,7 +18,7 @@ |
166 |
+ * We now use the slot ID instead of the device identifiers to select |
167 |
+ * which interrupt is routed where. |
168 |
+ */ |
169 |
+-static int __init netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
170 |
++static int netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
171 |
+ { |
172 |
+ switch (slot) { |
173 |
+ case 0: /* host bridge */ |
174 |
+diff --git a/arch/arm/mach-footbridge/personal-pci.c b/arch/arm/mach-footbridge/personal-pci.c |
175 |
+index 4391e433a4b2f..9d19aa98a663e 100644 |
176 |
+--- a/arch/arm/mach-footbridge/personal-pci.c |
177 |
++++ b/arch/arm/mach-footbridge/personal-pci.c |
178 |
+@@ -14,13 +14,12 @@ |
179 |
+ #include <asm/mach/pci.h> |
180 |
+ #include <asm/mach-types.h> |
181 |
+ |
182 |
+-static int irqmap_personal_server[] __initdata = { |
183 |
++static int irqmap_personal_server[] = { |
184 |
+ IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0, |
185 |
+ IRQ_DOORBELLHOST, IRQ_DMA1, IRQ_DMA2, IRQ_PCI |
186 |
+ }; |
187 |
+ |
188 |
+-static int __init personal_server_map_irq(const struct pci_dev *dev, u8 slot, |
189 |
+- u8 pin) |
190 |
++static int personal_server_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
191 |
+ { |
192 |
+ unsigned char line; |
193 |
+ |
194 |
+diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c |
195 |
+index 09a65c2dfd732..b8fa01f9516eb 100644 |
196 |
+--- a/arch/arm/mach-keystone/keystone.c |
197 |
++++ b/arch/arm/mach-keystone/keystone.c |
198 |
+@@ -65,7 +65,7 @@ static void __init keystone_init(void) |
199 |
+ static long long __init keystone_pv_fixup(void) |
200 |
+ { |
201 |
+ long long offset; |
202 |
+- phys_addr_t mem_start, mem_end; |
203 |
++ u64 mem_start, mem_end; |
204 |
+ |
205 |
+ mem_start = memblock_start_of_DRAM(); |
206 |
+ mem_end = memblock_end_of_DRAM(); |
207 |
+@@ -78,7 +78,7 @@ static long long __init keystone_pv_fixup(void) |
208 |
+ if (mem_start < KEYSTONE_HIGH_PHYS_START || |
209 |
+ mem_end > KEYSTONE_HIGH_PHYS_END) { |
210 |
+ pr_crit("Invalid address space for memory (%08llx-%08llx)\n", |
211 |
+- (u64)mem_start, (u64)mem_end); |
212 |
++ mem_start, mem_end); |
213 |
+ return 0; |
214 |
+ } |
215 |
+ |
216 |
+diff --git a/arch/arm/mach-omap1/ams-delta-fiq-handler.S b/arch/arm/mach-omap1/ams-delta-fiq-handler.S |
217 |
+index 14a6c3eb32985..f745a65d3bd7a 100644 |
218 |
+--- a/arch/arm/mach-omap1/ams-delta-fiq-handler.S |
219 |
++++ b/arch/arm/mach-omap1/ams-delta-fiq-handler.S |
220 |
+@@ -15,6 +15,7 @@ |
221 |
+ #include <linux/platform_data/gpio-omap.h> |
222 |
+ |
223 |
+ #include <asm/assembler.h> |
224 |
++#include <asm/irq.h> |
225 |
+ |
226 |
+ #include "ams-delta-fiq.h" |
227 |
+ #include "board-ams-delta.h" |
228 |
+diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c |
229 |
+index 7290f033fd2da..1610c567a6a3a 100644 |
230 |
+--- a/arch/arm/mach-omap2/board-generic.c |
231 |
++++ b/arch/arm/mach-omap2/board-generic.c |
232 |
+@@ -33,7 +33,7 @@ static void __init __maybe_unused omap_generic_init(void) |
233 |
+ } |
234 |
+ |
235 |
+ /* Clocks are needed early, see drivers/clocksource for the rest */ |
236 |
+-void __init __maybe_unused omap_init_time_of(void) |
237 |
++static void __init __maybe_unused omap_init_time_of(void) |
238 |
+ { |
239 |
+ omap_clk_init(); |
240 |
+ timer_probe(); |
241 |
+diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c |
242 |
+index 17b66f0d0deef..605925684b0aa 100644 |
243 |
+--- a/arch/arm/mach-omap2/sr_device.c |
244 |
++++ b/arch/arm/mach-omap2/sr_device.c |
245 |
+@@ -188,7 +188,7 @@ static const char * const dra7_sr_instances[] = { |
246 |
+ |
247 |
+ int __init omap_devinit_smartreflex(void) |
248 |
+ { |
249 |
+- const char * const *sr_inst; |
250 |
++ const char * const *sr_inst = NULL; |
251 |
+ int i, nr_sr = 0; |
252 |
+ |
253 |
+ if (soc_is_omap44xx()) { |
254 |
+diff --git a/arch/arm/mm/pmsa-v7.c b/arch/arm/mm/pmsa-v7.c |
255 |
+index 88950e41a3a9e..59d916ccdf25f 100644 |
256 |
+--- a/arch/arm/mm/pmsa-v7.c |
257 |
++++ b/arch/arm/mm/pmsa-v7.c |
258 |
+@@ -235,6 +235,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) |
259 |
+ phys_addr_t mem_end; |
260 |
+ phys_addr_t reg_start, reg_end; |
261 |
+ unsigned int mem_max_regions; |
262 |
++ bool first = true; |
263 |
+ int num; |
264 |
+ u64 i; |
265 |
+ |
266 |
+@@ -263,7 +264,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) |
267 |
+ #endif |
268 |
+ |
269 |
+ for_each_mem_range(i, ®_start, ®_end) { |
270 |
+- if (i == 0) { |
271 |
++ if (first) { |
272 |
+ phys_addr_t phys_offset = PHYS_OFFSET; |
273 |
+ |
274 |
+ /* |
275 |
+@@ -275,6 +276,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) |
276 |
+ mem_start = reg_start; |
277 |
+ mem_end = reg_end; |
278 |
+ specified_mem_size = mem_end - mem_start; |
279 |
++ first = false; |
280 |
+ } else { |
281 |
+ /* |
282 |
+ * memblock auto merges contiguous blocks, remove |
283 |
+diff --git a/arch/arm/mm/pmsa-v8.c b/arch/arm/mm/pmsa-v8.c |
284 |
+index 2de019f7503e8..8359748a19a11 100644 |
285 |
+--- a/arch/arm/mm/pmsa-v8.c |
286 |
++++ b/arch/arm/mm/pmsa-v8.c |
287 |
+@@ -95,10 +95,11 @@ void __init pmsav8_adjust_lowmem_bounds(void) |
288 |
+ { |
289 |
+ phys_addr_t mem_end; |
290 |
+ phys_addr_t reg_start, reg_end; |
291 |
++ bool first = true; |
292 |
+ u64 i; |
293 |
+ |
294 |
+ for_each_mem_range(i, ®_start, ®_end) { |
295 |
+- if (i == 0) { |
296 |
++ if (first) { |
297 |
+ phys_addr_t phys_offset = PHYS_OFFSET; |
298 |
+ |
299 |
+ /* |
300 |
+@@ -107,6 +108,7 @@ void __init pmsav8_adjust_lowmem_bounds(void) |
301 |
+ if (reg_start != phys_offset) |
302 |
+ panic("First memory bank must be contiguous from PHYS_OFFSET"); |
303 |
+ mem_end = reg_end; |
304 |
++ first = false; |
305 |
+ } else { |
306 |
+ /* |
307 |
+ * memblock auto merges contiguous blocks, remove |
308 |
+diff --git a/arch/arm/probes/uprobes/core.c b/arch/arm/probes/uprobes/core.c |
309 |
+index c4b49b322e8a8..f5f790c6e5f89 100644 |
310 |
+--- a/arch/arm/probes/uprobes/core.c |
311 |
++++ b/arch/arm/probes/uprobes/core.c |
312 |
+@@ -204,7 +204,7 @@ unsigned long uprobe_get_swbp_addr(struct pt_regs *regs) |
313 |
+ static struct undef_hook uprobes_arm_break_hook = { |
314 |
+ .instr_mask = 0x0fffffff, |
315 |
+ .instr_val = (UPROBE_SWBP_ARM_INSN & 0x0fffffff), |
316 |
+- .cpsr_mask = MODE_MASK, |
317 |
++ .cpsr_mask = (PSR_T_BIT | MODE_MASK), |
318 |
+ .cpsr_val = USR_MODE, |
319 |
+ .fn = uprobe_trap_handler, |
320 |
+ }; |
321 |
+@@ -212,7 +212,7 @@ static struct undef_hook uprobes_arm_break_hook = { |
322 |
+ static struct undef_hook uprobes_arm_ss_hook = { |
323 |
+ .instr_mask = 0x0fffffff, |
324 |
+ .instr_val = (UPROBE_SS_ARM_INSN & 0x0fffffff), |
325 |
+- .cpsr_mask = MODE_MASK, |
326 |
++ .cpsr_mask = (PSR_T_BIT | MODE_MASK), |
327 |
+ .cpsr_val = USR_MODE, |
328 |
+ .fn = uprobe_trap_handler, |
329 |
+ }; |
330 |
+diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig |
331 |
+index c1be64228327c..5e5cf3af63515 100644 |
332 |
+--- a/arch/arm64/Kconfig |
333 |
++++ b/arch/arm64/Kconfig |
334 |
+@@ -1390,10 +1390,13 @@ config ARM64_PAN |
335 |
+ The feature is detected at runtime, and will remain as a 'nop' |
336 |
+ instruction if the cpu does not implement the feature. |
337 |
+ |
338 |
++config AS_HAS_LSE_ATOMICS |
339 |
++ def_bool $(as-instr,.arch_extension lse) |
340 |
++ |
341 |
+ config ARM64_LSE_ATOMICS |
342 |
+ bool |
343 |
+ default ARM64_USE_LSE_ATOMICS |
344 |
+- depends on $(as-instr,.arch_extension lse) |
345 |
++ depends on AS_HAS_LSE_ATOMICS |
346 |
+ |
347 |
+ config ARM64_USE_LSE_ATOMICS |
348 |
+ bool "Atomic instructions" |
349 |
+@@ -1667,6 +1670,7 @@ config ARM64_MTE |
350 |
+ bool "Memory Tagging Extension support" |
351 |
+ default y |
352 |
+ depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI |
353 |
++ depends on AS_HAS_LSE_ATOMICS |
354 |
+ select ARCH_USES_HIGH_VMA_FLAGS |
355 |
+ help |
356 |
+ Memory Tagging (part of the ARMv8.5 Extensions) provides |
357 |
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts |
358 |
+index 302e24be0a318..a1f621b388fe7 100644 |
359 |
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts |
360 |
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts |
361 |
+@@ -8,3 +8,7 @@ |
362 |
+ compatible = "pine64,pine64-lts", "allwinner,sun50i-r18", |
363 |
+ "allwinner,sun50i-a64"; |
364 |
+ }; |
365 |
++ |
366 |
++&mmc0 { |
367 |
++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 push-push switch */ |
368 |
++}; |
369 |
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi |
370 |
+index 3402cec87035b..df62044ff7a7a 100644 |
371 |
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi |
372 |
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi |
373 |
+@@ -34,7 +34,7 @@ |
374 |
+ vmmc-supply = <®_dcdc1>; |
375 |
+ disable-wp; |
376 |
+ bus-width = <4>; |
377 |
+- cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ |
378 |
++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 push-pull switch */ |
379 |
+ status = "okay"; |
380 |
+ }; |
381 |
+ |
382 |
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts |
383 |
+index 7c9dbde645b52..e8163c572daba 100644 |
384 |
+--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts |
385 |
++++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts |
386 |
+@@ -289,10 +289,6 @@ |
387 |
+ vcc-pm-supply = <®_aldo1>; |
388 |
+ }; |
389 |
+ |
390 |
+-&rtc { |
391 |
+- clocks = <&ext_osc32k>; |
392 |
+-}; |
393 |
+- |
394 |
+ &spdif { |
395 |
+ status = "okay"; |
396 |
+ }; |
397 |
+diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h |
398 |
+index 619db9b4c9d5c..3cb3c4ab3ea56 100644 |
399 |
+--- a/arch/arm64/include/asm/alternative.h |
400 |
++++ b/arch/arm64/include/asm/alternative.h |
401 |
+@@ -119,9 +119,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } |
402 |
+ .popsection |
403 |
+ .subsection 1 |
404 |
+ 663: \insn2 |
405 |
+-664: .previous |
406 |
+- .org . - (664b-663b) + (662b-661b) |
407 |
++664: .org . - (664b-663b) + (662b-661b) |
408 |
+ .org . - (662b-661b) + (664b-663b) |
409 |
++ .previous |
410 |
+ .endif |
411 |
+ .endm |
412 |
+ |
413 |
+@@ -191,11 +191,11 @@ static inline void apply_alternatives_module(void *start, size_t length) { } |
414 |
+ */ |
415 |
+ .macro alternative_endif |
416 |
+ 664: |
417 |
++ .org . - (664b-663b) + (662b-661b) |
418 |
++ .org . - (662b-661b) + (664b-663b) |
419 |
+ .if .Lasm_alt_mode==0 |
420 |
+ .previous |
421 |
+ .endif |
422 |
+- .org . - (664b-663b) + (662b-661b) |
423 |
+- .org . - (662b-661b) + (664b-663b) |
424 |
+ .endm |
425 |
+ |
426 |
+ /* |
427 |
+diff --git a/arch/arm64/include/asm/word-at-a-time.h b/arch/arm64/include/asm/word-at-a-time.h |
428 |
+index 3333950b59093..ea487218db790 100644 |
429 |
+--- a/arch/arm64/include/asm/word-at-a-time.h |
430 |
++++ b/arch/arm64/include/asm/word-at-a-time.h |
431 |
+@@ -53,7 +53,7 @@ static inline unsigned long find_zero(unsigned long mask) |
432 |
+ */ |
433 |
+ static inline unsigned long load_unaligned_zeropad(const void *addr) |
434 |
+ { |
435 |
+- unsigned long ret, offset; |
436 |
++ unsigned long ret, tmp; |
437 |
+ |
438 |
+ /* Load word from unaligned pointer addr */ |
439 |
+ asm( |
440 |
+@@ -61,9 +61,9 @@ static inline unsigned long load_unaligned_zeropad(const void *addr) |
441 |
+ "2:\n" |
442 |
+ " .pushsection .fixup,\"ax\"\n" |
443 |
+ " .align 2\n" |
444 |
+- "3: and %1, %2, #0x7\n" |
445 |
+- " bic %2, %2, #0x7\n" |
446 |
+- " ldr %0, [%2]\n" |
447 |
++ "3: bic %1, %2, #0x7\n" |
448 |
++ " ldr %0, [%1]\n" |
449 |
++ " and %1, %2, #0x7\n" |
450 |
+ " lsl %1, %1, #0x3\n" |
451 |
+ #ifndef __AARCH64EB__ |
452 |
+ " lsr %0, %0, %1\n" |
453 |
+@@ -73,7 +73,7 @@ static inline unsigned long load_unaligned_zeropad(const void *addr) |
454 |
+ " b 2b\n" |
455 |
+ " .popsection\n" |
456 |
+ _ASM_EXTABLE(1b, 3b) |
457 |
+- : "=&r" (ret), "=&r" (offset) |
458 |
++ : "=&r" (ret), "=&r" (tmp) |
459 |
+ : "r" (addr), "Q" (*(unsigned long *)addr)); |
460 |
+ |
461 |
+ return ret; |
462 |
+diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S |
463 |
+index d72c818b019ca..2da82c139e1cd 100644 |
464 |
+--- a/arch/arm64/kernel/entry.S |
465 |
++++ b/arch/arm64/kernel/entry.S |
466 |
+@@ -148,16 +148,18 @@ alternative_cb_end |
467 |
+ .endm |
468 |
+ |
469 |
+ /* Check for MTE asynchronous tag check faults */ |
470 |
+- .macro check_mte_async_tcf, flgs, tmp |
471 |
++ .macro check_mte_async_tcf, tmp, ti_flags |
472 |
+ #ifdef CONFIG_ARM64_MTE |
473 |
++ .arch_extension lse |
474 |
+ alternative_if_not ARM64_MTE |
475 |
+ b 1f |
476 |
+ alternative_else_nop_endif |
477 |
+ mrs_s \tmp, SYS_TFSRE0_EL1 |
478 |
+ tbz \tmp, #SYS_TFSR_EL1_TF0_SHIFT, 1f |
479 |
+ /* Asynchronous TCF occurred for TTBR0 access, set the TI flag */ |
480 |
+- orr \flgs, \flgs, #_TIF_MTE_ASYNC_FAULT |
481 |
+- str \flgs, [tsk, #TSK_TI_FLAGS] |
482 |
++ mov \tmp, #_TIF_MTE_ASYNC_FAULT |
483 |
++ add \ti_flags, tsk, #TSK_TI_FLAGS |
484 |
++ stset \tmp, [\ti_flags] |
485 |
+ msr_s SYS_TFSRE0_EL1, xzr |
486 |
+ 1: |
487 |
+ #endif |
488 |
+@@ -207,7 +209,7 @@ alternative_else_nop_endif |
489 |
+ disable_step_tsk x19, x20 |
490 |
+ |
491 |
+ /* Check for asynchronous tag check faults in user space */ |
492 |
+- check_mte_async_tcf x19, x22 |
493 |
++ check_mte_async_tcf x22, x23 |
494 |
+ apply_ssbd 1, x22, x23 |
495 |
+ |
496 |
+ ptrauth_keys_install_kernel tsk, x20, x22, x23 |
497 |
+diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig |
498 |
+index ca0d596c800d8..8916a2850c48b 100644 |
499 |
+--- a/arch/ia64/configs/generic_defconfig |
500 |
++++ b/arch/ia64/configs/generic_defconfig |
501 |
+@@ -55,8 +55,6 @@ CONFIG_CHR_DEV_SG=m |
502 |
+ CONFIG_SCSI_FC_ATTRS=y |
503 |
+ CONFIG_SCSI_SYM53C8XX_2=y |
504 |
+ CONFIG_SCSI_QLOGIC_1280=y |
505 |
+-CONFIG_ATA=y |
506 |
+-CONFIG_ATA_PIIX=y |
507 |
+ CONFIG_SATA_VITESSE=y |
508 |
+ CONFIG_MD=y |
509 |
+ CONFIG_BLK_DEV_MD=m |
510 |
+diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig |
511 |
+index df7fccf76df69..f7abd118d23d3 100644 |
512 |
+--- a/arch/riscv/Kconfig |
513 |
++++ b/arch/riscv/Kconfig |
514 |
+@@ -144,7 +144,7 @@ config ARCH_FLATMEM_ENABLE |
515 |
+ config ARCH_SPARSEMEM_ENABLE |
516 |
+ def_bool y |
517 |
+ depends on MMU |
518 |
+- select SPARSEMEM_STATIC if 32BIT && SPARSMEM |
519 |
++ select SPARSEMEM_STATIC if 32BIT && SPARSEMEM |
520 |
+ select SPARSEMEM_VMEMMAP_ENABLE if 64BIT |
521 |
+ |
522 |
+ config ARCH_SELECT_MEMORY_MODEL |
523 |
+diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c |
524 |
+index d23795057c4f1..28c89fce0dab8 100644 |
525 |
+--- a/arch/x86/kernel/setup.c |
526 |
++++ b/arch/x86/kernel/setup.c |
527 |
+@@ -1051,9 +1051,6 @@ void __init setup_arch(char **cmdline_p) |
528 |
+ |
529 |
+ cleanup_highmap(); |
530 |
+ |
531 |
+- /* Look for ACPI tables and reserve memory occupied by them. */ |
532 |
+- acpi_boot_table_init(); |
533 |
+- |
534 |
+ memblock_set_current_limit(ISA_END_ADDRESS); |
535 |
+ e820__memblock_setup(); |
536 |
+ |
537 |
+@@ -1132,6 +1129,8 @@ void __init setup_arch(char **cmdline_p) |
538 |
+ reserve_initrd(); |
539 |
+ |
540 |
+ acpi_table_upgrade(); |
541 |
++ /* Look for ACPI tables and reserve memory occupied by them. */ |
542 |
++ acpi_boot_table_init(); |
543 |
+ |
544 |
+ vsmp_init(); |
545 |
+ |
546 |
+diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c |
547 |
+index f3eca45267781..15532feb19f10 100644 |
548 |
+--- a/arch/x86/kvm/vmx/nested.c |
549 |
++++ b/arch/x86/kvm/vmx/nested.c |
550 |
+@@ -3329,7 +3329,11 @@ enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu, |
551 |
+ struct vmcs12 *vmcs12 = get_vmcs12(vcpu); |
552 |
+ enum vm_entry_failure_code entry_failure_code; |
553 |
+ bool evaluate_pending_interrupts; |
554 |
+- u32 exit_reason, failed_index; |
555 |
++ union vmx_exit_reason exit_reason = { |
556 |
++ .basic = EXIT_REASON_INVALID_STATE, |
557 |
++ .failed_vmentry = 1, |
558 |
++ }; |
559 |
++ u32 failed_index; |
560 |
+ |
561 |
+ if (kvm_check_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu)) |
562 |
+ kvm_vcpu_flush_tlb_current(vcpu); |
563 |
+@@ -3381,7 +3385,7 @@ enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu, |
564 |
+ |
565 |
+ if (nested_vmx_check_guest_state(vcpu, vmcs12, |
566 |
+ &entry_failure_code)) { |
567 |
+- exit_reason = EXIT_REASON_INVALID_STATE; |
568 |
++ exit_reason.basic = EXIT_REASON_INVALID_STATE; |
569 |
+ vmcs12->exit_qualification = entry_failure_code; |
570 |
+ goto vmentry_fail_vmexit; |
571 |
+ } |
572 |
+@@ -3392,7 +3396,7 @@ enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu, |
573 |
+ vcpu->arch.tsc_offset += vmcs12->tsc_offset; |
574 |
+ |
575 |
+ if (prepare_vmcs02(vcpu, vmcs12, &entry_failure_code)) { |
576 |
+- exit_reason = EXIT_REASON_INVALID_STATE; |
577 |
++ exit_reason.basic = EXIT_REASON_INVALID_STATE; |
578 |
+ vmcs12->exit_qualification = entry_failure_code; |
579 |
+ goto vmentry_fail_vmexit_guest_mode; |
580 |
+ } |
581 |
+@@ -3402,7 +3406,7 @@ enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu, |
582 |
+ vmcs12->vm_entry_msr_load_addr, |
583 |
+ vmcs12->vm_entry_msr_load_count); |
584 |
+ if (failed_index) { |
585 |
+- exit_reason = EXIT_REASON_MSR_LOAD_FAIL; |
586 |
++ exit_reason.basic = EXIT_REASON_MSR_LOAD_FAIL; |
587 |
+ vmcs12->exit_qualification = failed_index; |
588 |
+ goto vmentry_fail_vmexit_guest_mode; |
589 |
+ } |
590 |
+@@ -3470,7 +3474,7 @@ vmentry_fail_vmexit: |
591 |
+ return NVMX_VMENTRY_VMEXIT; |
592 |
+ |
593 |
+ load_vmcs12_host_state(vcpu, vmcs12); |
594 |
+- vmcs12->vm_exit_reason = exit_reason | VMX_EXIT_REASONS_FAILED_VMENTRY; |
595 |
++ vmcs12->vm_exit_reason = exit_reason.full; |
596 |
+ if (enable_shadow_vmcs || vmx->nested.hv_evmcs) |
597 |
+ vmx->nested.need_vmcs12_to_shadow_sync = true; |
598 |
+ return NVMX_VMENTRY_VMEXIT; |
599 |
+@@ -5533,7 +5537,12 @@ static int handle_vmfunc(struct kvm_vcpu *vcpu) |
600 |
+ return kvm_skip_emulated_instruction(vcpu); |
601 |
+ |
602 |
+ fail: |
603 |
+- nested_vmx_vmexit(vcpu, vmx->exit_reason, |
604 |
++ /* |
605 |
++ * This is effectively a reflected VM-Exit, as opposed to a synthesized |
606 |
++ * nested VM-Exit. Pass the original exit reason, i.e. don't hardcode |
607 |
++ * EXIT_REASON_VMFUNC as the exit reason. |
608 |
++ */ |
609 |
++ nested_vmx_vmexit(vcpu, vmx->exit_reason.full, |
610 |
+ vmx_get_intr_info(vcpu), |
611 |
+ vmx_get_exit_qual(vcpu)); |
612 |
+ return 1; |
613 |
+@@ -5601,7 +5610,8 @@ static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu, |
614 |
+ * MSR bitmap. This may be the case even when L0 doesn't use MSR bitmaps. |
615 |
+ */ |
616 |
+ static bool nested_vmx_exit_handled_msr(struct kvm_vcpu *vcpu, |
617 |
+- struct vmcs12 *vmcs12, u32 exit_reason) |
618 |
++ struct vmcs12 *vmcs12, |
619 |
++ union vmx_exit_reason exit_reason) |
620 |
+ { |
621 |
+ u32 msr_index = kvm_rcx_read(vcpu); |
622 |
+ gpa_t bitmap; |
623 |
+@@ -5615,7 +5625,7 @@ static bool nested_vmx_exit_handled_msr(struct kvm_vcpu *vcpu, |
624 |
+ * First we need to figure out which of the four to use: |
625 |
+ */ |
626 |
+ bitmap = vmcs12->msr_bitmap; |
627 |
+- if (exit_reason == EXIT_REASON_MSR_WRITE) |
628 |
++ if (exit_reason.basic == EXIT_REASON_MSR_WRITE) |
629 |
+ bitmap += 2048; |
630 |
+ if (msr_index >= 0xc0000000) { |
631 |
+ msr_index -= 0xc0000000; |
632 |
+@@ -5752,11 +5762,12 @@ static bool nested_vmx_exit_handled_mtf(struct vmcs12 *vmcs12) |
633 |
+ * Return true if L0 wants to handle an exit from L2 regardless of whether or not |
634 |
+ * L1 wants the exit. Only call this when in is_guest_mode (L2). |
635 |
+ */ |
636 |
+-static bool nested_vmx_l0_wants_exit(struct kvm_vcpu *vcpu, u32 exit_reason) |
637 |
++static bool nested_vmx_l0_wants_exit(struct kvm_vcpu *vcpu, |
638 |
++ union vmx_exit_reason exit_reason) |
639 |
+ { |
640 |
+ u32 intr_info; |
641 |
+ |
642 |
+- switch ((u16)exit_reason) { |
643 |
++ switch ((u16)exit_reason.basic) { |
644 |
+ case EXIT_REASON_EXCEPTION_NMI: |
645 |
+ intr_info = vmx_get_intr_info(vcpu); |
646 |
+ if (is_nmi(intr_info)) |
647 |
+@@ -5812,12 +5823,13 @@ static bool nested_vmx_l0_wants_exit(struct kvm_vcpu *vcpu, u32 exit_reason) |
648 |
+ * Return 1 if L1 wants to intercept an exit from L2. Only call this when in |
649 |
+ * is_guest_mode (L2). |
650 |
+ */ |
651 |
+-static bool nested_vmx_l1_wants_exit(struct kvm_vcpu *vcpu, u32 exit_reason) |
652 |
++static bool nested_vmx_l1_wants_exit(struct kvm_vcpu *vcpu, |
653 |
++ union vmx_exit_reason exit_reason) |
654 |
+ { |
655 |
+ struct vmcs12 *vmcs12 = get_vmcs12(vcpu); |
656 |
+ u32 intr_info; |
657 |
+ |
658 |
+- switch ((u16)exit_reason) { |
659 |
++ switch ((u16)exit_reason.basic) { |
660 |
+ case EXIT_REASON_EXCEPTION_NMI: |
661 |
+ intr_info = vmx_get_intr_info(vcpu); |
662 |
+ if (is_nmi(intr_info)) |
663 |
+@@ -5936,7 +5948,7 @@ static bool nested_vmx_l1_wants_exit(struct kvm_vcpu *vcpu, u32 exit_reason) |
664 |
+ bool nested_vmx_reflect_vmexit(struct kvm_vcpu *vcpu) |
665 |
+ { |
666 |
+ struct vcpu_vmx *vmx = to_vmx(vcpu); |
667 |
+- u32 exit_reason = vmx->exit_reason; |
668 |
++ union vmx_exit_reason exit_reason = vmx->exit_reason; |
669 |
+ unsigned long exit_qual; |
670 |
+ u32 exit_intr_info; |
671 |
+ |
672 |
+@@ -5955,7 +5967,7 @@ bool nested_vmx_reflect_vmexit(struct kvm_vcpu *vcpu) |
673 |
+ goto reflect_vmexit; |
674 |
+ } |
675 |
+ |
676 |
+- trace_kvm_nested_vmexit(exit_reason, vcpu, KVM_ISA_VMX); |
677 |
++ trace_kvm_nested_vmexit(exit_reason.full, vcpu, KVM_ISA_VMX); |
678 |
+ |
679 |
+ /* If L0 (KVM) wants the exit, it trumps L1's desires. */ |
680 |
+ if (nested_vmx_l0_wants_exit(vcpu, exit_reason)) |
681 |
+@@ -5981,7 +5993,7 @@ bool nested_vmx_reflect_vmexit(struct kvm_vcpu *vcpu) |
682 |
+ exit_qual = vmx_get_exit_qual(vcpu); |
683 |
+ |
684 |
+ reflect_vmexit: |
685 |
+- nested_vmx_vmexit(vcpu, exit_reason, exit_intr_info, exit_qual); |
686 |
++ nested_vmx_vmexit(vcpu, exit_reason.full, exit_intr_info, exit_qual); |
687 |
+ return true; |
688 |
+ } |
689 |
+ |
690 |
+diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c |
691 |
+index 82af43e14b09c..f8835cabf29f3 100644 |
692 |
+--- a/arch/x86/kvm/vmx/vmx.c |
693 |
++++ b/arch/x86/kvm/vmx/vmx.c |
694 |
+@@ -1578,7 +1578,7 @@ static int skip_emulated_instruction(struct kvm_vcpu *vcpu) |
695 |
+ * i.e. we end up advancing IP with some random value. |
696 |
+ */ |
697 |
+ if (!static_cpu_has(X86_FEATURE_HYPERVISOR) || |
698 |
+- to_vmx(vcpu)->exit_reason != EXIT_REASON_EPT_MISCONFIG) { |
699 |
++ to_vmx(vcpu)->exit_reason.basic != EXIT_REASON_EPT_MISCONFIG) { |
700 |
+ orig_rip = kvm_rip_read(vcpu); |
701 |
+ rip = orig_rip + vmcs_read32(VM_EXIT_INSTRUCTION_LEN); |
702 |
+ #ifdef CONFIG_X86_64 |
703 |
+@@ -5687,7 +5687,7 @@ static void vmx_get_exit_info(struct kvm_vcpu *vcpu, u64 *info1, u64 *info2, |
704 |
+ struct vcpu_vmx *vmx = to_vmx(vcpu); |
705 |
+ |
706 |
+ *info1 = vmx_get_exit_qual(vcpu); |
707 |
+- if (!(vmx->exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY)) { |
708 |
++ if (!(vmx->exit_reason.failed_vmentry)) { |
709 |
+ *info2 = vmx->idt_vectoring_info; |
710 |
+ *intr_info = vmx_get_intr_info(vcpu); |
711 |
+ if (is_exception_with_error_code(*intr_info)) |
712 |
+@@ -5931,8 +5931,9 @@ void dump_vmcs(void) |
713 |
+ static int vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) |
714 |
+ { |
715 |
+ struct vcpu_vmx *vmx = to_vmx(vcpu); |
716 |
+- u32 exit_reason = vmx->exit_reason; |
717 |
++ union vmx_exit_reason exit_reason = vmx->exit_reason; |
718 |
+ u32 vectoring_info = vmx->idt_vectoring_info; |
719 |
++ u16 exit_handler_index; |
720 |
+ |
721 |
+ /* |
722 |
+ * Flush logged GPAs PML buffer, this will make dirty_bitmap more |
723 |
+@@ -5974,11 +5975,11 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) |
724 |
+ return 1; |
725 |
+ } |
726 |
+ |
727 |
+- if (exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY) { |
728 |
++ if (exit_reason.failed_vmentry) { |
729 |
+ dump_vmcs(); |
730 |
+ vcpu->run->exit_reason = KVM_EXIT_FAIL_ENTRY; |
731 |
+ vcpu->run->fail_entry.hardware_entry_failure_reason |
732 |
+- = exit_reason; |
733 |
++ = exit_reason.full; |
734 |
+ vcpu->run->fail_entry.cpu = vcpu->arch.last_vmentry_cpu; |
735 |
+ return 0; |
736 |
+ } |
737 |
+@@ -6000,24 +6001,24 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) |
738 |
+ * will cause infinite loop. |
739 |
+ */ |
740 |
+ if ((vectoring_info & VECTORING_INFO_VALID_MASK) && |
741 |
+- (exit_reason != EXIT_REASON_EXCEPTION_NMI && |
742 |
+- exit_reason != EXIT_REASON_EPT_VIOLATION && |
743 |
+- exit_reason != EXIT_REASON_PML_FULL && |
744 |
+- exit_reason != EXIT_REASON_APIC_ACCESS && |
745 |
+- exit_reason != EXIT_REASON_TASK_SWITCH)) { |
746 |
++ (exit_reason.basic != EXIT_REASON_EXCEPTION_NMI && |
747 |
++ exit_reason.basic != EXIT_REASON_EPT_VIOLATION && |
748 |
++ exit_reason.basic != EXIT_REASON_PML_FULL && |
749 |
++ exit_reason.basic != EXIT_REASON_APIC_ACCESS && |
750 |
++ exit_reason.basic != EXIT_REASON_TASK_SWITCH)) { |
751 |
++ int ndata = 3; |
752 |
++ |
753 |
+ vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; |
754 |
+ vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_DELIVERY_EV; |
755 |
+- vcpu->run->internal.ndata = 3; |
756 |
+ vcpu->run->internal.data[0] = vectoring_info; |
757 |
+- vcpu->run->internal.data[1] = exit_reason; |
758 |
++ vcpu->run->internal.data[1] = exit_reason.full; |
759 |
+ vcpu->run->internal.data[2] = vcpu->arch.exit_qualification; |
760 |
+- if (exit_reason == EXIT_REASON_EPT_MISCONFIG) { |
761 |
+- vcpu->run->internal.ndata++; |
762 |
+- vcpu->run->internal.data[3] = |
763 |
++ if (exit_reason.basic == EXIT_REASON_EPT_MISCONFIG) { |
764 |
++ vcpu->run->internal.data[ndata++] = |
765 |
+ vmcs_read64(GUEST_PHYSICAL_ADDRESS); |
766 |
+ } |
767 |
+- vcpu->run->internal.data[vcpu->run->internal.ndata++] = |
768 |
+- vcpu->arch.last_vmentry_cpu; |
769 |
++ vcpu->run->internal.data[ndata++] = vcpu->arch.last_vmentry_cpu; |
770 |
++ vcpu->run->internal.ndata = ndata; |
771 |
+ return 0; |
772 |
+ } |
773 |
+ |
774 |
+@@ -6043,38 +6044,39 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) |
775 |
+ if (exit_fastpath != EXIT_FASTPATH_NONE) |
776 |
+ return 1; |
777 |
+ |
778 |
+- if (exit_reason >= kvm_vmx_max_exit_handlers) |
779 |
++ if (exit_reason.basic >= kvm_vmx_max_exit_handlers) |
780 |
+ goto unexpected_vmexit; |
781 |
+ #ifdef CONFIG_RETPOLINE |
782 |
+- if (exit_reason == EXIT_REASON_MSR_WRITE) |
783 |
++ if (exit_reason.basic == EXIT_REASON_MSR_WRITE) |
784 |
+ return kvm_emulate_wrmsr(vcpu); |
785 |
+- else if (exit_reason == EXIT_REASON_PREEMPTION_TIMER) |
786 |
++ else if (exit_reason.basic == EXIT_REASON_PREEMPTION_TIMER) |
787 |
+ return handle_preemption_timer(vcpu); |
788 |
+- else if (exit_reason == EXIT_REASON_INTERRUPT_WINDOW) |
789 |
++ else if (exit_reason.basic == EXIT_REASON_INTERRUPT_WINDOW) |
790 |
+ return handle_interrupt_window(vcpu); |
791 |
+- else if (exit_reason == EXIT_REASON_EXTERNAL_INTERRUPT) |
792 |
++ else if (exit_reason.basic == EXIT_REASON_EXTERNAL_INTERRUPT) |
793 |
+ return handle_external_interrupt(vcpu); |
794 |
+- else if (exit_reason == EXIT_REASON_HLT) |
795 |
++ else if (exit_reason.basic == EXIT_REASON_HLT) |
796 |
+ return kvm_emulate_halt(vcpu); |
797 |
+- else if (exit_reason == EXIT_REASON_EPT_MISCONFIG) |
798 |
++ else if (exit_reason.basic == EXIT_REASON_EPT_MISCONFIG) |
799 |
+ return handle_ept_misconfig(vcpu); |
800 |
+ #endif |
801 |
+ |
802 |
+- exit_reason = array_index_nospec(exit_reason, |
803 |
+- kvm_vmx_max_exit_handlers); |
804 |
+- if (!kvm_vmx_exit_handlers[exit_reason]) |
805 |
++ exit_handler_index = array_index_nospec((u16)exit_reason.basic, |
806 |
++ kvm_vmx_max_exit_handlers); |
807 |
++ if (!kvm_vmx_exit_handlers[exit_handler_index]) |
808 |
+ goto unexpected_vmexit; |
809 |
+ |
810 |
+- return kvm_vmx_exit_handlers[exit_reason](vcpu); |
811 |
++ return kvm_vmx_exit_handlers[exit_handler_index](vcpu); |
812 |
+ |
813 |
+ unexpected_vmexit: |
814 |
+- vcpu_unimpl(vcpu, "vmx: unexpected exit reason 0x%x\n", exit_reason); |
815 |
++ vcpu_unimpl(vcpu, "vmx: unexpected exit reason 0x%x\n", |
816 |
++ exit_reason.full); |
817 |
+ dump_vmcs(); |
818 |
+ vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; |
819 |
+ vcpu->run->internal.suberror = |
820 |
+ KVM_INTERNAL_ERROR_UNEXPECTED_EXIT_REASON; |
821 |
+ vcpu->run->internal.ndata = 2; |
822 |
+- vcpu->run->internal.data[0] = exit_reason; |
823 |
++ vcpu->run->internal.data[0] = exit_reason.full; |
824 |
+ vcpu->run->internal.data[1] = vcpu->arch.last_vmentry_cpu; |
825 |
+ return 0; |
826 |
+ } |
827 |
+@@ -6393,9 +6395,9 @@ static void vmx_handle_exit_irqoff(struct kvm_vcpu *vcpu) |
828 |
+ { |
829 |
+ struct vcpu_vmx *vmx = to_vmx(vcpu); |
830 |
+ |
831 |
+- if (vmx->exit_reason == EXIT_REASON_EXTERNAL_INTERRUPT) |
832 |
++ if (vmx->exit_reason.basic == EXIT_REASON_EXTERNAL_INTERRUPT) |
833 |
+ handle_external_interrupt_irqoff(vcpu); |
834 |
+- else if (vmx->exit_reason == EXIT_REASON_EXCEPTION_NMI) |
835 |
++ else if (vmx->exit_reason.basic == EXIT_REASON_EXCEPTION_NMI) |
836 |
+ handle_exception_nmi_irqoff(vmx); |
837 |
+ } |
838 |
+ |
839 |
+@@ -6583,7 +6585,7 @@ void noinstr vmx_update_host_rsp(struct vcpu_vmx *vmx, unsigned long host_rsp) |
840 |
+ |
841 |
+ static fastpath_t vmx_exit_handlers_fastpath(struct kvm_vcpu *vcpu) |
842 |
+ { |
843 |
+- switch (to_vmx(vcpu)->exit_reason) { |
844 |
++ switch (to_vmx(vcpu)->exit_reason.basic) { |
845 |
+ case EXIT_REASON_MSR_WRITE: |
846 |
+ return handle_fastpath_set_msr_irqoff(vcpu); |
847 |
+ case EXIT_REASON_PREEMPTION_TIMER: |
848 |
+@@ -6782,17 +6784,17 @@ reenter_guest: |
849 |
+ vmx->idt_vectoring_info = 0; |
850 |
+ |
851 |
+ if (unlikely(vmx->fail)) { |
852 |
+- vmx->exit_reason = 0xdead; |
853 |
++ vmx->exit_reason.full = 0xdead; |
854 |
+ return EXIT_FASTPATH_NONE; |
855 |
+ } |
856 |
+ |
857 |
+- vmx->exit_reason = vmcs_read32(VM_EXIT_REASON); |
858 |
+- if (unlikely((u16)vmx->exit_reason == EXIT_REASON_MCE_DURING_VMENTRY)) |
859 |
++ vmx->exit_reason.full = vmcs_read32(VM_EXIT_REASON); |
860 |
++ if (unlikely((u16)vmx->exit_reason.basic == EXIT_REASON_MCE_DURING_VMENTRY)) |
861 |
+ kvm_machine_check(); |
862 |
+ |
863 |
+- trace_kvm_exit(vmx->exit_reason, vcpu, KVM_ISA_VMX); |
864 |
++ trace_kvm_exit(vmx->exit_reason.full, vcpu, KVM_ISA_VMX); |
865 |
+ |
866 |
+- if (unlikely(vmx->exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY)) |
867 |
++ if (unlikely(vmx->exit_reason.failed_vmentry)) |
868 |
+ return EXIT_FASTPATH_NONE; |
869 |
+ |
870 |
+ vmx->loaded_vmcs->launched = 1; |
871 |
+diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h |
872 |
+index f6f66e5c65104..ae3a89ac0600d 100644 |
873 |
+--- a/arch/x86/kvm/vmx/vmx.h |
874 |
++++ b/arch/x86/kvm/vmx/vmx.h |
875 |
+@@ -70,6 +70,29 @@ struct pt_desc { |
876 |
+ struct pt_ctx guest; |
877 |
+ }; |
878 |
+ |
879 |
++union vmx_exit_reason { |
880 |
++ struct { |
881 |
++ u32 basic : 16; |
882 |
++ u32 reserved16 : 1; |
883 |
++ u32 reserved17 : 1; |
884 |
++ u32 reserved18 : 1; |
885 |
++ u32 reserved19 : 1; |
886 |
++ u32 reserved20 : 1; |
887 |
++ u32 reserved21 : 1; |
888 |
++ u32 reserved22 : 1; |
889 |
++ u32 reserved23 : 1; |
890 |
++ u32 reserved24 : 1; |
891 |
++ u32 reserved25 : 1; |
892 |
++ u32 reserved26 : 1; |
893 |
++ u32 enclave_mode : 1; |
894 |
++ u32 smi_pending_mtf : 1; |
895 |
++ u32 smi_from_vmx_root : 1; |
896 |
++ u32 reserved30 : 1; |
897 |
++ u32 failed_vmentry : 1; |
898 |
++ }; |
899 |
++ u32 full; |
900 |
++}; |
901 |
++ |
902 |
+ /* |
903 |
+ * The nested_vmx structure is part of vcpu_vmx, and holds information we need |
904 |
+ * for correct emulation of VMX (i.e., nested VMX) on this vcpu. |
905 |
+@@ -244,7 +267,7 @@ struct vcpu_vmx { |
906 |
+ int vpid; |
907 |
+ bool emulation_required; |
908 |
+ |
909 |
+- u32 exit_reason; |
910 |
++ union vmx_exit_reason exit_reason; |
911 |
+ |
912 |
+ /* Posted interrupt descriptor */ |
913 |
+ struct pi_desc pi_desc; |
914 |
+diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c |
915 |
+index fe6a460c43735..af3ee288bc117 100644 |
916 |
+--- a/drivers/dma/dmaengine.c |
917 |
++++ b/drivers/dma/dmaengine.c |
918 |
+@@ -1086,6 +1086,7 @@ static int __dma_async_device_channel_register(struct dma_device *device, |
919 |
+ kfree(chan->dev); |
920 |
+ err_free_local: |
921 |
+ free_percpu(chan->local); |
922 |
++ chan->local = NULL; |
923 |
+ return rc; |
924 |
+ } |
925 |
+ |
926 |
+diff --git a/drivers/dma/dw/Kconfig b/drivers/dma/dw/Kconfig |
927 |
+index e5162690de8f1..db25f9b7778c9 100644 |
928 |
+--- a/drivers/dma/dw/Kconfig |
929 |
++++ b/drivers/dma/dw/Kconfig |
930 |
+@@ -10,6 +10,7 @@ config DW_DMAC_CORE |
931 |
+ |
932 |
+ config DW_DMAC |
933 |
+ tristate "Synopsys DesignWare AHB DMA platform driver" |
934 |
++ depends on HAS_IOMEM |
935 |
+ select DW_DMAC_CORE |
936 |
+ help |
937 |
+ Support the Synopsys DesignWare AHB DMA controller. This |
938 |
+@@ -18,6 +19,7 @@ config DW_DMAC |
939 |
+ config DW_DMAC_PCI |
940 |
+ tristate "Synopsys DesignWare AHB DMA PCI driver" |
941 |
+ depends on PCI |
942 |
++ depends on HAS_IOMEM |
943 |
+ select DW_DMAC_CORE |
944 |
+ help |
945 |
+ Support the Synopsys DesignWare AHB DMA controller on the |
946 |
+diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c |
947 |
+index a6704838ffcb7..459e9fbc2253a 100644 |
948 |
+--- a/drivers/dma/idxd/device.c |
949 |
++++ b/drivers/dma/idxd/device.c |
950 |
+@@ -263,6 +263,22 @@ void idxd_wq_drain(struct idxd_wq *wq) |
951 |
+ idxd_cmd_exec(idxd, IDXD_CMD_DRAIN_WQ, operand, NULL); |
952 |
+ } |
953 |
+ |
954 |
++void idxd_wq_reset(struct idxd_wq *wq) |
955 |
++{ |
956 |
++ struct idxd_device *idxd = wq->idxd; |
957 |
++ struct device *dev = &idxd->pdev->dev; |
958 |
++ u32 operand; |
959 |
++ |
960 |
++ if (wq->state != IDXD_WQ_ENABLED) { |
961 |
++ dev_dbg(dev, "WQ %d in wrong state: %d\n", wq->id, wq->state); |
962 |
++ return; |
963 |
++ } |
964 |
++ |
965 |
++ operand = BIT(wq->id % 16) | ((wq->id / 16) << 16); |
966 |
++ idxd_cmd_exec(idxd, IDXD_CMD_RESET_WQ, operand, NULL); |
967 |
++ wq->state = IDXD_WQ_DISABLED; |
968 |
++} |
969 |
++ |
970 |
+ int idxd_wq_map_portal(struct idxd_wq *wq) |
971 |
+ { |
972 |
+ struct idxd_device *idxd = wq->idxd; |
973 |
+@@ -291,8 +307,6 @@ void idxd_wq_unmap_portal(struct idxd_wq *wq) |
974 |
+ void idxd_wq_disable_cleanup(struct idxd_wq *wq) |
975 |
+ { |
976 |
+ struct idxd_device *idxd = wq->idxd; |
977 |
+- struct device *dev = &idxd->pdev->dev; |
978 |
+- int i, wq_offset; |
979 |
+ |
980 |
+ lockdep_assert_held(&idxd->dev_lock); |
981 |
+ memset(wq->wqcfg, 0, idxd->wqcfg_size); |
982 |
+@@ -303,14 +317,6 @@ void idxd_wq_disable_cleanup(struct idxd_wq *wq) |
983 |
+ wq->priority = 0; |
984 |
+ clear_bit(WQ_FLAG_DEDICATED, &wq->flags); |
985 |
+ memset(wq->name, 0, WQ_NAME_SIZE); |
986 |
+- |
987 |
+- for (i = 0; i < WQCFG_STRIDES(idxd); i++) { |
988 |
+- wq_offset = WQCFG_OFFSET(idxd, wq->id, i); |
989 |
+- iowrite32(0, idxd->reg_base + wq_offset); |
990 |
+- dev_dbg(dev, "WQ[%d][%d][%#x]: %#x\n", |
991 |
+- wq->id, i, wq_offset, |
992 |
+- ioread32(idxd->reg_base + wq_offset)); |
993 |
+- } |
994 |
+ } |
995 |
+ |
996 |
+ /* Device control bits */ |
997 |
+@@ -560,7 +566,14 @@ static int idxd_wq_config_write(struct idxd_wq *wq) |
998 |
+ if (!wq->group) |
999 |
+ return 0; |
1000 |
+ |
1001 |
+- memset(wq->wqcfg, 0, idxd->wqcfg_size); |
1002 |
++ /* |
1003 |
++ * Instead of memset the entire shadow copy of WQCFG, copy from the hardware after |
1004 |
++ * wq reset. This will copy back the sticky values that are present on some devices. |
1005 |
++ */ |
1006 |
++ for (i = 0; i < WQCFG_STRIDES(idxd); i++) { |
1007 |
++ wq_offset = WQCFG_OFFSET(idxd, wq->id, i); |
1008 |
++ wq->wqcfg->bits[i] = ioread32(idxd->reg_base + wq_offset); |
1009 |
++ } |
1010 |
+ |
1011 |
+ /* byte 0-3 */ |
1012 |
+ wq->wqcfg->wq_size = wq->size; |
1013 |
+diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h |
1014 |
+index 953ef6536aac4..1d7849cb91004 100644 |
1015 |
+--- a/drivers/dma/idxd/idxd.h |
1016 |
++++ b/drivers/dma/idxd/idxd.h |
1017 |
+@@ -295,6 +295,7 @@ void idxd_wq_free_resources(struct idxd_wq *wq); |
1018 |
+ int idxd_wq_enable(struct idxd_wq *wq); |
1019 |
+ int idxd_wq_disable(struct idxd_wq *wq); |
1020 |
+ void idxd_wq_drain(struct idxd_wq *wq); |
1021 |
++void idxd_wq_reset(struct idxd_wq *wq); |
1022 |
+ int idxd_wq_map_portal(struct idxd_wq *wq); |
1023 |
+ void idxd_wq_unmap_portal(struct idxd_wq *wq); |
1024 |
+ void idxd_wq_disable_cleanup(struct idxd_wq *wq); |
1025 |
+diff --git a/drivers/dma/idxd/irq.c b/drivers/dma/idxd/irq.c |
1026 |
+index 552e2e2707058..6bb1c1773aae6 100644 |
1027 |
+--- a/drivers/dma/idxd/irq.c |
1028 |
++++ b/drivers/dma/idxd/irq.c |
1029 |
+@@ -66,7 +66,9 @@ static int process_misc_interrupts(struct idxd_device *idxd, u32 cause) |
1030 |
+ for (i = 0; i < 4; i++) |
1031 |
+ idxd->sw_err.bits[i] = ioread64(idxd->reg_base + |
1032 |
+ IDXD_SWERR_OFFSET + i * sizeof(u64)); |
1033 |
+- iowrite64(IDXD_SWERR_ACK, idxd->reg_base + IDXD_SWERR_OFFSET); |
1034 |
++ |
1035 |
++ iowrite64(idxd->sw_err.bits[0] & IDXD_SWERR_ACK, |
1036 |
++ idxd->reg_base + IDXD_SWERR_OFFSET); |
1037 |
+ |
1038 |
+ if (idxd->sw_err.valid && idxd->sw_err.wq_idx_valid) { |
1039 |
+ int id = idxd->sw_err.wq_idx; |
1040 |
+diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c |
1041 |
+index fb97c9f319a55..7566b573d546e 100644 |
1042 |
+--- a/drivers/dma/idxd/sysfs.c |
1043 |
++++ b/drivers/dma/idxd/sysfs.c |
1044 |
+@@ -241,7 +241,6 @@ static void disable_wq(struct idxd_wq *wq) |
1045 |
+ { |
1046 |
+ struct idxd_device *idxd = wq->idxd; |
1047 |
+ struct device *dev = &idxd->pdev->dev; |
1048 |
+- int rc; |
1049 |
+ |
1050 |
+ mutex_lock(&wq->wq_lock); |
1051 |
+ dev_dbg(dev, "%s removing WQ %s\n", __func__, dev_name(&wq->conf_dev)); |
1052 |
+@@ -262,17 +261,13 @@ static void disable_wq(struct idxd_wq *wq) |
1053 |
+ idxd_wq_unmap_portal(wq); |
1054 |
+ |
1055 |
+ idxd_wq_drain(wq); |
1056 |
+- rc = idxd_wq_disable(wq); |
1057 |
++ idxd_wq_reset(wq); |
1058 |
+ |
1059 |
+ idxd_wq_free_resources(wq); |
1060 |
+ wq->client_count = 0; |
1061 |
+ mutex_unlock(&wq->wq_lock); |
1062 |
+ |
1063 |
+- if (rc < 0) |
1064 |
+- dev_warn(dev, "Failed to disable %s: %d\n", |
1065 |
+- dev_name(&wq->conf_dev), rc); |
1066 |
+- else |
1067 |
+- dev_info(dev, "wq %s disabled\n", dev_name(&wq->conf_dev)); |
1068 |
++ dev_info(dev, "wq %s disabled\n", dev_name(&wq->conf_dev)); |
1069 |
+ } |
1070 |
+ |
1071 |
+ static int idxd_config_bus_remove(struct device *dev) |
1072 |
+@@ -923,7 +918,7 @@ static ssize_t wq_size_store(struct device *dev, |
1073 |
+ if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags)) |
1074 |
+ return -EPERM; |
1075 |
+ |
1076 |
+- if (wq->state != IDXD_WQ_DISABLED) |
1077 |
++ if (idxd->state == IDXD_DEV_ENABLED) |
1078 |
+ return -EPERM; |
1079 |
+ |
1080 |
+ if (size + total_claimed_wq_size(idxd) - wq->size > idxd->max_wq_size) |
1081 |
+@@ -1259,8 +1254,14 @@ static ssize_t op_cap_show(struct device *dev, |
1082 |
+ { |
1083 |
+ struct idxd_device *idxd = |
1084 |
+ container_of(dev, struct idxd_device, conf_dev); |
1085 |
++ int i, rc = 0; |
1086 |
++ |
1087 |
++ for (i = 0; i < 4; i++) |
1088 |
++ rc += sysfs_emit_at(buf, rc, "%#llx ", idxd->hw.opcap.bits[i]); |
1089 |
+ |
1090 |
+- return sprintf(buf, "%#llx\n", idxd->hw.opcap.bits[0]); |
1091 |
++ rc--; |
1092 |
++ rc += sysfs_emit_at(buf, rc, "\n"); |
1093 |
++ return rc; |
1094 |
+ } |
1095 |
+ static DEVICE_ATTR_RO(op_cap); |
1096 |
+ |
1097 |
+diff --git a/drivers/dma/plx_dma.c b/drivers/dma/plx_dma.c |
1098 |
+index f387c5bbc170c..1669345441619 100644 |
1099 |
+--- a/drivers/dma/plx_dma.c |
1100 |
++++ b/drivers/dma/plx_dma.c |
1101 |
+@@ -507,10 +507,8 @@ static int plx_dma_create(struct pci_dev *pdev) |
1102 |
+ |
1103 |
+ rc = request_irq(pci_irq_vector(pdev, 0), plx_dma_isr, 0, |
1104 |
+ KBUILD_MODNAME, plxdev); |
1105 |
+- if (rc) { |
1106 |
+- kfree(plxdev); |
1107 |
+- return rc; |
1108 |
+- } |
1109 |
++ if (rc) |
1110 |
++ goto free_plx; |
1111 |
+ |
1112 |
+ spin_lock_init(&plxdev->ring_lock); |
1113 |
+ tasklet_setup(&plxdev->desc_task, plx_dma_desc_task); |
1114 |
+@@ -540,14 +538,20 @@ static int plx_dma_create(struct pci_dev *pdev) |
1115 |
+ rc = dma_async_device_register(dma); |
1116 |
+ if (rc) { |
1117 |
+ pci_err(pdev, "Failed to register dma device: %d\n", rc); |
1118 |
+- free_irq(pci_irq_vector(pdev, 0), plxdev); |
1119 |
+- kfree(plxdev); |
1120 |
+- return rc; |
1121 |
++ goto put_device; |
1122 |
+ } |
1123 |
+ |
1124 |
+ pci_set_drvdata(pdev, plxdev); |
1125 |
+ |
1126 |
+ return 0; |
1127 |
++ |
1128 |
++put_device: |
1129 |
++ put_device(&pdev->dev); |
1130 |
++ free_irq(pci_irq_vector(pdev, 0), plxdev); |
1131 |
++free_plx: |
1132 |
++ kfree(plxdev); |
1133 |
++ |
1134 |
++ return rc; |
1135 |
+ } |
1136 |
+ |
1137 |
+ static int plx_dma_probe(struct pci_dev *pdev, |
1138 |
+diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c |
1139 |
+index 728f6c6871824..fa5d945b2f286 100644 |
1140 |
+--- a/drivers/gpio/gpiolib-sysfs.c |
1141 |
++++ b/drivers/gpio/gpiolib-sysfs.c |
1142 |
+@@ -458,6 +458,8 @@ static ssize_t export_store(struct class *class, |
1143 |
+ long gpio; |
1144 |
+ struct gpio_desc *desc; |
1145 |
+ int status; |
1146 |
++ struct gpio_chip *gc; |
1147 |
++ int offset; |
1148 |
+ |
1149 |
+ status = kstrtol(buf, 0, &gpio); |
1150 |
+ if (status < 0) |
1151 |
+@@ -469,6 +471,12 @@ static ssize_t export_store(struct class *class, |
1152 |
+ pr_warn("%s: invalid GPIO %ld\n", __func__, gpio); |
1153 |
+ return -EINVAL; |
1154 |
+ } |
1155 |
++ gc = desc->gdev->chip; |
1156 |
++ offset = gpio_chip_hwgpio(desc); |
1157 |
++ if (!gpiochip_line_is_valid(gc, offset)) { |
1158 |
++ pr_warn("%s: GPIO %ld masked\n", __func__, gpio); |
1159 |
++ return -EINVAL; |
1160 |
++ } |
1161 |
+ |
1162 |
+ /* No extra locking here; FLAG_SYSFS just signifies that the |
1163 |
+ * request and export were done by on behalf of userspace, so |
1164 |
+diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c |
1165 |
+index 5e11cdb207d83..0ca7e53db112a 100644 |
1166 |
+--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c |
1167 |
++++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c |
1168 |
+@@ -1240,8 +1240,8 @@ static int a5xx_pm_suspend(struct msm_gpu *gpu) |
1169 |
+ |
1170 |
+ static int a5xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value) |
1171 |
+ { |
1172 |
+- *value = gpu_read64(gpu, REG_A5XX_RBBM_PERFCTR_CP_0_LO, |
1173 |
+- REG_A5XX_RBBM_PERFCTR_CP_0_HI); |
1174 |
++ *value = gpu_read64(gpu, REG_A5XX_RBBM_ALWAYSON_COUNTER_LO, |
1175 |
++ REG_A5XX_RBBM_ALWAYSON_COUNTER_HI); |
1176 |
+ |
1177 |
+ return 0; |
1178 |
+ } |
1179 |
+diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c |
1180 |
+index 83b50f6d6bb78..722c2fe3bfd56 100644 |
1181 |
+--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c |
1182 |
++++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c |
1183 |
+@@ -1073,8 +1073,8 @@ static int a6xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value) |
1184 |
+ /* Force the GPU power on so we can read this register */ |
1185 |
+ a6xx_gmu_set_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET); |
1186 |
+ |
1187 |
+- *value = gpu_read64(gpu, REG_A6XX_RBBM_PERFCTR_CP_0_LO, |
1188 |
+- REG_A6XX_RBBM_PERFCTR_CP_0_HI); |
1189 |
++ *value = gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER_LO, |
1190 |
++ REG_A6XX_CP_ALWAYS_ON_COUNTER_HI); |
1191 |
+ |
1192 |
+ a6xx_gmu_clear_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET); |
1193 |
+ mutex_unlock(&perfcounter_oob); |
1194 |
+diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_drm_front.c |
1195 |
+index cc93a8c9547bc..8ea91542b567a 100644 |
1196 |
+--- a/drivers/gpu/drm/xen/xen_drm_front.c |
1197 |
++++ b/drivers/gpu/drm/xen/xen_drm_front.c |
1198 |
+@@ -531,7 +531,7 @@ static int xen_drm_drv_init(struct xen_drm_front_info *front_info) |
1199 |
+ drm_dev = drm_dev_alloc(&xen_drm_driver, dev); |
1200 |
+ if (IS_ERR(drm_dev)) { |
1201 |
+ ret = PTR_ERR(drm_dev); |
1202 |
+- goto fail; |
1203 |
++ goto fail_dev; |
1204 |
+ } |
1205 |
+ |
1206 |
+ drm_info->drm_dev = drm_dev; |
1207 |
+@@ -561,8 +561,10 @@ fail_modeset: |
1208 |
+ drm_kms_helper_poll_fini(drm_dev); |
1209 |
+ drm_mode_config_cleanup(drm_dev); |
1210 |
+ drm_dev_put(drm_dev); |
1211 |
+-fail: |
1212 |
++fail_dev: |
1213 |
+ kfree(drm_info); |
1214 |
++ front_info->drm_info = NULL; |
1215 |
++fail: |
1216 |
+ return ret; |
1217 |
+ } |
1218 |
+ |
1219 |
+diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c |
1220 |
+index 44d715c12f6ab..6cda5935fc09c 100644 |
1221 |
+--- a/drivers/hid/wacom_wac.c |
1222 |
++++ b/drivers/hid/wacom_wac.c |
1223 |
+@@ -3574,8 +3574,6 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev, |
1224 |
+ { |
1225 |
+ struct wacom_features *features = &wacom_wac->features; |
1226 |
+ |
1227 |
+- input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
1228 |
+- |
1229 |
+ if (!(features->device_type & WACOM_DEVICETYPE_PEN)) |
1230 |
+ return -ENODEV; |
1231 |
+ |
1232 |
+@@ -3590,6 +3588,7 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev, |
1233 |
+ return 0; |
1234 |
+ } |
1235 |
+ |
1236 |
++ input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
1237 |
+ __set_bit(BTN_TOUCH, input_dev->keybit); |
1238 |
+ __set_bit(ABS_MISC, input_dev->absbit); |
1239 |
+ |
1240 |
+@@ -3742,8 +3741,6 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev, |
1241 |
+ { |
1242 |
+ struct wacom_features *features = &wacom_wac->features; |
1243 |
+ |
1244 |
+- input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
1245 |
+- |
1246 |
+ if (!(features->device_type & WACOM_DEVICETYPE_TOUCH)) |
1247 |
+ return -ENODEV; |
1248 |
+ |
1249 |
+@@ -3756,6 +3753,7 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev, |
1250 |
+ /* setup has already been done */ |
1251 |
+ return 0; |
1252 |
+ |
1253 |
++ input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
1254 |
+ __set_bit(BTN_TOUCH, input_dev->keybit); |
1255 |
+ |
1256 |
+ if (features->touch_max == 1) { |
1257 |
+diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c |
1258 |
+index 63d5e488137dc..e9fa1423f1360 100644 |
1259 |
+--- a/drivers/input/keyboard/nspire-keypad.c |
1260 |
++++ b/drivers/input/keyboard/nspire-keypad.c |
1261 |
+@@ -93,9 +93,15 @@ static irqreturn_t nspire_keypad_irq(int irq, void *dev_id) |
1262 |
+ return IRQ_HANDLED; |
1263 |
+ } |
1264 |
+ |
1265 |
+-static int nspire_keypad_chip_init(struct nspire_keypad *keypad) |
1266 |
++static int nspire_keypad_open(struct input_dev *input) |
1267 |
+ { |
1268 |
++ struct nspire_keypad *keypad = input_get_drvdata(input); |
1269 |
+ unsigned long val = 0, cycles_per_us, delay_cycles, row_delay_cycles; |
1270 |
++ int error; |
1271 |
++ |
1272 |
++ error = clk_prepare_enable(keypad->clk); |
1273 |
++ if (error) |
1274 |
++ return error; |
1275 |
+ |
1276 |
+ cycles_per_us = (clk_get_rate(keypad->clk) / 1000000); |
1277 |
+ if (cycles_per_us == 0) |
1278 |
+@@ -121,30 +127,6 @@ static int nspire_keypad_chip_init(struct nspire_keypad *keypad) |
1279 |
+ keypad->int_mask = 1 << 1; |
1280 |
+ writel(keypad->int_mask, keypad->reg_base + KEYPAD_INTMSK); |
1281 |
+ |
1282 |
+- /* Disable GPIO interrupts to prevent hanging on touchpad */ |
1283 |
+- /* Possibly used to detect touchpad events */ |
1284 |
+- writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT); |
1285 |
+- /* Acknowledge existing interrupts */ |
1286 |
+- writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS); |
1287 |
+- |
1288 |
+- return 0; |
1289 |
+-} |
1290 |
+- |
1291 |
+-static int nspire_keypad_open(struct input_dev *input) |
1292 |
+-{ |
1293 |
+- struct nspire_keypad *keypad = input_get_drvdata(input); |
1294 |
+- int error; |
1295 |
+- |
1296 |
+- error = clk_prepare_enable(keypad->clk); |
1297 |
+- if (error) |
1298 |
+- return error; |
1299 |
+- |
1300 |
+- error = nspire_keypad_chip_init(keypad); |
1301 |
+- if (error) { |
1302 |
+- clk_disable_unprepare(keypad->clk); |
1303 |
+- return error; |
1304 |
+- } |
1305 |
+- |
1306 |
+ return 0; |
1307 |
+ } |
1308 |
+ |
1309 |
+@@ -152,6 +134,11 @@ static void nspire_keypad_close(struct input_dev *input) |
1310 |
+ { |
1311 |
+ struct nspire_keypad *keypad = input_get_drvdata(input); |
1312 |
+ |
1313 |
++ /* Disable interrupts */ |
1314 |
++ writel(0, keypad->reg_base + KEYPAD_INTMSK); |
1315 |
++ /* Acknowledge existing interrupts */ |
1316 |
++ writel(~0, keypad->reg_base + KEYPAD_INT); |
1317 |
++ |
1318 |
+ clk_disable_unprepare(keypad->clk); |
1319 |
+ } |
1320 |
+ |
1321 |
+@@ -210,6 +197,25 @@ static int nspire_keypad_probe(struct platform_device *pdev) |
1322 |
+ return -ENOMEM; |
1323 |
+ } |
1324 |
+ |
1325 |
++ error = clk_prepare_enable(keypad->clk); |
1326 |
++ if (error) { |
1327 |
++ dev_err(&pdev->dev, "failed to enable clock\n"); |
1328 |
++ return error; |
1329 |
++ } |
1330 |
++ |
1331 |
++ /* Disable interrupts */ |
1332 |
++ writel(0, keypad->reg_base + KEYPAD_INTMSK); |
1333 |
++ /* Acknowledge existing interrupts */ |
1334 |
++ writel(~0, keypad->reg_base + KEYPAD_INT); |
1335 |
++ |
1336 |
++ /* Disable GPIO interrupts to prevent hanging on touchpad */ |
1337 |
++ /* Possibly used to detect touchpad events */ |
1338 |
++ writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT); |
1339 |
++ /* Acknowledge existing GPIO interrupts */ |
1340 |
++ writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS); |
1341 |
++ |
1342 |
++ clk_disable_unprepare(keypad->clk); |
1343 |
++ |
1344 |
+ input_set_drvdata(input, keypad); |
1345 |
+ |
1346 |
+ input->id.bustype = BUS_HOST; |
1347 |
+diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h |
1348 |
+index 9119e12a57784..a5a0035536462 100644 |
1349 |
+--- a/drivers/input/serio/i8042-x86ia64io.h |
1350 |
++++ b/drivers/input/serio/i8042-x86ia64io.h |
1351 |
+@@ -588,6 +588,7 @@ static const struct dmi_system_id i8042_dmi_noselftest_table[] = { |
1352 |
+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
1353 |
+ DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */ |
1354 |
+ }, |
1355 |
++ }, { |
1356 |
+ .matches = { |
1357 |
+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
1358 |
+ DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */ |
1359 |
+diff --git a/drivers/input/touchscreen/s6sy761.c b/drivers/input/touchscreen/s6sy761.c |
1360 |
+index b63d7fdf0cd20..85a1f465c097e 100644 |
1361 |
+--- a/drivers/input/touchscreen/s6sy761.c |
1362 |
++++ b/drivers/input/touchscreen/s6sy761.c |
1363 |
+@@ -145,8 +145,8 @@ static void s6sy761_report_coordinates(struct s6sy761_data *sdata, |
1364 |
+ u8 major = event[4]; |
1365 |
+ u8 minor = event[5]; |
1366 |
+ u8 z = event[6] & S6SY761_MASK_Z; |
1367 |
+- u16 x = (event[1] << 3) | ((event[3] & S6SY761_MASK_X) >> 4); |
1368 |
+- u16 y = (event[2] << 3) | (event[3] & S6SY761_MASK_Y); |
1369 |
++ u16 x = (event[1] << 4) | ((event[3] & S6SY761_MASK_X) >> 4); |
1370 |
++ u16 y = (event[2] << 4) | (event[3] & S6SY761_MASK_Y); |
1371 |
+ |
1372 |
+ input_mt_slot(sdata->input, tid); |
1373 |
+ |
1374 |
+diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c |
1375 |
+index 66f4c6398f670..cea2b37897367 100644 |
1376 |
+--- a/drivers/md/dm-verity-fec.c |
1377 |
++++ b/drivers/md/dm-verity-fec.c |
1378 |
+@@ -65,7 +65,7 @@ static u8 *fec_read_parity(struct dm_verity *v, u64 rsb, int index, |
1379 |
+ u8 *res; |
1380 |
+ |
1381 |
+ position = (index + rsb) * v->fec->roots; |
1382 |
+- block = div64_u64_rem(position, v->fec->roots << SECTOR_SHIFT, &rem); |
1383 |
++ block = div64_u64_rem(position, v->fec->io_size, &rem); |
1384 |
+ *offset = (unsigned)rem; |
1385 |
+ |
1386 |
+ res = dm_bufio_read(v->fec->bufio, block, buf); |
1387 |
+@@ -154,7 +154,7 @@ static int fec_decode_bufs(struct dm_verity *v, struct dm_verity_fec_io *fio, |
1388 |
+ |
1389 |
+ /* read the next block when we run out of parity bytes */ |
1390 |
+ offset += v->fec->roots; |
1391 |
+- if (offset >= v->fec->roots << SECTOR_SHIFT) { |
1392 |
++ if (offset >= v->fec->io_size) { |
1393 |
+ dm_bufio_release(buf); |
1394 |
+ |
1395 |
+ par = fec_read_parity(v, rsb, block_offset, &offset, &buf); |
1396 |
+@@ -742,8 +742,13 @@ int verity_fec_ctr(struct dm_verity *v) |
1397 |
+ return -E2BIG; |
1398 |
+ } |
1399 |
+ |
1400 |
++ if ((f->roots << SECTOR_SHIFT) & ((1 << v->data_dev_block_bits) - 1)) |
1401 |
++ f->io_size = 1 << v->data_dev_block_bits; |
1402 |
++ else |
1403 |
++ f->io_size = v->fec->roots << SECTOR_SHIFT; |
1404 |
++ |
1405 |
+ f->bufio = dm_bufio_client_create(f->dev->bdev, |
1406 |
+- f->roots << SECTOR_SHIFT, |
1407 |
++ f->io_size, |
1408 |
+ 1, 0, NULL, NULL); |
1409 |
+ if (IS_ERR(f->bufio)) { |
1410 |
+ ti->error = "Cannot initialize FEC bufio client"; |
1411 |
+diff --git a/drivers/md/dm-verity-fec.h b/drivers/md/dm-verity-fec.h |
1412 |
+index 42fbd3a7fc9f1..3c46c8d618833 100644 |
1413 |
+--- a/drivers/md/dm-verity-fec.h |
1414 |
++++ b/drivers/md/dm-verity-fec.h |
1415 |
+@@ -36,6 +36,7 @@ struct dm_verity_fec { |
1416 |
+ struct dm_dev *dev; /* parity data device */ |
1417 |
+ struct dm_bufio_client *data_bufio; /* for data dev access */ |
1418 |
+ struct dm_bufio_client *bufio; /* for parity data access */ |
1419 |
++ size_t io_size; /* IO size for roots */ |
1420 |
+ sector_t start; /* parity data start in blocks */ |
1421 |
+ sector_t blocks; /* number of blocks covered */ |
1422 |
+ sector_t rounds; /* number of interleaving rounds */ |
1423 |
+diff --git a/drivers/mtd/nand/raw/mtk_nand.c b/drivers/mtd/nand/raw/mtk_nand.c |
1424 |
+index 57f1f17089946..5c5c92132287d 100644 |
1425 |
+--- a/drivers/mtd/nand/raw/mtk_nand.c |
1426 |
++++ b/drivers/mtd/nand/raw/mtk_nand.c |
1427 |
+@@ -488,8 +488,8 @@ static int mtk_nfc_exec_instr(struct nand_chip *chip, |
1428 |
+ return 0; |
1429 |
+ case NAND_OP_WAITRDY_INSTR: |
1430 |
+ return readl_poll_timeout(nfc->regs + NFI_STA, status, |
1431 |
+- status & STA_BUSY, 20, |
1432 |
+- instr->ctx.waitrdy.timeout_ms); |
1433 |
++ !(status & STA_BUSY), 20, |
1434 |
++ instr->ctx.waitrdy.timeout_ms * 1000); |
1435 |
+ default: |
1436 |
+ break; |
1437 |
+ } |
1438 |
+diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c |
1439 |
+index 87160e723dfcf..70ec17f3c3007 100644 |
1440 |
+--- a/drivers/net/dsa/mv88e6xxx/chip.c |
1441 |
++++ b/drivers/net/dsa/mv88e6xxx/chip.c |
1442 |
+@@ -2994,10 +2994,17 @@ out_resources: |
1443 |
+ return err; |
1444 |
+ } |
1445 |
+ |
1446 |
++/* prod_id for switch families which do not have a PHY model number */ |
1447 |
++static const u16 family_prod_id_table[] = { |
1448 |
++ [MV88E6XXX_FAMILY_6341] = MV88E6XXX_PORT_SWITCH_ID_PROD_6341, |
1449 |
++ [MV88E6XXX_FAMILY_6390] = MV88E6XXX_PORT_SWITCH_ID_PROD_6390, |
1450 |
++}; |
1451 |
++ |
1452 |
+ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg) |
1453 |
+ { |
1454 |
+ struct mv88e6xxx_mdio_bus *mdio_bus = bus->priv; |
1455 |
+ struct mv88e6xxx_chip *chip = mdio_bus->chip; |
1456 |
++ u16 prod_id; |
1457 |
+ u16 val; |
1458 |
+ int err; |
1459 |
+ |
1460 |
+@@ -3008,23 +3015,12 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg) |
1461 |
+ err = chip->info->ops->phy_read(chip, bus, phy, reg, &val); |
1462 |
+ mv88e6xxx_reg_unlock(chip); |
1463 |
+ |
1464 |
+- if (reg == MII_PHYSID2) { |
1465 |
+- /* Some internal PHYs don't have a model number. */ |
1466 |
+- if (chip->info->family != MV88E6XXX_FAMILY_6165) |
1467 |
+- /* Then there is the 6165 family. It gets is |
1468 |
+- * PHYs correct. But it can also have two |
1469 |
+- * SERDES interfaces in the PHY address |
1470 |
+- * space. And these don't have a model |
1471 |
+- * number. But they are not PHYs, so we don't |
1472 |
+- * want to give them something a PHY driver |
1473 |
+- * will recognise. |
1474 |
+- * |
1475 |
+- * Use the mv88e6390 family model number |
1476 |
+- * instead, for anything which really could be |
1477 |
+- * a PHY, |
1478 |
+- */ |
1479 |
+- if (!(val & 0x3f0)) |
1480 |
+- val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >> 4; |
1481 |
++ /* Some internal PHYs don't have a model number. */ |
1482 |
++ if (reg == MII_PHYSID2 && !(val & 0x3f0) && |
1483 |
++ chip->info->family < ARRAY_SIZE(family_prod_id_table)) { |
1484 |
++ prod_id = family_prod_id_table[chip->info->family]; |
1485 |
++ if (prod_id) |
1486 |
++ val |= prod_id >> 4; |
1487 |
+ } |
1488 |
+ |
1489 |
+ return err ? err : val; |
1490 |
+diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c |
1491 |
+index 187b0b9a6e1df..f78daba60b35c 100644 |
1492 |
+--- a/drivers/net/ethernet/amd/pcnet32.c |
1493 |
++++ b/drivers/net/ethernet/amd/pcnet32.c |
1494 |
+@@ -1534,8 +1534,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) |
1495 |
+ } |
1496 |
+ pci_set_master(pdev); |
1497 |
+ |
1498 |
+- ioaddr = pci_resource_start(pdev, 0); |
1499 |
+- if (!ioaddr) { |
1500 |
++ if (!pci_resource_len(pdev, 0)) { |
1501 |
+ if (pcnet32_debug & NETIF_MSG_PROBE) |
1502 |
+ pr_err("card has no PCI IO resources, aborting\n"); |
1503 |
+ err = -ENODEV; |
1504 |
+@@ -1548,6 +1547,8 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) |
1505 |
+ pr_err("architecture does not support 32bit PCI busmaster DMA\n"); |
1506 |
+ goto err_disable_dev; |
1507 |
+ } |
1508 |
++ |
1509 |
++ ioaddr = pci_resource_start(pdev, 0); |
1510 |
+ if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) { |
1511 |
+ if (pcnet32_debug & NETIF_MSG_PROBE) |
1512 |
+ pr_err("io address range already allocated\n"); |
1513 |
+diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c |
1514 |
+index 48a6bda2a8cc7..390f45e49eaf7 100644 |
1515 |
+--- a/drivers/net/ethernet/cadence/macb_main.c |
1516 |
++++ b/drivers/net/ethernet/cadence/macb_main.c |
1517 |
+@@ -3777,6 +3777,7 @@ static int macb_init(struct platform_device *pdev) |
1518 |
+ reg = gem_readl(bp, DCFG8); |
1519 |
+ bp->max_tuples = min((GEM_BFEXT(SCR2CMP, reg) / 3), |
1520 |
+ GEM_BFEXT(T2SCR, reg)); |
1521 |
++ INIT_LIST_HEAD(&bp->rx_fs_list.list); |
1522 |
+ if (bp->max_tuples > 0) { |
1523 |
+ /* also needs one ethtype match to check IPv4 */ |
1524 |
+ if (GEM_BFEXT(SCR2ETH, reg) > 0) { |
1525 |
+@@ -3787,7 +3788,6 @@ static int macb_init(struct platform_device *pdev) |
1526 |
+ /* Filtering is supported in hw but don't enable it in kernel now */ |
1527 |
+ dev->hw_features |= NETIF_F_NTUPLE; |
1528 |
+ /* init Rx flow definitions */ |
1529 |
+- INIT_LIST_HEAD(&bp->rx_fs_list.list); |
1530 |
+ bp->rx_fs_list.count = 0; |
1531 |
+ spin_lock_init(&bp->rx_fs_lock); |
1532 |
+ } else |
1533 |
+diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c |
1534 |
+index 423d6d78d15c7..3a50d5a62aceb 100644 |
1535 |
+--- a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c |
1536 |
++++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c |
1537 |
+@@ -354,18 +354,6 @@ static int chcr_set_tcb_field(struct chcr_ktls_info *tx_info, u16 word, |
1538 |
+ return cxgb4_ofld_send(tx_info->netdev, skb); |
1539 |
+ } |
1540 |
+ |
1541 |
+-/* |
1542 |
+- * chcr_ktls_mark_tcb_close: mark tcb state to CLOSE |
1543 |
+- * @tx_info - driver specific tls info. |
1544 |
+- * return: NET_TX_OK/NET_XMIT_DROP. |
1545 |
+- */ |
1546 |
+-static int chcr_ktls_mark_tcb_close(struct chcr_ktls_info *tx_info) |
1547 |
+-{ |
1548 |
+- return chcr_set_tcb_field(tx_info, TCB_T_STATE_W, |
1549 |
+- TCB_T_STATE_V(TCB_T_STATE_M), |
1550 |
+- CHCR_TCB_STATE_CLOSED, 1); |
1551 |
+-} |
1552 |
+- |
1553 |
+ /* |
1554 |
+ * chcr_ktls_dev_del: call back for tls_dev_del. |
1555 |
+ * Remove the tid and l2t entry and close the connection. |
1556 |
+@@ -400,8 +388,6 @@ static void chcr_ktls_dev_del(struct net_device *netdev, |
1557 |
+ |
1558 |
+ /* clear tid */ |
1559 |
+ if (tx_info->tid != -1) { |
1560 |
+- /* clear tcb state and then release tid */ |
1561 |
+- chcr_ktls_mark_tcb_close(tx_info); |
1562 |
+ cxgb4_remove_tid(&tx_info->adap->tids, tx_info->tx_chan, |
1563 |
+ tx_info->tid, tx_info->ip_family); |
1564 |
+ } |
1565 |
+@@ -579,7 +565,6 @@ static int chcr_ktls_dev_add(struct net_device *netdev, struct sock *sk, |
1566 |
+ return 0; |
1567 |
+ |
1568 |
+ free_tid: |
1569 |
+- chcr_ktls_mark_tcb_close(tx_info); |
1570 |
+ #if IS_ENABLED(CONFIG_IPV6) |
1571 |
+ /* clear clip entry */ |
1572 |
+ if (tx_info->ip_family == AF_INET6) |
1573 |
+@@ -677,10 +662,6 @@ static int chcr_ktls_cpl_act_open_rpl(struct adapter *adap, |
1574 |
+ if (tx_info->pending_close) { |
1575 |
+ spin_unlock(&tx_info->lock); |
1576 |
+ if (!status) { |
1577 |
+- /* it's a late success, tcb status is establised, |
1578 |
+- * mark it close. |
1579 |
+- */ |
1580 |
+- chcr_ktls_mark_tcb_close(tx_info); |
1581 |
+ cxgb4_remove_tid(&tx_info->adap->tids, tx_info->tx_chan, |
1582 |
+ tid, tx_info->ip_family); |
1583 |
+ } |
1584 |
+@@ -1668,54 +1649,6 @@ static void chcr_ktls_copy_record_in_skb(struct sk_buff *nskb, |
1585 |
+ refcount_add(nskb->truesize, &nskb->sk->sk_wmem_alloc); |
1586 |
+ } |
1587 |
+ |
1588 |
+-/* |
1589 |
+- * chcr_ktls_update_snd_una: Reset the SEND_UNA. It will be done to avoid |
1590 |
+- * sending the same segment again. It will discard the segment which is before |
1591 |
+- * the current tx max. |
1592 |
+- * @tx_info - driver specific tls info. |
1593 |
+- * @q - TX queue. |
1594 |
+- * return: NET_TX_OK/NET_XMIT_DROP. |
1595 |
+- */ |
1596 |
+-static int chcr_ktls_update_snd_una(struct chcr_ktls_info *tx_info, |
1597 |
+- struct sge_eth_txq *q) |
1598 |
+-{ |
1599 |
+- struct fw_ulptx_wr *wr; |
1600 |
+- unsigned int ndesc; |
1601 |
+- int credits; |
1602 |
+- void *pos; |
1603 |
+- u32 len; |
1604 |
+- |
1605 |
+- len = sizeof(*wr) + roundup(CHCR_SET_TCB_FIELD_LEN, 16); |
1606 |
+- ndesc = DIV_ROUND_UP(len, 64); |
1607 |
+- |
1608 |
+- credits = chcr_txq_avail(&q->q) - ndesc; |
1609 |
+- if (unlikely(credits < 0)) { |
1610 |
+- chcr_eth_txq_stop(q); |
1611 |
+- return NETDEV_TX_BUSY; |
1612 |
+- } |
1613 |
+- |
1614 |
+- pos = &q->q.desc[q->q.pidx]; |
1615 |
+- |
1616 |
+- wr = pos; |
1617 |
+- /* ULPTX wr */ |
1618 |
+- wr->op_to_compl = htonl(FW_WR_OP_V(FW_ULPTX_WR)); |
1619 |
+- wr->cookie = 0; |
1620 |
+- /* fill len in wr field */ |
1621 |
+- wr->flowid_len16 = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(len, 16))); |
1622 |
+- |
1623 |
+- pos += sizeof(*wr); |
1624 |
+- |
1625 |
+- pos = chcr_write_cpl_set_tcb_ulp(tx_info, q, tx_info->tid, pos, |
1626 |
+- TCB_SND_UNA_RAW_W, |
1627 |
+- TCB_SND_UNA_RAW_V(TCB_SND_UNA_RAW_M), |
1628 |
+- TCB_SND_UNA_RAW_V(0), 0); |
1629 |
+- |
1630 |
+- chcr_txq_advance(&q->q, ndesc); |
1631 |
+- cxgb4_ring_tx_db(tx_info->adap, &q->q, ndesc); |
1632 |
+- |
1633 |
+- return 0; |
1634 |
+-} |
1635 |
+- |
1636 |
+ /* |
1637 |
+ * chcr_end_part_handler: This handler will handle the record which |
1638 |
+ * is complete or if record's end part is received. T6 adapter has a issue that |
1639 |
+@@ -1740,7 +1673,9 @@ static int chcr_end_part_handler(struct chcr_ktls_info *tx_info, |
1640 |
+ struct sge_eth_txq *q, u32 skb_offset, |
1641 |
+ u32 tls_end_offset, bool last_wr) |
1642 |
+ { |
1643 |
++ bool free_skb_if_tx_fails = false; |
1644 |
+ struct sk_buff *nskb = NULL; |
1645 |
++ |
1646 |
+ /* check if it is a complete record */ |
1647 |
+ if (tls_end_offset == record->len) { |
1648 |
+ nskb = skb; |
1649 |
+@@ -1763,6 +1698,8 @@ static int chcr_end_part_handler(struct chcr_ktls_info *tx_info, |
1650 |
+ |
1651 |
+ if (last_wr) |
1652 |
+ dev_kfree_skb_any(skb); |
1653 |
++ else |
1654 |
++ free_skb_if_tx_fails = true; |
1655 |
+ |
1656 |
+ last_wr = true; |
1657 |
+ |
1658 |
+@@ -1774,6 +1711,8 @@ static int chcr_end_part_handler(struct chcr_ktls_info *tx_info, |
1659 |
+ record->num_frags, |
1660 |
+ (last_wr && tcp_push_no_fin), |
1661 |
+ mss)) { |
1662 |
++ if (free_skb_if_tx_fails) |
1663 |
++ dev_kfree_skb_any(skb); |
1664 |
+ goto out; |
1665 |
+ } |
1666 |
+ tx_info->prev_seq = record->end_seq; |
1667 |
+@@ -1910,11 +1849,6 @@ static int chcr_short_record_handler(struct chcr_ktls_info *tx_info, |
1668 |
+ /* reset tcp_seq as per the prior_data_required len */ |
1669 |
+ tcp_seq -= prior_data_len; |
1670 |
+ } |
1671 |
+- /* reset snd una, so the middle record won't send the already |
1672 |
+- * sent part. |
1673 |
+- */ |
1674 |
+- if (chcr_ktls_update_snd_una(tx_info, q)) |
1675 |
+- goto out; |
1676 |
+ atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_middle_pkts); |
1677 |
+ } else { |
1678 |
+ atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_start_pkts); |
1679 |
+@@ -2015,12 +1949,11 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev) |
1680 |
+ * we will send the complete record again. |
1681 |
+ */ |
1682 |
+ |
1683 |
++ spin_lock_irqsave(&tx_ctx->base.lock, flags); |
1684 |
++ |
1685 |
+ do { |
1686 |
+- int i; |
1687 |
+ |
1688 |
+ cxgb4_reclaim_completed_tx(adap, &q->q, true); |
1689 |
+- /* lock taken */ |
1690 |
+- spin_lock_irqsave(&tx_ctx->base.lock, flags); |
1691 |
+ /* fetch the tls record */ |
1692 |
+ record = tls_get_record(&tx_ctx->base, tcp_seq, |
1693 |
+ &tx_info->record_no); |
1694 |
+@@ -2079,11 +2012,11 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev) |
1695 |
+ tls_end_offset, skb_offset, |
1696 |
+ 0); |
1697 |
+ |
1698 |
+- spin_unlock_irqrestore(&tx_ctx->base.lock, flags); |
1699 |
+ if (ret) { |
1700 |
+ /* free the refcount taken earlier */ |
1701 |
+ if (tls_end_offset < data_len) |
1702 |
+ dev_kfree_skb_any(skb); |
1703 |
++ spin_unlock_irqrestore(&tx_ctx->base.lock, flags); |
1704 |
+ goto out; |
1705 |
+ } |
1706 |
+ |
1707 |
+@@ -2093,16 +2026,6 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev) |
1708 |
+ continue; |
1709 |
+ } |
1710 |
+ |
1711 |
+- /* increase page reference count of the record, so that there |
1712 |
+- * won't be any chance of page free in middle if in case stack |
1713 |
+- * receives ACK and try to delete the record. |
1714 |
+- */ |
1715 |
+- for (i = 0; i < record->num_frags; i++) |
1716 |
+- __skb_frag_ref(&record->frags[i]); |
1717 |
+- /* lock cleared */ |
1718 |
+- spin_unlock_irqrestore(&tx_ctx->base.lock, flags); |
1719 |
+- |
1720 |
+- |
1721 |
+ /* if a tls record is finishing in this SKB */ |
1722 |
+ if (tls_end_offset <= data_len) { |
1723 |
+ ret = chcr_end_part_handler(tx_info, skb, record, |
1724 |
+@@ -2127,13 +2050,9 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev) |
1725 |
+ data_len = 0; |
1726 |
+ } |
1727 |
+ |
1728 |
+- /* clear the frag ref count which increased locally before */ |
1729 |
+- for (i = 0; i < record->num_frags; i++) { |
1730 |
+- /* clear the frag ref count */ |
1731 |
+- __skb_frag_unref(&record->frags[i]); |
1732 |
+- } |
1733 |
+ /* if any failure, come out from the loop. */ |
1734 |
+ if (ret) { |
1735 |
++ spin_unlock_irqrestore(&tx_ctx->base.lock, flags); |
1736 |
+ if (th->fin) |
1737 |
+ dev_kfree_skb_any(skb); |
1738 |
+ |
1739 |
+@@ -2148,6 +2067,7 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev) |
1740 |
+ |
1741 |
+ } while (data_len > 0); |
1742 |
+ |
1743 |
++ spin_unlock_irqrestore(&tx_ctx->base.lock, flags); |
1744 |
+ atomic64_inc(&port_stats->ktls_tx_encrypted_packets); |
1745 |
+ atomic64_add(skb_data_len, &port_stats->ktls_tx_encrypted_bytes); |
1746 |
+ |
1747 |
+diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c |
1748 |
+index ae09cac876028..afc4a103c5080 100644 |
1749 |
+--- a/drivers/net/ethernet/davicom/dm9000.c |
1750 |
++++ b/drivers/net/ethernet/davicom/dm9000.c |
1751 |
+@@ -1474,8 +1474,10 @@ dm9000_probe(struct platform_device *pdev) |
1752 |
+ |
1753 |
+ /* Init network device */ |
1754 |
+ ndev = alloc_etherdev(sizeof(struct board_info)); |
1755 |
+- if (!ndev) |
1756 |
+- return -ENOMEM; |
1757 |
++ if (!ndev) { |
1758 |
++ ret = -ENOMEM; |
1759 |
++ goto out_regulator_disable; |
1760 |
++ } |
1761 |
+ |
1762 |
+ SET_NETDEV_DEV(ndev, &pdev->dev); |
1763 |
+ |
1764 |
+diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c |
1765 |
+index 4a4cb62b73320..8cc444684491a 100644 |
1766 |
+--- a/drivers/net/ethernet/ibm/ibmvnic.c |
1767 |
++++ b/drivers/net/ethernet/ibm/ibmvnic.c |
1768 |
+@@ -1159,19 +1159,13 @@ static int __ibmvnic_open(struct net_device *netdev) |
1769 |
+ |
1770 |
+ rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_UP); |
1771 |
+ if (rc) { |
1772 |
+- for (i = 0; i < adapter->req_rx_queues; i++) |
1773 |
+- napi_disable(&adapter->napi[i]); |
1774 |
++ ibmvnic_napi_disable(adapter); |
1775 |
+ release_resources(adapter); |
1776 |
+ return rc; |
1777 |
+ } |
1778 |
+ |
1779 |
+ netif_tx_start_all_queues(netdev); |
1780 |
+ |
1781 |
+- if (prev_state == VNIC_CLOSED) { |
1782 |
+- for (i = 0; i < adapter->req_rx_queues; i++) |
1783 |
+- napi_schedule(&adapter->napi[i]); |
1784 |
+- } |
1785 |
+- |
1786 |
+ adapter->state = VNIC_OPEN; |
1787 |
+ return rc; |
1788 |
+ } |
1789 |
+@@ -1942,7 +1936,7 @@ static int do_reset(struct ibmvnic_adapter *adapter, |
1790 |
+ u64 old_num_rx_queues, old_num_tx_queues; |
1791 |
+ u64 old_num_rx_slots, old_num_tx_slots; |
1792 |
+ struct net_device *netdev = adapter->netdev; |
1793 |
+- int i, rc; |
1794 |
++ int rc; |
1795 |
+ |
1796 |
+ netdev_dbg(adapter->netdev, |
1797 |
+ "[S:%d FOP:%d] Reset reason %d, reset_state %d\n", |
1798 |
+@@ -2088,10 +2082,6 @@ static int do_reset(struct ibmvnic_adapter *adapter, |
1799 |
+ /* refresh device's multicast list */ |
1800 |
+ ibmvnic_set_multi(netdev); |
1801 |
+ |
1802 |
+- /* kick napi */ |
1803 |
+- for (i = 0; i < adapter->req_rx_queues; i++) |
1804 |
+- napi_schedule(&adapter->napi[i]); |
1805 |
+- |
1806 |
+ if (adapter->reset_reason == VNIC_RESET_FAILOVER || |
1807 |
+ adapter->reset_reason == VNIC_RESET_MOBILITY) { |
1808 |
+ call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev); |
1809 |
+diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c |
1810 |
+index 7fab60128c76d..f0edea7cdbccc 100644 |
1811 |
+--- a/drivers/net/ethernet/intel/i40e/i40e_main.c |
1812 |
++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c |
1813 |
+@@ -11863,6 +11863,7 @@ static int i40e_sw_init(struct i40e_pf *pf) |
1814 |
+ { |
1815 |
+ int err = 0; |
1816 |
+ int size; |
1817 |
++ u16 pow; |
1818 |
+ |
1819 |
+ /* Set default capability flags */ |
1820 |
+ pf->flags = I40E_FLAG_RX_CSUM_ENABLED | |
1821 |
+@@ -11881,6 +11882,11 @@ static int i40e_sw_init(struct i40e_pf *pf) |
1822 |
+ pf->rss_table_size = pf->hw.func_caps.rss_table_size; |
1823 |
+ pf->rss_size_max = min_t(int, pf->rss_size_max, |
1824 |
+ pf->hw.func_caps.num_tx_qp); |
1825 |
++ |
1826 |
++ /* find the next higher power-of-2 of num cpus */ |
1827 |
++ pow = roundup_pow_of_two(num_online_cpus()); |
1828 |
++ pf->rss_size_max = min_t(int, pf->rss_size_max, pow); |
1829 |
++ |
1830 |
+ if (pf->hw.func_caps.rss) { |
1831 |
+ pf->flags |= I40E_FLAG_RSS_ENABLED; |
1832 |
+ pf->alloc_rss_size = min_t(int, pf->rss_size_max, |
1833 |
+diff --git a/drivers/net/ethernet/intel/ice/ice_dcb.c b/drivers/net/ethernet/intel/ice/ice_dcb.c |
1834 |
+index 211ac6f907adb..28e834a128c07 100644 |
1835 |
+--- a/drivers/net/ethernet/intel/ice/ice_dcb.c |
1836 |
++++ b/drivers/net/ethernet/intel/ice/ice_dcb.c |
1837 |
+@@ -747,8 +747,8 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg, |
1838 |
+ struct ice_port_info *pi) |
1839 |
+ { |
1840 |
+ u32 status, tlv_status = le32_to_cpu(cee_cfg->tlv_status); |
1841 |
+- u32 ice_aqc_cee_status_mask, ice_aqc_cee_status_shift; |
1842 |
+- u8 i, j, err, sync, oper, app_index, ice_app_sel_type; |
1843 |
++ u32 ice_aqc_cee_status_mask, ice_aqc_cee_status_shift, j; |
1844 |
++ u8 i, err, sync, oper, app_index, ice_app_sel_type; |
1845 |
+ u16 app_prio = le16_to_cpu(cee_cfg->oper_app_prio); |
1846 |
+ u16 ice_aqc_cee_app_mask, ice_aqc_cee_app_shift; |
1847 |
+ struct ice_dcbx_cfg *cmp_dcbcfg, *dcbcfg; |
1848 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1849 |
+index 278fc866fad49..0b9fddbc5db4f 100644 |
1850 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1851 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1852 |
+@@ -6896,6 +6896,11 @@ static int __maybe_unused ixgbe_resume(struct device *dev_d) |
1853 |
+ |
1854 |
+ adapter->hw.hw_addr = adapter->io_addr; |
1855 |
+ |
1856 |
++ err = pci_enable_device_mem(pdev); |
1857 |
++ if (err) { |
1858 |
++ e_dev_err("Cannot enable PCI device from suspend\n"); |
1859 |
++ return err; |
1860 |
++ } |
1861 |
+ smp_mb__before_atomic(); |
1862 |
+ clear_bit(__IXGBE_DISABLED, &adapter->state); |
1863 |
+ pci_set_master(pdev); |
1864 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c |
1865 |
+index 308fd279669ec..89510cac46c22 100644 |
1866 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c |
1867 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c |
1868 |
+@@ -387,21 +387,6 @@ enum mlx5e_fec_supported_link_mode { |
1869 |
+ *_policy = MLX5_GET(pplm_reg, _buf, fec_override_admin_##link); \ |
1870 |
+ } while (0) |
1871 |
+ |
1872 |
+-#define MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(buf, policy, write, link) \ |
1873 |
+- do { \ |
1874 |
+- unsigned long policy_long; \ |
1875 |
+- u16 *__policy = &(policy); \ |
1876 |
+- bool _write = (write); \ |
1877 |
+- \ |
1878 |
+- policy_long = *__policy; \ |
1879 |
+- if (_write && *__policy) \ |
1880 |
+- *__policy = find_first_bit(&policy_long, \ |
1881 |
+- sizeof(policy_long) * BITS_PER_BYTE);\ |
1882 |
+- MLX5E_FEC_OVERRIDE_ADMIN_POLICY(buf, *__policy, _write, link); \ |
1883 |
+- if (!_write && *__policy) \ |
1884 |
+- *__policy = 1 << *__policy; \ |
1885 |
+- } while (0) |
1886 |
+- |
1887 |
+ /* get/set FEC admin field for a given speed */ |
1888 |
+ static int mlx5e_fec_admin_field(u32 *pplm, u16 *fec_policy, bool write, |
1889 |
+ enum mlx5e_fec_supported_link_mode link_mode) |
1890 |
+@@ -423,16 +408,16 @@ static int mlx5e_fec_admin_field(u32 *pplm, u16 *fec_policy, bool write, |
1891 |
+ MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 100g); |
1892 |
+ break; |
1893 |
+ case MLX5E_FEC_SUPPORTED_LINK_MODE_50G_1X: |
1894 |
+- MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(pplm, *fec_policy, write, 50g_1x); |
1895 |
++ MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 50g_1x); |
1896 |
+ break; |
1897 |
+ case MLX5E_FEC_SUPPORTED_LINK_MODE_100G_2X: |
1898 |
+- MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(pplm, *fec_policy, write, 100g_2x); |
1899 |
++ MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 100g_2x); |
1900 |
+ break; |
1901 |
+ case MLX5E_FEC_SUPPORTED_LINK_MODE_200G_4X: |
1902 |
+- MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(pplm, *fec_policy, write, 200g_4x); |
1903 |
++ MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 200g_4x); |
1904 |
+ break; |
1905 |
+ case MLX5E_FEC_SUPPORTED_LINK_MODE_400G_8X: |
1906 |
+- MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(pplm, *fec_policy, write, 400g_8x); |
1907 |
++ MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 400g_8x); |
1908 |
+ break; |
1909 |
+ default: |
1910 |
+ return -EINVAL; |
1911 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |
1912 |
+index 930f19c598bb6..3079a82f1f412 100644 |
1913 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |
1914 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |
1915 |
+@@ -2196,6 +2196,9 @@ static int mlx5e_flower_parse_meta(struct net_device *filter_dev, |
1916 |
+ return 0; |
1917 |
+ |
1918 |
+ flow_rule_match_meta(rule, &match); |
1919 |
++ if (!match.mask->ingress_ifindex) |
1920 |
++ return 0; |
1921 |
++ |
1922 |
+ if (match.mask->ingress_ifindex != 0xFFFFFFFF) { |
1923 |
+ NL_SET_ERR_MSG_MOD(extack, "Unsupported ingress ifindex mask"); |
1924 |
+ return -EOPNOTSUPP; |
1925 |
+diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c |
1926 |
+index d634da20b4f94..3bb36f4a984e8 100644 |
1927 |
+--- a/drivers/net/ethernet/realtek/r8169_main.c |
1928 |
++++ b/drivers/net/ethernet/realtek/r8169_main.c |
1929 |
+@@ -2378,13 +2378,14 @@ static void r8168b_1_hw_jumbo_disable(struct rtl8169_private *tp) |
1930 |
+ static void rtl_jumbo_config(struct rtl8169_private *tp) |
1931 |
+ { |
1932 |
+ bool jumbo = tp->dev->mtu > ETH_DATA_LEN; |
1933 |
++ int readrq = 4096; |
1934 |
+ |
1935 |
+ rtl_unlock_config_regs(tp); |
1936 |
+ switch (tp->mac_version) { |
1937 |
+ case RTL_GIGA_MAC_VER_12: |
1938 |
+ case RTL_GIGA_MAC_VER_17: |
1939 |
+ if (jumbo) { |
1940 |
+- pcie_set_readrq(tp->pci_dev, 512); |
1941 |
++ readrq = 512; |
1942 |
+ r8168b_1_hw_jumbo_enable(tp); |
1943 |
+ } else { |
1944 |
+ r8168b_1_hw_jumbo_disable(tp); |
1945 |
+@@ -2392,7 +2393,7 @@ static void rtl_jumbo_config(struct rtl8169_private *tp) |
1946 |
+ break; |
1947 |
+ case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_26: |
1948 |
+ if (jumbo) { |
1949 |
+- pcie_set_readrq(tp->pci_dev, 512); |
1950 |
++ readrq = 512; |
1951 |
+ r8168c_hw_jumbo_enable(tp); |
1952 |
+ } else { |
1953 |
+ r8168c_hw_jumbo_disable(tp); |
1954 |
+@@ -2417,8 +2418,15 @@ static void rtl_jumbo_config(struct rtl8169_private *tp) |
1955 |
+ } |
1956 |
+ rtl_lock_config_regs(tp); |
1957 |
+ |
1958 |
+- if (!jumbo && pci_is_pcie(tp->pci_dev) && tp->supports_gmii) |
1959 |
+- pcie_set_readrq(tp->pci_dev, 4096); |
1960 |
++ if (pci_is_pcie(tp->pci_dev) && tp->supports_gmii) |
1961 |
++ pcie_set_readrq(tp->pci_dev, readrq); |
1962 |
++ |
1963 |
++ /* Chip doesn't support pause in jumbo mode */ |
1964 |
++ linkmode_mod_bit(ETHTOOL_LINK_MODE_Pause_BIT, |
1965 |
++ tp->phydev->advertising, !jumbo); |
1966 |
++ linkmode_mod_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, |
1967 |
++ tp->phydev->advertising, !jumbo); |
1968 |
++ phy_start_aneg(tp->phydev); |
1969 |
+ } |
1970 |
+ |
1971 |
+ DECLARE_RTL_COND(rtl_chipcmd_cond) |
1972 |
+@@ -4710,8 +4718,6 @@ static int r8169_phy_connect(struct rtl8169_private *tp) |
1973 |
+ if (!tp->supports_gmii) |
1974 |
+ phy_set_max_speed(phydev, SPEED_100); |
1975 |
+ |
1976 |
+- phy_support_asym_pause(phydev); |
1977 |
+- |
1978 |
+ phy_attached_info(phydev); |
1979 |
+ |
1980 |
+ return 0; |
1981 |
+diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c |
1982 |
+index 5dbdaf0f5f09c..823a89354466d 100644 |
1983 |
+--- a/drivers/net/phy/marvell.c |
1984 |
++++ b/drivers/net/phy/marvell.c |
1985 |
+@@ -2913,9 +2913,35 @@ static struct phy_driver marvell_drivers[] = { |
1986 |
+ .get_stats = marvell_get_stats, |
1987 |
+ }, |
1988 |
+ { |
1989 |
+- .phy_id = MARVELL_PHY_ID_88E6390, |
1990 |
++ .phy_id = MARVELL_PHY_ID_88E6341_FAMILY, |
1991 |
+ .phy_id_mask = MARVELL_PHY_ID_MASK, |
1992 |
+- .name = "Marvell 88E6390", |
1993 |
++ .name = "Marvell 88E6341 Family", |
1994 |
++ /* PHY_GBIT_FEATURES */ |
1995 |
++ .flags = PHY_POLL_CABLE_TEST, |
1996 |
++ .probe = m88e1510_probe, |
1997 |
++ .config_init = marvell_config_init, |
1998 |
++ .config_aneg = m88e6390_config_aneg, |
1999 |
++ .read_status = marvell_read_status, |
2000 |
++ .ack_interrupt = marvell_ack_interrupt, |
2001 |
++ .config_intr = marvell_config_intr, |
2002 |
++ .did_interrupt = m88e1121_did_interrupt, |
2003 |
++ .resume = genphy_resume, |
2004 |
++ .suspend = genphy_suspend, |
2005 |
++ .read_page = marvell_read_page, |
2006 |
++ .write_page = marvell_write_page, |
2007 |
++ .get_sset_count = marvell_get_sset_count, |
2008 |
++ .get_strings = marvell_get_strings, |
2009 |
++ .get_stats = marvell_get_stats, |
2010 |
++ .get_tunable = m88e1540_get_tunable, |
2011 |
++ .set_tunable = m88e1540_set_tunable, |
2012 |
++ .cable_test_start = marvell_vct7_cable_test_start, |
2013 |
++ .cable_test_tdr_start = marvell_vct5_cable_test_tdr_start, |
2014 |
++ .cable_test_get_status = marvell_vct7_cable_test_get_status, |
2015 |
++ }, |
2016 |
++ { |
2017 |
++ .phy_id = MARVELL_PHY_ID_88E6390_FAMILY, |
2018 |
++ .phy_id_mask = MARVELL_PHY_ID_MASK, |
2019 |
++ .name = "Marvell 88E6390 Family", |
2020 |
+ /* PHY_GBIT_FEATURES */ |
2021 |
+ .flags = PHY_POLL_CABLE_TEST, |
2022 |
+ .probe = m88e6390_probe, |
2023 |
+@@ -3001,7 +3027,8 @@ static struct mdio_device_id __maybe_unused marvell_tbl[] = { |
2024 |
+ { MARVELL_PHY_ID_88E1540, MARVELL_PHY_ID_MASK }, |
2025 |
+ { MARVELL_PHY_ID_88E1545, MARVELL_PHY_ID_MASK }, |
2026 |
+ { MARVELL_PHY_ID_88E3016, MARVELL_PHY_ID_MASK }, |
2027 |
+- { MARVELL_PHY_ID_88E6390, MARVELL_PHY_ID_MASK }, |
2028 |
++ { MARVELL_PHY_ID_88E6341_FAMILY, MARVELL_PHY_ID_MASK }, |
2029 |
++ { MARVELL_PHY_ID_88E6390_FAMILY, MARVELL_PHY_ID_MASK }, |
2030 |
+ { MARVELL_PHY_ID_88E1340S, MARVELL_PHY_ID_MASK }, |
2031 |
+ { MARVELL_PHY_ID_88E1548P, MARVELL_PHY_ID_MASK }, |
2032 |
+ { } |
2033 |
+diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c |
2034 |
+index fa32f9045c0cb..500fdb0b6c42b 100644 |
2035 |
+--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c |
2036 |
++++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c |
2037 |
+@@ -684,6 +684,7 @@ static const struct iwl_dev_info iwl_dev_info_table[] = { |
2038 |
+ IWL_DEV_INFO(0x4DF0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, NULL), |
2039 |
+ IWL_DEV_INFO(0x4DF0, 0x2074, iwl_ax201_cfg_qu_hr, NULL), |
2040 |
+ IWL_DEV_INFO(0x4DF0, 0x4070, iwl_ax201_cfg_qu_hr, NULL), |
2041 |
++ IWL_DEV_INFO(0x4DF0, 0x6074, iwl_ax201_cfg_qu_hr, NULL), |
2042 |
+ |
2043 |
+ _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, |
2044 |
+ IWL_CFG_MAC_TYPE_PU, IWL_CFG_ANY, |
2045 |
+diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c |
2046 |
+index 50133c09a7805..133371385056d 100644 |
2047 |
+--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c |
2048 |
++++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c |
2049 |
+@@ -1181,6 +1181,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans, |
2050 |
+ u32 cmd_pos; |
2051 |
+ const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD]; |
2052 |
+ u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD]; |
2053 |
++ unsigned long flags; |
2054 |
+ |
2055 |
+ if (WARN(!trans->wide_cmd_header && |
2056 |
+ group_id > IWL_ALWAYS_LONG_GROUP, |
2057 |
+@@ -1264,10 +1265,10 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans, |
2058 |
+ goto free_dup_buf; |
2059 |
+ } |
2060 |
+ |
2061 |
+- spin_lock_bh(&txq->lock); |
2062 |
++ spin_lock_irqsave(&txq->lock, flags); |
2063 |
+ |
2064 |
+ if (iwl_txq_space(trans, txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) { |
2065 |
+- spin_unlock_bh(&txq->lock); |
2066 |
++ spin_unlock_irqrestore(&txq->lock, flags); |
2067 |
+ |
2068 |
+ IWL_ERR(trans, "No space in command queue\n"); |
2069 |
+ iwl_op_mode_cmd_queue_full(trans->op_mode); |
2070 |
+@@ -1427,7 +1428,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans, |
2071 |
+ unlock_reg: |
2072 |
+ spin_unlock(&trans_pcie->reg_lock); |
2073 |
+ out: |
2074 |
+- spin_unlock_bh(&txq->lock); |
2075 |
++ spin_unlock_irqrestore(&txq->lock, flags); |
2076 |
+ free_dup_buf: |
2077 |
+ if (idx < 0) |
2078 |
+ kfree(dup_buf); |
2079 |
+diff --git a/drivers/net/wireless/virt_wifi.c b/drivers/net/wireless/virt_wifi.c |
2080 |
+index c878097f0ddaf..1df959532c7d3 100644 |
2081 |
+--- a/drivers/net/wireless/virt_wifi.c |
2082 |
++++ b/drivers/net/wireless/virt_wifi.c |
2083 |
+@@ -12,6 +12,7 @@ |
2084 |
+ #include <net/cfg80211.h> |
2085 |
+ #include <net/rtnetlink.h> |
2086 |
+ #include <linux/etherdevice.h> |
2087 |
++#include <linux/math64.h> |
2088 |
+ #include <linux/module.h> |
2089 |
+ |
2090 |
+ static struct wiphy *common_wiphy; |
2091 |
+@@ -168,11 +169,11 @@ static void virt_wifi_scan_result(struct work_struct *work) |
2092 |
+ scan_result.work); |
2093 |
+ struct wiphy *wiphy = priv_to_wiphy(priv); |
2094 |
+ struct cfg80211_scan_info scan_info = { .aborted = false }; |
2095 |
++ u64 tsf = div_u64(ktime_get_boottime_ns(), 1000); |
2096 |
+ |
2097 |
+ informed_bss = cfg80211_inform_bss(wiphy, &channel_5ghz, |
2098 |
+ CFG80211_BSS_FTYPE_PRESP, |
2099 |
+- fake_router_bssid, |
2100 |
+- ktime_get_boottime_ns(), |
2101 |
++ fake_router_bssid, tsf, |
2102 |
+ WLAN_CAPABILITY_ESS, 0, |
2103 |
+ (void *)&ssid, sizeof(ssid), |
2104 |
+ DBM_TO_MBM(-50), GFP_KERNEL); |
2105 |
+diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c |
2106 |
+index ef23119db5746..e05cc9f8a9fd1 100644 |
2107 |
+--- a/drivers/nvdimm/region_devs.c |
2108 |
++++ b/drivers/nvdimm/region_devs.c |
2109 |
+@@ -1239,6 +1239,11 @@ int nvdimm_has_flush(struct nd_region *nd_region) |
2110 |
+ || !IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API)) |
2111 |
+ return -ENXIO; |
2112 |
+ |
2113 |
++ /* Test if an explicit flush function is defined */ |
2114 |
++ if (test_bit(ND_REGION_ASYNC, &nd_region->flags) && nd_region->flush) |
2115 |
++ return 1; |
2116 |
++ |
2117 |
++ /* Test if any flush hints for the region are available */ |
2118 |
+ for (i = 0; i < nd_region->ndr_mappings; i++) { |
2119 |
+ struct nd_mapping *nd_mapping = &nd_region->mapping[i]; |
2120 |
+ struct nvdimm *nvdimm = nd_mapping->nvdimm; |
2121 |
+@@ -1249,8 +1254,8 @@ int nvdimm_has_flush(struct nd_region *nd_region) |
2122 |
+ } |
2123 |
+ |
2124 |
+ /* |
2125 |
+- * The platform defines dimm devices without hints, assume |
2126 |
+- * platform persistence mechanism like ADR |
2127 |
++ * The platform defines dimm devices without hints nor explicit flush, |
2128 |
++ * assume platform persistence mechanism like ADR |
2129 |
+ */ |
2130 |
+ return 0; |
2131 |
+ } |
2132 |
+diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c |
2133 |
+index 024e5a550759c..8b9a39077dbab 100644 |
2134 |
+--- a/drivers/scsi/libsas/sas_ata.c |
2135 |
++++ b/drivers/scsi/libsas/sas_ata.c |
2136 |
+@@ -201,18 +201,17 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) |
2137 |
+ memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); |
2138 |
+ task->total_xfer_len = qc->nbytes; |
2139 |
+ task->num_scatter = qc->n_elem; |
2140 |
++ task->data_dir = qc->dma_dir; |
2141 |
++ } else if (qc->tf.protocol == ATA_PROT_NODATA) { |
2142 |
++ task->data_dir = DMA_NONE; |
2143 |
+ } else { |
2144 |
+ for_each_sg(qc->sg, sg, qc->n_elem, si) |
2145 |
+ xfer += sg_dma_len(sg); |
2146 |
+ |
2147 |
+ task->total_xfer_len = xfer; |
2148 |
+ task->num_scatter = si; |
2149 |
+- } |
2150 |
+- |
2151 |
+- if (qc->tf.protocol == ATA_PROT_NODATA) |
2152 |
+- task->data_dir = DMA_NONE; |
2153 |
+- else |
2154 |
+ task->data_dir = qc->dma_dir; |
2155 |
++ } |
2156 |
+ task->scatter = qc->sg; |
2157 |
+ task->ata_task.retry_count = 1; |
2158 |
+ task->task_state_flags = SAS_TASK_STATE_PENDING; |
2159 |
+diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c |
2160 |
+index 1e939a2a387f3..98a34ed10f1a0 100644 |
2161 |
+--- a/drivers/scsi/scsi_transport_srp.c |
2162 |
++++ b/drivers/scsi/scsi_transport_srp.c |
2163 |
+@@ -541,7 +541,7 @@ int srp_reconnect_rport(struct srp_rport *rport) |
2164 |
+ res = mutex_lock_interruptible(&rport->mutex); |
2165 |
+ if (res) |
2166 |
+ goto out; |
2167 |
+- if (rport->state != SRP_RPORT_FAIL_FAST) |
2168 |
++ if (rport->state != SRP_RPORT_FAIL_FAST && rport->state != SRP_RPORT_LOST) |
2169 |
+ /* |
2170 |
+ * sdev state must be SDEV_TRANSPORT_OFFLINE, transition |
2171 |
+ * to SDEV_BLOCK is illegal. Calling scsi_target_unblock() |
2172 |
+diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c |
2173 |
+index 706de3ef94bbf..465f646e33298 100644 |
2174 |
+--- a/drivers/vfio/pci/vfio_pci.c |
2175 |
++++ b/drivers/vfio/pci/vfio_pci.c |
2176 |
+@@ -1658,6 +1658,8 @@ static int vfio_pci_mmap(void *device_data, struct vm_area_struct *vma) |
2177 |
+ |
2178 |
+ index = vma->vm_pgoff >> (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT); |
2179 |
+ |
2180 |
++ if (index >= VFIO_PCI_NUM_REGIONS + vdev->num_regions) |
2181 |
++ return -EINVAL; |
2182 |
+ if (vma->vm_end < vma->vm_start) |
2183 |
+ return -EINVAL; |
2184 |
+ if ((vma->vm_flags & VM_SHARED) == 0) |
2185 |
+@@ -1666,7 +1668,7 @@ static int vfio_pci_mmap(void *device_data, struct vm_area_struct *vma) |
2186 |
+ int regnum = index - VFIO_PCI_NUM_REGIONS; |
2187 |
+ struct vfio_pci_region *region = vdev->region + regnum; |
2188 |
+ |
2189 |
+- if (region && region->ops && region->ops->mmap && |
2190 |
++ if (region->ops && region->ops->mmap && |
2191 |
+ (region->flags & VFIO_REGION_INFO_FLAG_MMAP)) |
2192 |
+ return region->ops->mmap(vdev, region, vma); |
2193 |
+ return -EINVAL; |
2194 |
+diff --git a/fs/readdir.c b/fs/readdir.c |
2195 |
+index 19434b3c982cd..09e8ed7d41614 100644 |
2196 |
+--- a/fs/readdir.c |
2197 |
++++ b/fs/readdir.c |
2198 |
+@@ -150,6 +150,9 @@ static int fillonedir(struct dir_context *ctx, const char *name, int namlen, |
2199 |
+ |
2200 |
+ if (buf->result) |
2201 |
+ return -EINVAL; |
2202 |
++ buf->result = verify_dirent_name(name, namlen); |
2203 |
++ if (buf->result < 0) |
2204 |
++ return buf->result; |
2205 |
+ d_ino = ino; |
2206 |
+ if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) { |
2207 |
+ buf->result = -EOVERFLOW; |
2208 |
+@@ -405,6 +408,9 @@ static int compat_fillonedir(struct dir_context *ctx, const char *name, |
2209 |
+ |
2210 |
+ if (buf->result) |
2211 |
+ return -EINVAL; |
2212 |
++ buf->result = verify_dirent_name(name, namlen); |
2213 |
++ if (buf->result < 0) |
2214 |
++ return buf->result; |
2215 |
+ d_ino = ino; |
2216 |
+ if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) { |
2217 |
+ buf->result = -EOVERFLOW; |
2218 |
+diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h |
2219 |
+index ff7b7607c8cf5..f5cf19d197763 100644 |
2220 |
+--- a/include/linux/marvell_phy.h |
2221 |
++++ b/include/linux/marvell_phy.h |
2222 |
+@@ -25,11 +25,12 @@ |
2223 |
+ #define MARVELL_PHY_ID_88X3310 0x002b09a0 |
2224 |
+ #define MARVELL_PHY_ID_88E2110 0x002b09b0 |
2225 |
+ |
2226 |
+-/* The MV88e6390 Ethernet switch contains embedded PHYs. These PHYs do |
2227 |
++/* These Ethernet switch families contain embedded PHYs, but they do |
2228 |
+ * not have a model ID. So the switch driver traps reads to the ID2 |
2229 |
+ * register and returns the switch family ID |
2230 |
+ */ |
2231 |
+-#define MARVELL_PHY_ID_88E6390 0x01410f90 |
2232 |
++#define MARVELL_PHY_ID_88E6341_FAMILY 0x01410f41 |
2233 |
++#define MARVELL_PHY_ID_88E6390_FAMILY 0x01410f90 |
2234 |
+ |
2235 |
+ #define MARVELL_PHY_FAMILY_ID(id) ((id) >> 4) |
2236 |
+ |
2237 |
+diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h |
2238 |
+index 7d3537c40ec95..26a13294318cf 100644 |
2239 |
+--- a/include/linux/netfilter_arp/arp_tables.h |
2240 |
++++ b/include/linux/netfilter_arp/arp_tables.h |
2241 |
+@@ -52,8 +52,9 @@ extern void *arpt_alloc_initial_table(const struct xt_table *); |
2242 |
+ int arpt_register_table(struct net *net, const struct xt_table *table, |
2243 |
+ const struct arpt_replace *repl, |
2244 |
+ const struct nf_hook_ops *ops, struct xt_table **res); |
2245 |
+-void arpt_unregister_table(struct net *net, struct xt_table *table, |
2246 |
+- const struct nf_hook_ops *ops); |
2247 |
++void arpt_unregister_table(struct net *net, struct xt_table *table); |
2248 |
++void arpt_unregister_table_pre_exit(struct net *net, struct xt_table *table, |
2249 |
++ const struct nf_hook_ops *ops); |
2250 |
+ extern unsigned int arpt_do_table(struct sk_buff *skb, |
2251 |
+ const struct nf_hook_state *state, |
2252 |
+ struct xt_table *table); |
2253 |
+diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h |
2254 |
+index 2f5c4e6ecd8a4..3a956145a25cb 100644 |
2255 |
+--- a/include/linux/netfilter_bridge/ebtables.h |
2256 |
++++ b/include/linux/netfilter_bridge/ebtables.h |
2257 |
+@@ -110,8 +110,9 @@ extern int ebt_register_table(struct net *net, |
2258 |
+ const struct ebt_table *table, |
2259 |
+ const struct nf_hook_ops *ops, |
2260 |
+ struct ebt_table **res); |
2261 |
+-extern void ebt_unregister_table(struct net *net, struct ebt_table *table, |
2262 |
+- const struct nf_hook_ops *); |
2263 |
++extern void ebt_unregister_table(struct net *net, struct ebt_table *table); |
2264 |
++void ebt_unregister_table_pre_exit(struct net *net, const char *tablename, |
2265 |
++ const struct nf_hook_ops *ops); |
2266 |
+ extern unsigned int ebt_do_table(struct sk_buff *skb, |
2267 |
+ const struct nf_hook_state *state, |
2268 |
+ struct ebt_table *table); |
2269 |
+diff --git a/include/uapi/linux/idxd.h b/include/uapi/linux/idxd.h |
2270 |
+index fdcdfe414223e..9d9ecc0f4c383 100644 |
2271 |
+--- a/include/uapi/linux/idxd.h |
2272 |
++++ b/include/uapi/linux/idxd.h |
2273 |
+@@ -187,8 +187,8 @@ struct dsa_completion_record { |
2274 |
+ uint32_t rsvd2:8; |
2275 |
+ }; |
2276 |
+ |
2277 |
+- uint16_t delta_rec_size; |
2278 |
+- uint16_t crc_val; |
2279 |
++ uint32_t delta_rec_size; |
2280 |
++ uint32_t crc_val; |
2281 |
+ |
2282 |
+ /* DIF check & strip */ |
2283 |
+ struct { |
2284 |
+diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c |
2285 |
+index 12cd2997f982a..3370f0d476e97 100644 |
2286 |
+--- a/kernel/bpf/verifier.c |
2287 |
++++ b/kernel/bpf/verifier.c |
2288 |
+@@ -5328,12 +5328,26 @@ static struct bpf_insn_aux_data *cur_aux(struct bpf_verifier_env *env) |
2289 |
+ return &env->insn_aux_data[env->insn_idx]; |
2290 |
+ } |
2291 |
+ |
2292 |
++enum { |
2293 |
++ REASON_BOUNDS = -1, |
2294 |
++ REASON_TYPE = -2, |
2295 |
++ REASON_PATHS = -3, |
2296 |
++ REASON_LIMIT = -4, |
2297 |
++ REASON_STACK = -5, |
2298 |
++}; |
2299 |
++ |
2300 |
+ static int retrieve_ptr_limit(const struct bpf_reg_state *ptr_reg, |
2301 |
+- u32 *ptr_limit, u8 opcode, bool off_is_neg) |
2302 |
++ const struct bpf_reg_state *off_reg, |
2303 |
++ u32 *alu_limit, u8 opcode) |
2304 |
+ { |
2305 |
++ bool off_is_neg = off_reg->smin_value < 0; |
2306 |
+ bool mask_to_left = (opcode == BPF_ADD && off_is_neg) || |
2307 |
+ (opcode == BPF_SUB && !off_is_neg); |
2308 |
+- u32 off, max; |
2309 |
++ u32 off, max = 0, ptr_limit = 0; |
2310 |
++ |
2311 |
++ if (!tnum_is_const(off_reg->var_off) && |
2312 |
++ (off_reg->smin_value < 0) != (off_reg->smax_value < 0)) |
2313 |
++ return REASON_BOUNDS; |
2314 |
+ |
2315 |
+ switch (ptr_reg->type) { |
2316 |
+ case PTR_TO_STACK: |
2317 |
+@@ -5346,22 +5360,27 @@ static int retrieve_ptr_limit(const struct bpf_reg_state *ptr_reg, |
2318 |
+ */ |
2319 |
+ off = ptr_reg->off + ptr_reg->var_off.value; |
2320 |
+ if (mask_to_left) |
2321 |
+- *ptr_limit = MAX_BPF_STACK + off; |
2322 |
++ ptr_limit = MAX_BPF_STACK + off; |
2323 |
+ else |
2324 |
+- *ptr_limit = -off - 1; |
2325 |
+- return *ptr_limit >= max ? -ERANGE : 0; |
2326 |
++ ptr_limit = -off - 1; |
2327 |
++ break; |
2328 |
+ case PTR_TO_MAP_VALUE: |
2329 |
+ max = ptr_reg->map_ptr->value_size; |
2330 |
+ if (mask_to_left) { |
2331 |
+- *ptr_limit = ptr_reg->umax_value + ptr_reg->off; |
2332 |
++ ptr_limit = ptr_reg->umax_value + ptr_reg->off; |
2333 |
+ } else { |
2334 |
+ off = ptr_reg->smin_value + ptr_reg->off; |
2335 |
+- *ptr_limit = ptr_reg->map_ptr->value_size - off - 1; |
2336 |
++ ptr_limit = ptr_reg->map_ptr->value_size - off - 1; |
2337 |
+ } |
2338 |
+- return *ptr_limit >= max ? -ERANGE : 0; |
2339 |
++ break; |
2340 |
+ default: |
2341 |
+- return -EINVAL; |
2342 |
++ return REASON_TYPE; |
2343 |
+ } |
2344 |
++ |
2345 |
++ if (ptr_limit >= max) |
2346 |
++ return REASON_LIMIT; |
2347 |
++ *alu_limit = ptr_limit; |
2348 |
++ return 0; |
2349 |
+ } |
2350 |
+ |
2351 |
+ static bool can_skip_alu_sanitation(const struct bpf_verifier_env *env, |
2352 |
+@@ -5379,7 +5398,7 @@ static int update_alu_sanitation_state(struct bpf_insn_aux_data *aux, |
2353 |
+ if (aux->alu_state && |
2354 |
+ (aux->alu_state != alu_state || |
2355 |
+ aux->alu_limit != alu_limit)) |
2356 |
+- return -EACCES; |
2357 |
++ return REASON_PATHS; |
2358 |
+ |
2359 |
+ /* Corresponding fixup done in fixup_bpf_calls(). */ |
2360 |
+ aux->alu_state = alu_state; |
2361 |
+@@ -5398,14 +5417,20 @@ static int sanitize_val_alu(struct bpf_verifier_env *env, |
2362 |
+ return update_alu_sanitation_state(aux, BPF_ALU_NON_POINTER, 0); |
2363 |
+ } |
2364 |
+ |
2365 |
++static bool sanitize_needed(u8 opcode) |
2366 |
++{ |
2367 |
++ return opcode == BPF_ADD || opcode == BPF_SUB; |
2368 |
++} |
2369 |
++ |
2370 |
+ static int sanitize_ptr_alu(struct bpf_verifier_env *env, |
2371 |
+ struct bpf_insn *insn, |
2372 |
+ const struct bpf_reg_state *ptr_reg, |
2373 |
+- struct bpf_reg_state *dst_reg, |
2374 |
+- bool off_is_neg) |
2375 |
++ const struct bpf_reg_state *off_reg, |
2376 |
++ struct bpf_reg_state *dst_reg) |
2377 |
+ { |
2378 |
+ struct bpf_verifier_state *vstate = env->cur_state; |
2379 |
+ struct bpf_insn_aux_data *aux = cur_aux(env); |
2380 |
++ bool off_is_neg = off_reg->smin_value < 0; |
2381 |
+ bool ptr_is_dst_reg = ptr_reg == dst_reg; |
2382 |
+ u8 opcode = BPF_OP(insn->code); |
2383 |
+ u32 alu_state, alu_limit; |
2384 |
+@@ -5427,7 +5452,7 @@ static int sanitize_ptr_alu(struct bpf_verifier_env *env, |
2385 |
+ alu_state |= ptr_is_dst_reg ? |
2386 |
+ BPF_ALU_SANITIZE_SRC : BPF_ALU_SANITIZE_DST; |
2387 |
+ |
2388 |
+- err = retrieve_ptr_limit(ptr_reg, &alu_limit, opcode, off_is_neg); |
2389 |
++ err = retrieve_ptr_limit(ptr_reg, off_reg, &alu_limit, opcode); |
2390 |
+ if (err < 0) |
2391 |
+ return err; |
2392 |
+ |
2393 |
+@@ -5451,7 +5476,46 @@ do_sim: |
2394 |
+ ret = push_stack(env, env->insn_idx + 1, env->insn_idx, true); |
2395 |
+ if (!ptr_is_dst_reg && ret) |
2396 |
+ *dst_reg = tmp; |
2397 |
+- return !ret ? -EFAULT : 0; |
2398 |
++ return !ret ? REASON_STACK : 0; |
2399 |
++} |
2400 |
++ |
2401 |
++static int sanitize_err(struct bpf_verifier_env *env, |
2402 |
++ const struct bpf_insn *insn, int reason, |
2403 |
++ const struct bpf_reg_state *off_reg, |
2404 |
++ const struct bpf_reg_state *dst_reg) |
2405 |
++{ |
2406 |
++ static const char *err = "pointer arithmetic with it prohibited for !root"; |
2407 |
++ const char *op = BPF_OP(insn->code) == BPF_ADD ? "add" : "sub"; |
2408 |
++ u32 dst = insn->dst_reg, src = insn->src_reg; |
2409 |
++ |
2410 |
++ switch (reason) { |
2411 |
++ case REASON_BOUNDS: |
2412 |
++ verbose(env, "R%d has unknown scalar with mixed signed bounds, %s\n", |
2413 |
++ off_reg == dst_reg ? dst : src, err); |
2414 |
++ break; |
2415 |
++ case REASON_TYPE: |
2416 |
++ verbose(env, "R%d has pointer with unsupported alu operation, %s\n", |
2417 |
++ off_reg == dst_reg ? src : dst, err); |
2418 |
++ break; |
2419 |
++ case REASON_PATHS: |
2420 |
++ verbose(env, "R%d tried to %s from different maps, paths or scalars, %s\n", |
2421 |
++ dst, op, err); |
2422 |
++ break; |
2423 |
++ case REASON_LIMIT: |
2424 |
++ verbose(env, "R%d tried to %s beyond pointer bounds, %s\n", |
2425 |
++ dst, op, err); |
2426 |
++ break; |
2427 |
++ case REASON_STACK: |
2428 |
++ verbose(env, "R%d could not be pushed for speculative verification, %s\n", |
2429 |
++ dst, err); |
2430 |
++ break; |
2431 |
++ default: |
2432 |
++ verbose(env, "verifier internal error: unknown reason (%d)\n", |
2433 |
++ reason); |
2434 |
++ break; |
2435 |
++ } |
2436 |
++ |
2437 |
++ return -EACCES; |
2438 |
+ } |
2439 |
+ |
2440 |
+ /* Handles arithmetic on a pointer and a scalar: computes new min/max and var_off. |
2441 |
+@@ -5472,8 +5536,8 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, |
2442 |
+ smin_ptr = ptr_reg->smin_value, smax_ptr = ptr_reg->smax_value; |
2443 |
+ u64 umin_val = off_reg->umin_value, umax_val = off_reg->umax_value, |
2444 |
+ umin_ptr = ptr_reg->umin_value, umax_ptr = ptr_reg->umax_value; |
2445 |
+- u32 dst = insn->dst_reg, src = insn->src_reg; |
2446 |
+ u8 opcode = BPF_OP(insn->code); |
2447 |
++ u32 dst = insn->dst_reg; |
2448 |
+ int ret; |
2449 |
+ |
2450 |
+ dst_reg = ®s[dst]; |
2451 |
+@@ -5521,13 +5585,6 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, |
2452 |
+ verbose(env, "R%d pointer arithmetic on %s prohibited\n", |
2453 |
+ dst, reg_type_str[ptr_reg->type]); |
2454 |
+ return -EACCES; |
2455 |
+- case PTR_TO_MAP_VALUE: |
2456 |
+- if (!env->allow_ptr_leaks && !known && (smin_val < 0) != (smax_val < 0)) { |
2457 |
+- verbose(env, "R%d has unknown scalar with mixed signed bounds, pointer arithmetic with it prohibited for !root\n", |
2458 |
+- off_reg == dst_reg ? dst : src); |
2459 |
+- return -EACCES; |
2460 |
+- } |
2461 |
+- fallthrough; |
2462 |
+ default: |
2463 |
+ break; |
2464 |
+ } |
2465 |
+@@ -5547,11 +5604,10 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, |
2466 |
+ |
2467 |
+ switch (opcode) { |
2468 |
+ case BPF_ADD: |
2469 |
+- ret = sanitize_ptr_alu(env, insn, ptr_reg, dst_reg, smin_val < 0); |
2470 |
+- if (ret < 0) { |
2471 |
+- verbose(env, "R%d tried to add from different maps, paths, or prohibited types\n", dst); |
2472 |
+- return ret; |
2473 |
+- } |
2474 |
++ ret = sanitize_ptr_alu(env, insn, ptr_reg, off_reg, dst_reg); |
2475 |
++ if (ret < 0) |
2476 |
++ return sanitize_err(env, insn, ret, off_reg, dst_reg); |
2477 |
++ |
2478 |
+ /* We can take a fixed offset as long as it doesn't overflow |
2479 |
+ * the s32 'off' field |
2480 |
+ */ |
2481 |
+@@ -5602,11 +5658,10 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, |
2482 |
+ } |
2483 |
+ break; |
2484 |
+ case BPF_SUB: |
2485 |
+- ret = sanitize_ptr_alu(env, insn, ptr_reg, dst_reg, smin_val < 0); |
2486 |
+- if (ret < 0) { |
2487 |
+- verbose(env, "R%d tried to sub from different maps, paths, or prohibited types\n", dst); |
2488 |
+- return ret; |
2489 |
+- } |
2490 |
++ ret = sanitize_ptr_alu(env, insn, ptr_reg, off_reg, dst_reg); |
2491 |
++ if (ret < 0) |
2492 |
++ return sanitize_err(env, insn, ret, off_reg, dst_reg); |
2493 |
++ |
2494 |
+ if (dst_reg == off_reg) { |
2495 |
+ /* scalar -= pointer. Creates an unknown scalar */ |
2496 |
+ verbose(env, "R%d tried to subtract pointer from scalar\n", |
2497 |
+@@ -6296,9 +6351,8 @@ static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, |
2498 |
+ s32 s32_min_val, s32_max_val; |
2499 |
+ u32 u32_min_val, u32_max_val; |
2500 |
+ u64 insn_bitness = (BPF_CLASS(insn->code) == BPF_ALU64) ? 64 : 32; |
2501 |
+- u32 dst = insn->dst_reg; |
2502 |
+- int ret; |
2503 |
+ bool alu32 = (BPF_CLASS(insn->code) != BPF_ALU64); |
2504 |
++ int ret; |
2505 |
+ |
2506 |
+ smin_val = src_reg.smin_value; |
2507 |
+ smax_val = src_reg.smax_value; |
2508 |
+@@ -6340,6 +6394,12 @@ static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, |
2509 |
+ return 0; |
2510 |
+ } |
2511 |
+ |
2512 |
++ if (sanitize_needed(opcode)) { |
2513 |
++ ret = sanitize_val_alu(env, insn); |
2514 |
++ if (ret < 0) |
2515 |
++ return sanitize_err(env, insn, ret, NULL, NULL); |
2516 |
++ } |
2517 |
++ |
2518 |
+ /* Calculate sign/unsigned bounds and tnum for alu32 and alu64 bit ops. |
2519 |
+ * There are two classes of instructions: The first class we track both |
2520 |
+ * alu32 and alu64 sign/unsigned bounds independently this provides the |
2521 |
+@@ -6356,21 +6416,11 @@ static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, |
2522 |
+ */ |
2523 |
+ switch (opcode) { |
2524 |
+ case BPF_ADD: |
2525 |
+- ret = sanitize_val_alu(env, insn); |
2526 |
+- if (ret < 0) { |
2527 |
+- verbose(env, "R%d tried to add from different pointers or scalars\n", dst); |
2528 |
+- return ret; |
2529 |
+- } |
2530 |
+ scalar32_min_max_add(dst_reg, &src_reg); |
2531 |
+ scalar_min_max_add(dst_reg, &src_reg); |
2532 |
+ dst_reg->var_off = tnum_add(dst_reg->var_off, src_reg.var_off); |
2533 |
+ break; |
2534 |
+ case BPF_SUB: |
2535 |
+- ret = sanitize_val_alu(env, insn); |
2536 |
+- if (ret < 0) { |
2537 |
+- verbose(env, "R%d tried to sub from different pointers or scalars\n", dst); |
2538 |
+- return ret; |
2539 |
+- } |
2540 |
+ scalar32_min_max_sub(dst_reg, &src_reg); |
2541 |
+ scalar_min_max_sub(dst_reg, &src_reg); |
2542 |
+ dst_reg->var_off = tnum_sub(dst_reg->var_off, src_reg.var_off); |
2543 |
+diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c |
2544 |
+index eead7efbe7e5d..38d7c03e694cd 100644 |
2545 |
+--- a/kernel/locking/lockdep.c |
2546 |
++++ b/kernel/locking/lockdep.c |
2547 |
+@@ -930,7 +930,8 @@ static bool assign_lock_key(struct lockdep_map *lock) |
2548 |
+ /* Debug-check: all keys must be persistent! */ |
2549 |
+ debug_locks_off(); |
2550 |
+ pr_err("INFO: trying to register non-static key.\n"); |
2551 |
+- pr_err("the code is fine but needs lockdep annotation.\n"); |
2552 |
++ pr_err("The code is fine but needs lockdep annotation, or maybe\n"); |
2553 |
++ pr_err("you didn't initialize this object before use?\n"); |
2554 |
+ pr_err("turning off the locking correctness validator.\n"); |
2555 |
+ dump_stack(); |
2556 |
+ return false; |
2557 |
+diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug |
2558 |
+index c789b39ed5271..dcf4a9028e165 100644 |
2559 |
+--- a/lib/Kconfig.debug |
2560 |
++++ b/lib/Kconfig.debug |
2561 |
+@@ -1302,7 +1302,7 @@ config LOCKDEP |
2562 |
+ bool |
2563 |
+ depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT |
2564 |
+ select STACKTRACE |
2565 |
+- select FRAME_POINTER if !MIPS && !PPC && !ARM && !S390 && !MICROBLAZE && !ARC && !X86 |
2566 |
++ depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86 |
2567 |
+ select KALLSYMS |
2568 |
+ select KALLSYMS_ALL |
2569 |
+ |
2570 |
+@@ -1596,7 +1596,7 @@ config LATENCYTOP |
2571 |
+ depends on DEBUG_KERNEL |
2572 |
+ depends on STACKTRACE_SUPPORT |
2573 |
+ depends on PROC_FS |
2574 |
+- select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86 |
2575 |
++ depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86 |
2576 |
+ select KALLSYMS |
2577 |
+ select KALLSYMS_ALL |
2578 |
+ select STACKTRACE |
2579 |
+@@ -1849,7 +1849,7 @@ config FAULT_INJECTION_STACKTRACE_FILTER |
2580 |
+ depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT |
2581 |
+ depends on !X86_64 |
2582 |
+ select STACKTRACE |
2583 |
+- select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86 |
2584 |
++ depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86 |
2585 |
+ help |
2586 |
+ Provide stacktrace filter for fault-injection capabilities |
2587 |
+ |
2588 |
+diff --git a/mm/ptdump.c b/mm/ptdump.c |
2589 |
+index ba88ec43ff218..93f2f63dc52dc 100644 |
2590 |
+--- a/mm/ptdump.c |
2591 |
++++ b/mm/ptdump.c |
2592 |
+@@ -108,7 +108,7 @@ static int ptdump_pte_entry(pte_t *pte, unsigned long addr, |
2593 |
+ unsigned long next, struct mm_walk *walk) |
2594 |
+ { |
2595 |
+ struct ptdump_state *st = walk->private; |
2596 |
+- pte_t val = READ_ONCE(*pte); |
2597 |
++ pte_t val = ptep_get(pte); |
2598 |
+ |
2599 |
+ if (st->effective_prot) |
2600 |
+ st->effective_prot(st, 4, pte_val(val)); |
2601 |
+diff --git a/net/bridge/netfilter/ebtable_broute.c b/net/bridge/netfilter/ebtable_broute.c |
2602 |
+index 66e7af1654943..32bc2821027f3 100644 |
2603 |
+--- a/net/bridge/netfilter/ebtable_broute.c |
2604 |
++++ b/net/bridge/netfilter/ebtable_broute.c |
2605 |
+@@ -105,14 +105,20 @@ static int __net_init broute_net_init(struct net *net) |
2606 |
+ &net->xt.broute_table); |
2607 |
+ } |
2608 |
+ |
2609 |
++static void __net_exit broute_net_pre_exit(struct net *net) |
2610 |
++{ |
2611 |
++ ebt_unregister_table_pre_exit(net, "broute", &ebt_ops_broute); |
2612 |
++} |
2613 |
++ |
2614 |
+ static void __net_exit broute_net_exit(struct net *net) |
2615 |
+ { |
2616 |
+- ebt_unregister_table(net, net->xt.broute_table, &ebt_ops_broute); |
2617 |
++ ebt_unregister_table(net, net->xt.broute_table); |
2618 |
+ } |
2619 |
+ |
2620 |
+ static struct pernet_operations broute_net_ops = { |
2621 |
+ .init = broute_net_init, |
2622 |
+ .exit = broute_net_exit, |
2623 |
++ .pre_exit = broute_net_pre_exit, |
2624 |
+ }; |
2625 |
+ |
2626 |
+ static int __init ebtable_broute_init(void) |
2627 |
+diff --git a/net/bridge/netfilter/ebtable_filter.c b/net/bridge/netfilter/ebtable_filter.c |
2628 |
+index 78cb9b21022d0..bcf982e12f16b 100644 |
2629 |
+--- a/net/bridge/netfilter/ebtable_filter.c |
2630 |
++++ b/net/bridge/netfilter/ebtable_filter.c |
2631 |
+@@ -99,14 +99,20 @@ static int __net_init frame_filter_net_init(struct net *net) |
2632 |
+ &net->xt.frame_filter); |
2633 |
+ } |
2634 |
+ |
2635 |
++static void __net_exit frame_filter_net_pre_exit(struct net *net) |
2636 |
++{ |
2637 |
++ ebt_unregister_table_pre_exit(net, "filter", ebt_ops_filter); |
2638 |
++} |
2639 |
++ |
2640 |
+ static void __net_exit frame_filter_net_exit(struct net *net) |
2641 |
+ { |
2642 |
+- ebt_unregister_table(net, net->xt.frame_filter, ebt_ops_filter); |
2643 |
++ ebt_unregister_table(net, net->xt.frame_filter); |
2644 |
+ } |
2645 |
+ |
2646 |
+ static struct pernet_operations frame_filter_net_ops = { |
2647 |
+ .init = frame_filter_net_init, |
2648 |
+ .exit = frame_filter_net_exit, |
2649 |
++ .pre_exit = frame_filter_net_pre_exit, |
2650 |
+ }; |
2651 |
+ |
2652 |
+ static int __init ebtable_filter_init(void) |
2653 |
+diff --git a/net/bridge/netfilter/ebtable_nat.c b/net/bridge/netfilter/ebtable_nat.c |
2654 |
+index 0888936ef8537..0d092773f8161 100644 |
2655 |
+--- a/net/bridge/netfilter/ebtable_nat.c |
2656 |
++++ b/net/bridge/netfilter/ebtable_nat.c |
2657 |
+@@ -99,14 +99,20 @@ static int __net_init frame_nat_net_init(struct net *net) |
2658 |
+ &net->xt.frame_nat); |
2659 |
+ } |
2660 |
+ |
2661 |
++static void __net_exit frame_nat_net_pre_exit(struct net *net) |
2662 |
++{ |
2663 |
++ ebt_unregister_table_pre_exit(net, "nat", ebt_ops_nat); |
2664 |
++} |
2665 |
++ |
2666 |
+ static void __net_exit frame_nat_net_exit(struct net *net) |
2667 |
+ { |
2668 |
+- ebt_unregister_table(net, net->xt.frame_nat, ebt_ops_nat); |
2669 |
++ ebt_unregister_table(net, net->xt.frame_nat); |
2670 |
+ } |
2671 |
+ |
2672 |
+ static struct pernet_operations frame_nat_net_ops = { |
2673 |
+ .init = frame_nat_net_init, |
2674 |
+ .exit = frame_nat_net_exit, |
2675 |
++ .pre_exit = frame_nat_net_pre_exit, |
2676 |
+ }; |
2677 |
+ |
2678 |
+ static int __init ebtable_nat_init(void) |
2679 |
+diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c |
2680 |
+index ebe33b60efd6b..d481ff24a1501 100644 |
2681 |
+--- a/net/bridge/netfilter/ebtables.c |
2682 |
++++ b/net/bridge/netfilter/ebtables.c |
2683 |
+@@ -1232,10 +1232,34 @@ out: |
2684 |
+ return ret; |
2685 |
+ } |
2686 |
+ |
2687 |
+-void ebt_unregister_table(struct net *net, struct ebt_table *table, |
2688 |
+- const struct nf_hook_ops *ops) |
2689 |
++static struct ebt_table *__ebt_find_table(struct net *net, const char *name) |
2690 |
++{ |
2691 |
++ struct ebt_table *t; |
2692 |
++ |
2693 |
++ mutex_lock(&ebt_mutex); |
2694 |
++ |
2695 |
++ list_for_each_entry(t, &net->xt.tables[NFPROTO_BRIDGE], list) { |
2696 |
++ if (strcmp(t->name, name) == 0) { |
2697 |
++ mutex_unlock(&ebt_mutex); |
2698 |
++ return t; |
2699 |
++ } |
2700 |
++ } |
2701 |
++ |
2702 |
++ mutex_unlock(&ebt_mutex); |
2703 |
++ return NULL; |
2704 |
++} |
2705 |
++ |
2706 |
++void ebt_unregister_table_pre_exit(struct net *net, const char *name, const struct nf_hook_ops *ops) |
2707 |
++{ |
2708 |
++ struct ebt_table *table = __ebt_find_table(net, name); |
2709 |
++ |
2710 |
++ if (table) |
2711 |
++ nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks)); |
2712 |
++} |
2713 |
++EXPORT_SYMBOL(ebt_unregister_table_pre_exit); |
2714 |
++ |
2715 |
++void ebt_unregister_table(struct net *net, struct ebt_table *table) |
2716 |
+ { |
2717 |
+- nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks)); |
2718 |
+ __ebt_unregister_table(net, table); |
2719 |
+ } |
2720 |
+ |
2721 |
+diff --git a/net/core/dev.c b/net/core/dev.c |
2722 |
+index 62ff7121b22d3..64f4c7ec729dc 100644 |
2723 |
+--- a/net/core/dev.c |
2724 |
++++ b/net/core/dev.c |
2725 |
+@@ -5867,7 +5867,8 @@ static void skb_gro_reset_offset(struct sk_buff *skb) |
2726 |
+ NAPI_GRO_CB(skb)->frag0_len = 0; |
2727 |
+ |
2728 |
+ if (!skb_headlen(skb) && pinfo->nr_frags && |
2729 |
+- !PageHighMem(skb_frag_page(frag0))) { |
2730 |
++ !PageHighMem(skb_frag_page(frag0)) && |
2731 |
++ (!NET_IP_ALIGN || !(skb_frag_off(frag0) & 3))) { |
2732 |
+ NAPI_GRO_CB(skb)->frag0 = skb_frag_address(frag0); |
2733 |
+ NAPI_GRO_CB(skb)->frag0_len = min_t(unsigned int, |
2734 |
+ skb_frag_size(frag0), |
2735 |
+diff --git a/net/core/neighbour.c b/net/core/neighbour.c |
2736 |
+index 2fe4bbb6b80cf..8339978d46ff8 100644 |
2737 |
+--- a/net/core/neighbour.c |
2738 |
++++ b/net/core/neighbour.c |
2739 |
+@@ -1380,7 +1380,7 @@ static int __neigh_update(struct neighbour *neigh, const u8 *lladdr, |
2740 |
+ * we can reinject the packet there. |
2741 |
+ */ |
2742 |
+ n2 = NULL; |
2743 |
+- if (dst) { |
2744 |
++ if (dst && dst->obsolete != DST_OBSOLETE_DEAD) { |
2745 |
+ n2 = dst_neigh_lookup_skb(dst, skb); |
2746 |
+ if (n2) |
2747 |
+ n1 = n2; |
2748 |
+diff --git a/net/ethtool/pause.c b/net/ethtool/pause.c |
2749 |
+index 09998dc5c185f..d4ac02718b72a 100644 |
2750 |
+--- a/net/ethtool/pause.c |
2751 |
++++ b/net/ethtool/pause.c |
2752 |
+@@ -38,16 +38,16 @@ static int pause_prepare_data(const struct ethnl_req_info *req_base, |
2753 |
+ if (!dev->ethtool_ops->get_pauseparam) |
2754 |
+ return -EOPNOTSUPP; |
2755 |
+ |
2756 |
++ ethtool_stats_init((u64 *)&data->pausestat, |
2757 |
++ sizeof(data->pausestat) / 8); |
2758 |
++ |
2759 |
+ ret = ethnl_ops_begin(dev); |
2760 |
+ if (ret < 0) |
2761 |
+ return ret; |
2762 |
+ dev->ethtool_ops->get_pauseparam(dev, &data->pauseparam); |
2763 |
+ if (req_base->flags & ETHTOOL_FLAG_STATS && |
2764 |
+- dev->ethtool_ops->get_pause_stats) { |
2765 |
+- ethtool_stats_init((u64 *)&data->pausestat, |
2766 |
+- sizeof(data->pausestat) / 8); |
2767 |
++ dev->ethtool_ops->get_pause_stats) |
2768 |
+ dev->ethtool_ops->get_pause_stats(dev, &data->pausestat); |
2769 |
+- } |
2770 |
+ ethnl_ops_complete(dev); |
2771 |
+ |
2772 |
+ return 0; |
2773 |
+diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c |
2774 |
+index d1b6a9665b170..f0b47d43c9f6e 100644 |
2775 |
+--- a/net/ieee802154/nl802154.c |
2776 |
++++ b/net/ieee802154/nl802154.c |
2777 |
+@@ -1498,6 +1498,11 @@ nl802154_dump_llsec_key(struct sk_buff *skb, struct netlink_callback *cb) |
2778 |
+ if (err) |
2779 |
+ return err; |
2780 |
+ |
2781 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) { |
2782 |
++ err = skb->len; |
2783 |
++ goto out_err; |
2784 |
++ } |
2785 |
++ |
2786 |
+ if (!wpan_dev->netdev) { |
2787 |
+ err = -EINVAL; |
2788 |
+ goto out_err; |
2789 |
+@@ -1552,6 +1557,9 @@ static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info) |
2790 |
+ struct ieee802154_llsec_key_id id = { }; |
2791 |
+ u32 commands[NL802154_CMD_FRAME_NR_IDS / 32] = { }; |
2792 |
+ |
2793 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) |
2794 |
++ return -EOPNOTSUPP; |
2795 |
++ |
2796 |
+ if (!info->attrs[NL802154_ATTR_SEC_KEY] || |
2797 |
+ nla_parse_nested_deprecated(attrs, NL802154_KEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_KEY], nl802154_key_policy, info->extack)) |
2798 |
+ return -EINVAL; |
2799 |
+@@ -1601,6 +1609,9 @@ static int nl802154_del_llsec_key(struct sk_buff *skb, struct genl_info *info) |
2800 |
+ struct nlattr *attrs[NL802154_KEY_ATTR_MAX + 1]; |
2801 |
+ struct ieee802154_llsec_key_id id; |
2802 |
+ |
2803 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) |
2804 |
++ return -EOPNOTSUPP; |
2805 |
++ |
2806 |
+ if (!info->attrs[NL802154_ATTR_SEC_KEY] || |
2807 |
+ nla_parse_nested_deprecated(attrs, NL802154_KEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_KEY], nl802154_key_policy, info->extack)) |
2808 |
+ return -EINVAL; |
2809 |
+@@ -1666,6 +1677,11 @@ nl802154_dump_llsec_dev(struct sk_buff *skb, struct netlink_callback *cb) |
2810 |
+ if (err) |
2811 |
+ return err; |
2812 |
+ |
2813 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) { |
2814 |
++ err = skb->len; |
2815 |
++ goto out_err; |
2816 |
++ } |
2817 |
++ |
2818 |
+ if (!wpan_dev->netdev) { |
2819 |
+ err = -EINVAL; |
2820 |
+ goto out_err; |
2821 |
+@@ -1752,6 +1768,9 @@ static int nl802154_add_llsec_dev(struct sk_buff *skb, struct genl_info *info) |
2822 |
+ struct wpan_dev *wpan_dev = dev->ieee802154_ptr; |
2823 |
+ struct ieee802154_llsec_device dev_desc; |
2824 |
+ |
2825 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) |
2826 |
++ return -EOPNOTSUPP; |
2827 |
++ |
2828 |
+ if (ieee802154_llsec_parse_device(info->attrs[NL802154_ATTR_SEC_DEVICE], |
2829 |
+ &dev_desc) < 0) |
2830 |
+ return -EINVAL; |
2831 |
+@@ -1767,6 +1786,9 @@ static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info) |
2832 |
+ struct nlattr *attrs[NL802154_DEV_ATTR_MAX + 1]; |
2833 |
+ __le64 extended_addr; |
2834 |
+ |
2835 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) |
2836 |
++ return -EOPNOTSUPP; |
2837 |
++ |
2838 |
+ if (!info->attrs[NL802154_ATTR_SEC_DEVICE] || |
2839 |
+ nla_parse_nested_deprecated(attrs, NL802154_DEV_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVICE], nl802154_dev_policy, info->extack)) |
2840 |
+ return -EINVAL; |
2841 |
+@@ -1836,6 +1858,11 @@ nl802154_dump_llsec_devkey(struct sk_buff *skb, struct netlink_callback *cb) |
2842 |
+ if (err) |
2843 |
+ return err; |
2844 |
+ |
2845 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) { |
2846 |
++ err = skb->len; |
2847 |
++ goto out_err; |
2848 |
++ } |
2849 |
++ |
2850 |
+ if (!wpan_dev->netdev) { |
2851 |
+ err = -EINVAL; |
2852 |
+ goto out_err; |
2853 |
+@@ -1893,6 +1920,9 @@ static int nl802154_add_llsec_devkey(struct sk_buff *skb, struct genl_info *info |
2854 |
+ struct ieee802154_llsec_device_key key; |
2855 |
+ __le64 extended_addr; |
2856 |
+ |
2857 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) |
2858 |
++ return -EOPNOTSUPP; |
2859 |
++ |
2860 |
+ if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] || |
2861 |
+ nla_parse_nested_deprecated(attrs, NL802154_DEVKEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVKEY], nl802154_devkey_policy, info->extack) < 0) |
2862 |
+ return -EINVAL; |
2863 |
+@@ -1924,6 +1954,9 @@ static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *info |
2864 |
+ struct ieee802154_llsec_device_key key; |
2865 |
+ __le64 extended_addr; |
2866 |
+ |
2867 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) |
2868 |
++ return -EOPNOTSUPP; |
2869 |
++ |
2870 |
+ if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] || |
2871 |
+ nla_parse_nested_deprecated(attrs, NL802154_DEVKEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVKEY], nl802154_devkey_policy, info->extack)) |
2872 |
+ return -EINVAL; |
2873 |
+@@ -1998,6 +2031,11 @@ nl802154_dump_llsec_seclevel(struct sk_buff *skb, struct netlink_callback *cb) |
2874 |
+ if (err) |
2875 |
+ return err; |
2876 |
+ |
2877 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) { |
2878 |
++ err = skb->len; |
2879 |
++ goto out_err; |
2880 |
++ } |
2881 |
++ |
2882 |
+ if (!wpan_dev->netdev) { |
2883 |
+ err = -EINVAL; |
2884 |
+ goto out_err; |
2885 |
+@@ -2082,6 +2120,9 @@ static int nl802154_add_llsec_seclevel(struct sk_buff *skb, |
2886 |
+ struct wpan_dev *wpan_dev = dev->ieee802154_ptr; |
2887 |
+ struct ieee802154_llsec_seclevel sl; |
2888 |
+ |
2889 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) |
2890 |
++ return -EOPNOTSUPP; |
2891 |
++ |
2892 |
+ if (llsec_parse_seclevel(info->attrs[NL802154_ATTR_SEC_LEVEL], |
2893 |
+ &sl) < 0) |
2894 |
+ return -EINVAL; |
2895 |
+diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c |
2896 |
+index e0093411d85d6..d6d45d820d79a 100644 |
2897 |
+--- a/net/ipv4/netfilter/arp_tables.c |
2898 |
++++ b/net/ipv4/netfilter/arp_tables.c |
2899 |
+@@ -1541,10 +1541,15 @@ out_free: |
2900 |
+ return ret; |
2901 |
+ } |
2902 |
+ |
2903 |
+-void arpt_unregister_table(struct net *net, struct xt_table *table, |
2904 |
+- const struct nf_hook_ops *ops) |
2905 |
++void arpt_unregister_table_pre_exit(struct net *net, struct xt_table *table, |
2906 |
++ const struct nf_hook_ops *ops) |
2907 |
+ { |
2908 |
+ nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks)); |
2909 |
++} |
2910 |
++EXPORT_SYMBOL(arpt_unregister_table_pre_exit); |
2911 |
++ |
2912 |
++void arpt_unregister_table(struct net *net, struct xt_table *table) |
2913 |
++{ |
2914 |
+ __arpt_unregister_table(net, table); |
2915 |
+ } |
2916 |
+ |
2917 |
+diff --git a/net/ipv4/netfilter/arptable_filter.c b/net/ipv4/netfilter/arptable_filter.c |
2918 |
+index c216b9ad3bb24..6c300ba5634e2 100644 |
2919 |
+--- a/net/ipv4/netfilter/arptable_filter.c |
2920 |
++++ b/net/ipv4/netfilter/arptable_filter.c |
2921 |
+@@ -56,16 +56,24 @@ static int __net_init arptable_filter_table_init(struct net *net) |
2922 |
+ return err; |
2923 |
+ } |
2924 |
+ |
2925 |
++static void __net_exit arptable_filter_net_pre_exit(struct net *net) |
2926 |
++{ |
2927 |
++ if (net->ipv4.arptable_filter) |
2928 |
++ arpt_unregister_table_pre_exit(net, net->ipv4.arptable_filter, |
2929 |
++ arpfilter_ops); |
2930 |
++} |
2931 |
++ |
2932 |
+ static void __net_exit arptable_filter_net_exit(struct net *net) |
2933 |
+ { |
2934 |
+ if (!net->ipv4.arptable_filter) |
2935 |
+ return; |
2936 |
+- arpt_unregister_table(net, net->ipv4.arptable_filter, arpfilter_ops); |
2937 |
++ arpt_unregister_table(net, net->ipv4.arptable_filter); |
2938 |
+ net->ipv4.arptable_filter = NULL; |
2939 |
+ } |
2940 |
+ |
2941 |
+ static struct pernet_operations arptable_filter_net_ops = { |
2942 |
+ .exit = arptable_filter_net_exit, |
2943 |
++ .pre_exit = arptable_filter_net_pre_exit, |
2944 |
+ }; |
2945 |
+ |
2946 |
+ static int __init arptable_filter_init(void) |
2947 |
+diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c |
2948 |
+index 3e5f4f2e705e8..08829809e88b7 100644 |
2949 |
+--- a/net/ipv4/sysctl_net_ipv4.c |
2950 |
++++ b/net/ipv4/sysctl_net_ipv4.c |
2951 |
+@@ -1369,9 +1369,19 @@ static __net_init int ipv4_sysctl_init_net(struct net *net) |
2952 |
+ if (!table) |
2953 |
+ goto err_alloc; |
2954 |
+ |
2955 |
+- /* Update the variables to point into the current struct net */ |
2956 |
+- for (i = 0; i < ARRAY_SIZE(ipv4_net_table) - 1; i++) |
2957 |
+- table[i].data += (void *)net - (void *)&init_net; |
2958 |
++ for (i = 0; i < ARRAY_SIZE(ipv4_net_table) - 1; i++) { |
2959 |
++ if (table[i].data) { |
2960 |
++ /* Update the variables to point into |
2961 |
++ * the current struct net |
2962 |
++ */ |
2963 |
++ table[i].data += (void *)net - (void *)&init_net; |
2964 |
++ } else { |
2965 |
++ /* Entries without data pointer are global; |
2966 |
++ * Make them read-only in non-init_net ns |
2967 |
++ */ |
2968 |
++ table[i].mode &= ~0222; |
2969 |
++ } |
2970 |
++ } |
2971 |
+ } |
2972 |
+ |
2973 |
+ net->ipv4.ipv4_hdr = register_net_sysctl(net, "net/ipv4", table); |
2974 |
+diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c |
2975 |
+index 5d27b5c631217..ecc1abfca0650 100644 |
2976 |
+--- a/net/ipv6/ip6_tunnel.c |
2977 |
++++ b/net/ipv6/ip6_tunnel.c |
2978 |
+@@ -2275,6 +2275,16 @@ static void __net_exit ip6_tnl_destroy_tunnels(struct net *net, struct list_head |
2979 |
+ t = rtnl_dereference(t->next); |
2980 |
+ } |
2981 |
+ } |
2982 |
++ |
2983 |
++ t = rtnl_dereference(ip6n->tnls_wc[0]); |
2984 |
++ while (t) { |
2985 |
++ /* If dev is in the same netns, it has already |
2986 |
++ * been added to the list by the previous loop. |
2987 |
++ */ |
2988 |
++ if (!net_eq(dev_net(t->dev), net)) |
2989 |
++ unregister_netdevice_queue(t->dev, list); |
2990 |
++ t = rtnl_dereference(t->next); |
2991 |
++ } |
2992 |
+ } |
2993 |
+ |
2994 |
+ static int __net_init ip6_tnl_init_net(struct net *net) |
2995 |
+diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c |
2996 |
+index b26f469a3fb8c..146ba7fa5bf62 100644 |
2997 |
+--- a/net/ipv6/sit.c |
2998 |
++++ b/net/ipv6/sit.c |
2999 |
+@@ -1867,9 +1867,9 @@ static void __net_exit sit_destroy_tunnels(struct net *net, |
3000 |
+ if (dev->rtnl_link_ops == &sit_link_ops) |
3001 |
+ unregister_netdevice_queue(dev, head); |
3002 |
+ |
3003 |
+- for (prio = 1; prio < 4; prio++) { |
3004 |
++ for (prio = 0; prio < 4; prio++) { |
3005 |
+ int h; |
3006 |
+- for (h = 0; h < IP6_SIT_HASH_SIZE; h++) { |
3007 |
++ for (h = 0; h < (prio ? IP6_SIT_HASH_SIZE : 1); h++) { |
3008 |
+ struct ip_tunnel *t; |
3009 |
+ |
3010 |
+ t = rtnl_dereference(sitn->tunnels[prio][h]); |
3011 |
+diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c |
3012 |
+index 2bf6271d9e3f6..6a96deded7632 100644 |
3013 |
+--- a/net/mac80211/cfg.c |
3014 |
++++ b/net/mac80211/cfg.c |
3015 |
+@@ -1789,8 +1789,10 @@ static int ieee80211_change_station(struct wiphy *wiphy, |
3016 |
+ } |
3017 |
+ |
3018 |
+ if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && |
3019 |
+- sta->sdata->u.vlan.sta) |
3020 |
++ sta->sdata->u.vlan.sta) { |
3021 |
++ ieee80211_clear_fast_rx(sta); |
3022 |
+ RCU_INIT_POINTER(sta->sdata->u.vlan.sta, NULL); |
3023 |
++ } |
3024 |
+ |
3025 |
+ if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) |
3026 |
+ ieee80211_vif_dec_num_mcast(sta->sdata); |
3027 |
+diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c |
3028 |
+index 0ee702d374b02..c6c0cb4656645 100644 |
3029 |
+--- a/net/netfilter/nf_conntrack_standalone.c |
3030 |
++++ b/net/netfilter/nf_conntrack_standalone.c |
3031 |
+@@ -266,6 +266,7 @@ static const char* l4proto_name(u16 proto) |
3032 |
+ case IPPROTO_GRE: return "gre"; |
3033 |
+ case IPPROTO_SCTP: return "sctp"; |
3034 |
+ case IPPROTO_UDPLITE: return "udplite"; |
3035 |
++ case IPPROTO_ICMPV6: return "icmpv6"; |
3036 |
+ } |
3037 |
+ |
3038 |
+ return "unknown"; |
3039 |
+diff --git a/net/netfilter/nf_flow_table_offload.c b/net/netfilter/nf_flow_table_offload.c |
3040 |
+index 2a6993fa40d78..1c5460e7bce87 100644 |
3041 |
+--- a/net/netfilter/nf_flow_table_offload.c |
3042 |
++++ b/net/netfilter/nf_flow_table_offload.c |
3043 |
+@@ -305,12 +305,12 @@ static void flow_offload_ipv6_mangle(struct nf_flow_rule *flow_rule, |
3044 |
+ const __be32 *addr, const __be32 *mask) |
3045 |
+ { |
3046 |
+ struct flow_action_entry *entry; |
3047 |
+- int i; |
3048 |
++ int i, j; |
3049 |
+ |
3050 |
+- for (i = 0; i < sizeof(struct in6_addr) / sizeof(u32); i += sizeof(u32)) { |
3051 |
++ for (i = 0, j = 0; i < sizeof(struct in6_addr) / sizeof(u32); i += sizeof(u32), j++) { |
3052 |
+ entry = flow_action_entry_next(flow_rule); |
3053 |
+ flow_offload_mangle(entry, FLOW_ACT_MANGLE_HDR_TYPE_IP6, |
3054 |
+- offset + i, &addr[i], mask); |
3055 |
++ offset + i, &addr[j], mask); |
3056 |
+ } |
3057 |
+ } |
3058 |
+ |
3059 |
+diff --git a/net/netfilter/nft_limit.c b/net/netfilter/nft_limit.c |
3060 |
+index 0e2c315c3b5ed..82ec27bdf9412 100644 |
3061 |
+--- a/net/netfilter/nft_limit.c |
3062 |
++++ b/net/netfilter/nft_limit.c |
3063 |
+@@ -76,13 +76,13 @@ static int nft_limit_init(struct nft_limit *limit, |
3064 |
+ return -EOVERFLOW; |
3065 |
+ |
3066 |
+ if (pkts) { |
3067 |
+- tokens = div_u64(limit->nsecs, limit->rate) * limit->burst; |
3068 |
++ tokens = div64_u64(limit->nsecs, limit->rate) * limit->burst; |
3069 |
+ } else { |
3070 |
+ /* The token bucket size limits the number of tokens can be |
3071 |
+ * accumulated. tokens_max specifies the bucket size. |
3072 |
+ * tokens_max = unit * (rate + burst) / rate. |
3073 |
+ */ |
3074 |
+- tokens = div_u64(limit->nsecs * (limit->rate + limit->burst), |
3075 |
++ tokens = div64_u64(limit->nsecs * (limit->rate + limit->burst), |
3076 |
+ limit->rate); |
3077 |
+ } |
3078 |
+ |
3079 |
+diff --git a/net/sctp/socket.c b/net/sctp/socket.c |
3080 |
+index 53d0a4161df3f..9463c54c465af 100644 |
3081 |
+--- a/net/sctp/socket.c |
3082 |
++++ b/net/sctp/socket.c |
3083 |
+@@ -1520,11 +1520,9 @@ static void sctp_close(struct sock *sk, long timeout) |
3084 |
+ |
3085 |
+ /* Supposedly, no process has access to the socket, but |
3086 |
+ * the net layers still may. |
3087 |
+- * Also, sctp_destroy_sock() needs to be called with addr_wq_lock |
3088 |
+- * held and that should be grabbed before socket lock. |
3089 |
+ */ |
3090 |
+- spin_lock_bh(&net->sctp.addr_wq_lock); |
3091 |
+- bh_lock_sock_nested(sk); |
3092 |
++ local_bh_disable(); |
3093 |
++ bh_lock_sock(sk); |
3094 |
+ |
3095 |
+ /* Hold the sock, since sk_common_release() will put sock_put() |
3096 |
+ * and we have just a little more cleanup. |
3097 |
+@@ -1533,7 +1531,7 @@ static void sctp_close(struct sock *sk, long timeout) |
3098 |
+ sk_common_release(sk); |
3099 |
+ |
3100 |
+ bh_unlock_sock(sk); |
3101 |
+- spin_unlock_bh(&net->sctp.addr_wq_lock); |
3102 |
++ local_bh_enable(); |
3103 |
+ |
3104 |
+ sock_put(sk); |
3105 |
+ |
3106 |
+@@ -4939,9 +4937,6 @@ static int sctp_init_sock(struct sock *sk) |
3107 |
+ sk_sockets_allocated_inc(sk); |
3108 |
+ sock_prot_inuse_add(net, sk->sk_prot, 1); |
3109 |
+ |
3110 |
+- /* Nothing can fail after this block, otherwise |
3111 |
+- * sctp_destroy_sock() will be called without addr_wq_lock held |
3112 |
+- */ |
3113 |
+ if (net->sctp.default_auto_asconf) { |
3114 |
+ spin_lock(&sock_net(sk)->sctp.addr_wq_lock); |
3115 |
+ list_add_tail(&sp->auto_asconf_list, |
3116 |
+@@ -4976,7 +4971,9 @@ static void sctp_destroy_sock(struct sock *sk) |
3117 |
+ |
3118 |
+ if (sp->do_auto_asconf) { |
3119 |
+ sp->do_auto_asconf = 0; |
3120 |
++ spin_lock_bh(&sock_net(sk)->sctp.addr_wq_lock); |
3121 |
+ list_del(&sp->auto_asconf_list); |
3122 |
++ spin_unlock_bh(&sock_net(sk)->sctp.addr_wq_lock); |
3123 |
+ } |
3124 |
+ sctp_endpoint_free(sp->ep); |
3125 |
+ local_bh_disable(); |
3126 |
+diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c |
3127 |
+index b81ca117dac7a..e4cb0ff4dcf41 100644 |
3128 |
+--- a/net/xfrm/xfrm_output.c |
3129 |
++++ b/net/xfrm/xfrm_output.c |
3130 |
+@@ -660,6 +660,12 @@ static int xfrm4_extract_output(struct xfrm_state *x, struct sk_buff *skb) |
3131 |
+ { |
3132 |
+ int err; |
3133 |
+ |
3134 |
++ if (x->outer_mode.encap == XFRM_MODE_BEET && |
3135 |
++ ip_is_fragment(ip_hdr(skb))) { |
3136 |
++ net_warn_ratelimited("BEET mode doesn't support inner IPv4 fragments\n"); |
3137 |
++ return -EAFNOSUPPORT; |
3138 |
++ } |
3139 |
++ |
3140 |
+ err = xfrm4_tunnel_check_size(skb); |
3141 |
+ if (err) |
3142 |
+ return err; |
3143 |
+@@ -705,8 +711,15 @@ out: |
3144 |
+ static int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb) |
3145 |
+ { |
3146 |
+ #if IS_ENABLED(CONFIG_IPV6) |
3147 |
++ unsigned int ptr = 0; |
3148 |
+ int err; |
3149 |
+ |
3150 |
++ if (x->outer_mode.encap == XFRM_MODE_BEET && |
3151 |
++ ipv6_find_hdr(skb, &ptr, NEXTHDR_FRAGMENT, NULL, NULL) >= 0) { |
3152 |
++ net_warn_ratelimited("BEET mode doesn't support inner IPv6 fragments\n"); |
3153 |
++ return -EAFNOSUPPORT; |
3154 |
++ } |
3155 |
++ |
3156 |
+ err = xfrm6_tunnel_check_size(skb); |
3157 |
+ if (err) |
3158 |
+ return err; |
3159 |
+diff --git a/sound/soc/codecs/max98373-i2c.c b/sound/soc/codecs/max98373-i2c.c |
3160 |
+index 92921e34f9486..32b0c1d983650 100644 |
3161 |
+--- a/sound/soc/codecs/max98373-i2c.c |
3162 |
++++ b/sound/soc/codecs/max98373-i2c.c |
3163 |
+@@ -440,6 +440,7 @@ static bool max98373_volatile_reg(struct device *dev, unsigned int reg) |
3164 |
+ case MAX98373_R2054_MEAS_ADC_PVDD_CH_READBACK: |
3165 |
+ case MAX98373_R2055_MEAS_ADC_THERM_CH_READBACK: |
3166 |
+ case MAX98373_R20B6_BDE_CUR_STATE_READBACK: |
3167 |
++ case MAX98373_R20FF_GLOBAL_SHDN: |
3168 |
+ case MAX98373_R21FF_REV_ID: |
3169 |
+ return true; |
3170 |
+ default: |
3171 |
+diff --git a/sound/soc/codecs/max98373-sdw.c b/sound/soc/codecs/max98373-sdw.c |
3172 |
+index fa589d834f9aa..14fd2f9a0bf3a 100644 |
3173 |
+--- a/sound/soc/codecs/max98373-sdw.c |
3174 |
++++ b/sound/soc/codecs/max98373-sdw.c |
3175 |
+@@ -214,6 +214,7 @@ static bool max98373_volatile_reg(struct device *dev, unsigned int reg) |
3176 |
+ case MAX98373_R2054_MEAS_ADC_PVDD_CH_READBACK: |
3177 |
+ case MAX98373_R2055_MEAS_ADC_THERM_CH_READBACK: |
3178 |
+ case MAX98373_R20B6_BDE_CUR_STATE_READBACK: |
3179 |
++ case MAX98373_R20FF_GLOBAL_SHDN: |
3180 |
+ case MAX98373_R21FF_REV_ID: |
3181 |
+ /* SoundWire Control Port Registers */ |
3182 |
+ case MAX98373_R0040_SCP_INIT_STAT_1 ... MAX98373_R0070_SCP_FRAME_CTLR: |
3183 |
+diff --git a/sound/soc/codecs/max98373.c b/sound/soc/codecs/max98373.c |
3184 |
+index 929bb1798c43f..1fd4dbbb4ecf4 100644 |
3185 |
+--- a/sound/soc/codecs/max98373.c |
3186 |
++++ b/sound/soc/codecs/max98373.c |
3187 |
+@@ -28,11 +28,13 @@ static int max98373_dac_event(struct snd_soc_dapm_widget *w, |
3188 |
+ regmap_update_bits(max98373->regmap, |
3189 |
+ MAX98373_R20FF_GLOBAL_SHDN, |
3190 |
+ MAX98373_GLOBAL_EN_MASK, 1); |
3191 |
++ usleep_range(30000, 31000); |
3192 |
+ break; |
3193 |
+ case SND_SOC_DAPM_POST_PMD: |
3194 |
+ regmap_update_bits(max98373->regmap, |
3195 |
+ MAX98373_R20FF_GLOBAL_SHDN, |
3196 |
+ MAX98373_GLOBAL_EN_MASK, 0); |
3197 |
++ usleep_range(30000, 31000); |
3198 |
+ max98373->tdm_mode = false; |
3199 |
+ break; |
3200 |
+ default: |
3201 |
+diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c |
3202 |
+index 39637ca78cdbb..9f5f217a96077 100644 |
3203 |
+--- a/sound/soc/fsl/fsl_esai.c |
3204 |
++++ b/sound/soc/fsl/fsl_esai.c |
3205 |
+@@ -524,11 +524,13 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream, |
3206 |
+ ESAI_SAICR_SYNC, esai_priv->synchronous ? |
3207 |
+ ESAI_SAICR_SYNC : 0); |
3208 |
+ |
3209 |
+- /* Set a default slot number -- 2 */ |
3210 |
++ /* Set slots count */ |
3211 |
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_TCCR, |
3212 |
+- ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2)); |
3213 |
++ ESAI_xCCR_xDC_MASK, |
3214 |
++ ESAI_xCCR_xDC(esai_priv->slots)); |
3215 |
+ regmap_update_bits(esai_priv->regmap, REG_ESAI_RCCR, |
3216 |
+- ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2)); |
3217 |
++ ESAI_xCCR_xDC_MASK, |
3218 |
++ ESAI_xCCR_xDC(esai_priv->slots)); |
3219 |
+ } |
3220 |
+ |
3221 |
+ return 0; |
3222 |
+diff --git a/tools/include/uapi/asm/errno.h b/tools/include/uapi/asm/errno.h |
3223 |
+index 637189ec1ab99..d30439b4b8ab4 100644 |
3224 |
+--- a/tools/include/uapi/asm/errno.h |
3225 |
++++ b/tools/include/uapi/asm/errno.h |
3226 |
+@@ -9,8 +9,6 @@ |
3227 |
+ #include "../../../arch/alpha/include/uapi/asm/errno.h" |
3228 |
+ #elif defined(__mips__) |
3229 |
+ #include "../../../arch/mips/include/uapi/asm/errno.h" |
3230 |
+-#elif defined(__ia64__) |
3231 |
+-#include "../../../arch/ia64/include/uapi/asm/errno.h" |
3232 |
+ #elif defined(__xtensa__) |
3233 |
+ #include "../../../arch/xtensa/include/uapi/asm/errno.h" |
3234 |
+ #else |
3235 |
+diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c |
3236 |
+index 5f7b85fba39d0..7150e34cf2afb 100644 |
3237 |
+--- a/tools/lib/bpf/xsk.c |
3238 |
++++ b/tools/lib/bpf/xsk.c |
3239 |
+@@ -703,18 +703,19 @@ int xsk_socket__create_shared(struct xsk_socket **xsk_ptr, |
3240 |
+ struct xsk_ring_cons *comp, |
3241 |
+ const struct xsk_socket_config *usr_config) |
3242 |
+ { |
3243 |
++ bool unmap, rx_setup_done = false, tx_setup_done = false; |
3244 |
+ void *rx_map = NULL, *tx_map = NULL; |
3245 |
+ struct sockaddr_xdp sxdp = {}; |
3246 |
+ struct xdp_mmap_offsets off; |
3247 |
+ struct xsk_socket *xsk; |
3248 |
+ struct xsk_ctx *ctx; |
3249 |
+ int err, ifindex; |
3250 |
+- bool unmap = umem->fill_save != fill; |
3251 |
+- bool rx_setup_done = false, tx_setup_done = false; |
3252 |
+ |
3253 |
+ if (!umem || !xsk_ptr || !(rx || tx)) |
3254 |
+ return -EFAULT; |
3255 |
+ |
3256 |
++ unmap = umem->fill_save != fill; |
3257 |
++ |
3258 |
+ xsk = calloc(1, sizeof(*xsk)); |
3259 |
+ if (!xsk) |
3260 |
+ return -ENOMEM; |