Gentoo Archives: gentoo-commits

From: Alice Ferrazzi <alicef@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.19 commit in: /
Date: Wed, 10 Feb 2021 10:03:59
Message-Id: 1612951400.153ca76b9b495690dbaad17ca33b97f3d47f40a1.alicef@gentoo
1 commit: 153ca76b9b495690dbaad17ca33b97f3d47f40a1
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 10 10:03:11 2021 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 10 10:03:20 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=153ca76b
7
8 Linux patch 4.19.175
9
10 Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org>
11
12 0000_README | 4 +
13 1174_linux-4.19.175.patch | 1311 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 1315 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 1d2c2d9..d2238ab 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -735,6 +735,10 @@ Patch: 1173_linux-4.19.174.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.19.174
23
24 +Patch: 1174_linux-4.19.175.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.19.175
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/1174_linux-4.19.175.patch b/1174_linux-4.19.175.patch
33 new file mode 100644
34 index 0000000..f2c8762
35 --- /dev/null
36 +++ b/1174_linux-4.19.175.patch
37 @@ -0,0 +1,1311 @@
38 +diff --git a/Makefile b/Makefile
39 +index 8f326d0652a73..db37b39fae693 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 4
45 + PATCHLEVEL = 19
46 +-SUBLEVEL = 174
47 ++SUBLEVEL = 175
48 + EXTRAVERSION =
49 + NAME = "People's Front"
50 +
51 +@@ -859,12 +859,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)
52 + # change __FILE__ to the relative path from the srctree
53 + KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
54 +
55 +-# ensure -fcf-protection is disabled when using retpoline as it is
56 +-# incompatible with -mindirect-branch=thunk-extern
57 +-ifdef CONFIG_RETPOLINE
58 +-KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
59 +-endif
60 +-
61 + # use the deterministic mode of AR if available
62 + KBUILD_ARFLAGS := $(call ar-option,D)
63 +
64 +diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
65 +index 16d71bac0061b..2d1f822700a1a 100644
66 +--- a/arch/arm/mach-footbridge/dc21285.c
67 ++++ b/arch/arm/mach-footbridge/dc21285.c
68 +@@ -69,15 +69,15 @@ dc21285_read_config(struct pci_bus *bus, unsigned int devfn, int where,
69 + if (addr)
70 + switch (size) {
71 + case 1:
72 +- asm("ldrb %0, [%1, %2]"
73 ++ asm volatile("ldrb %0, [%1, %2]"
74 + : "=r" (v) : "r" (addr), "r" (where) : "cc");
75 + break;
76 + case 2:
77 +- asm("ldrh %0, [%1, %2]"
78 ++ asm volatile("ldrh %0, [%1, %2]"
79 + : "=r" (v) : "r" (addr), "r" (where) : "cc");
80 + break;
81 + case 4:
82 +- asm("ldr %0, [%1, %2]"
83 ++ asm volatile("ldr %0, [%1, %2]"
84 + : "=r" (v) : "r" (addr), "r" (where) : "cc");
85 + break;
86 + }
87 +@@ -103,17 +103,17 @@ dc21285_write_config(struct pci_bus *bus, unsigned int devfn, int where,
88 + if (addr)
89 + switch (size) {
90 + case 1:
91 +- asm("strb %0, [%1, %2]"
92 ++ asm volatile("strb %0, [%1, %2]"
93 + : : "r" (value), "r" (addr), "r" (where)
94 + : "cc");
95 + break;
96 + case 2:
97 +- asm("strh %0, [%1, %2]"
98 ++ asm volatile("strh %0, [%1, %2]"
99 + : : "r" (value), "r" (addr), "r" (where)
100 + : "cc");
101 + break;
102 + case 4:
103 +- asm("str %0, [%1, %2]"
104 ++ asm volatile("str %0, [%1, %2]"
105 + : : "r" (value), "r" (addr), "r" (where)
106 + : "cc");
107 + break;
108 +diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
109 +index de6af453a6e16..f4eb4d3b6cabf 100644
110 +--- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
111 ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
112 +@@ -303,7 +303,7 @@
113 +
114 + dcfg: dcfg@1ee0000 {
115 + compatible = "fsl,ls1046a-dcfg", "syscon";
116 +- reg = <0x0 0x1ee0000 0x0 0x10000>;
117 ++ reg = <0x0 0x1ee0000 0x0 0x1000>;
118 + big-endian;
119 + };
120 +
121 +diff --git a/arch/x86/Makefile b/arch/x86/Makefile
122 +index 4833dd7e2cc03..0303a243b634e 100644
123 +--- a/arch/x86/Makefile
124 ++++ b/arch/x86/Makefile
125 +@@ -132,6 +132,9 @@ else
126 + KBUILD_CFLAGS += -mno-red-zone
127 + KBUILD_CFLAGS += -mcmodel=kernel
128 +
129 ++ # Intel CET isn't enabled in the kernel
130 ++ KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
131 ++
132 + # -funit-at-a-time shrinks the kernel .text considerably
133 + # unfortunately it makes reading oopses harder.
134 + KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
135 +diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
136 +index cd2aa72e21239..b5354e216b07c 100644
137 +--- a/arch/x86/include/asm/apic.h
138 ++++ b/arch/x86/include/asm/apic.h
139 +@@ -190,16 +190,6 @@ static inline void lapic_assign_legacy_vector(unsigned int i, bool r) { }
140 + #endif /* !CONFIG_X86_LOCAL_APIC */
141 +
142 + #ifdef CONFIG_X86_X2APIC
143 +-/*
144 +- * Make previous memory operations globally visible before
145 +- * sending the IPI through x2apic wrmsr. We need a serializing instruction or
146 +- * mfence for this.
147 +- */
148 +-static inline void x2apic_wrmsr_fence(void)
149 +-{
150 +- asm volatile("mfence" : : : "memory");
151 +-}
152 +-
153 + static inline void native_apic_msr_write(u32 reg, u32 v)
154 + {
155 + if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||
156 +diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h
157 +index 84f848c2541a6..dd22cffc6b3fc 100644
158 +--- a/arch/x86/include/asm/barrier.h
159 ++++ b/arch/x86/include/asm/barrier.h
160 +@@ -85,4 +85,22 @@ do { \
161 +
162 + #include <asm-generic/barrier.h>
163 +
164 ++/*
165 ++ * Make previous memory operations globally visible before
166 ++ * a WRMSR.
167 ++ *
168 ++ * MFENCE makes writes visible, but only affects load/store
169 ++ * instructions. WRMSR is unfortunately not a load/store
170 ++ * instruction and is unaffected by MFENCE. The LFENCE ensures
171 ++ * that the WRMSR is not reordered.
172 ++ *
173 ++ * Most WRMSRs are full serializing instructions themselves and
174 ++ * do not require this barrier. This is only required for the
175 ++ * IA32_TSC_DEADLINE and X2APIC MSRs.
176 ++ */
177 ++static inline void weak_wrmsr_fence(void)
178 ++{
179 ++ asm volatile("mfence; lfence" : : : "memory");
180 ++}
181 ++
182 + #endif /* _ASM_X86_BARRIER_H */
183 +diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
184 +index ab8187271d470..e891b33ccfe5f 100644
185 +--- a/arch/x86/kernel/apic/apic.c
186 ++++ b/arch/x86/kernel/apic/apic.c
187 +@@ -41,6 +41,7 @@
188 + #include <asm/x86_init.h>
189 + #include <asm/pgalloc.h>
190 + #include <linux/atomic.h>
191 ++#include <asm/barrier.h>
192 + #include <asm/mpspec.h>
193 + #include <asm/i8259.h>
194 + #include <asm/proto.h>
195 +@@ -465,6 +466,9 @@ static int lapic_next_deadline(unsigned long delta,
196 + {
197 + u64 tsc;
198 +
199 ++ /* This MSR is special and need a special fence: */
200 ++ weak_wrmsr_fence();
201 ++
202 + tsc = rdtsc();
203 + wrmsrl(MSR_IA32_TSC_DEADLINE, tsc + (((u64) delta) * TSC_DIVISOR));
204 + return 0;
205 +diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
206 +index 145517934171e..b2c7e3bc55d22 100644
207 +--- a/arch/x86/kernel/apic/x2apic_cluster.c
208 ++++ b/arch/x86/kernel/apic/x2apic_cluster.c
209 +@@ -31,7 +31,8 @@ static void x2apic_send_IPI(int cpu, int vector)
210 + {
211 + u32 dest = per_cpu(x86_cpu_to_logical_apicid, cpu);
212 +
213 +- x2apic_wrmsr_fence();
214 ++ /* x2apic MSRs are special and need a special fence: */
215 ++ weak_wrmsr_fence();
216 + __x2apic_send_IPI_dest(dest, vector, APIC_DEST_LOGICAL);
217 + }
218 +
219 +@@ -43,7 +44,8 @@ __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest)
220 + unsigned long flags;
221 + u32 dest;
222 +
223 +- x2apic_wrmsr_fence();
224 ++ /* x2apic MSRs are special and need a special fence: */
225 ++ weak_wrmsr_fence();
226 + local_irq_save(flags);
227 +
228 + tmpmsk = this_cpu_cpumask_var_ptr(ipi_mask);
229 +diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
230 +index ed56d2850e96a..8e70c2ba21b3d 100644
231 +--- a/arch/x86/kernel/apic/x2apic_phys.c
232 ++++ b/arch/x86/kernel/apic/x2apic_phys.c
233 +@@ -48,7 +48,8 @@ static void x2apic_send_IPI(int cpu, int vector)
234 + {
235 + u32 dest = per_cpu(x86_cpu_to_apicid, cpu);
236 +
237 +- x2apic_wrmsr_fence();
238 ++ /* x2apic MSRs are special and need a special fence: */
239 ++ weak_wrmsr_fence();
240 + __x2apic_send_IPI_dest(dest, vector, APIC_DEST_PHYSICAL);
241 + }
242 +
243 +@@ -59,7 +60,8 @@ __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest)
244 + unsigned long this_cpu;
245 + unsigned long flags;
246 +
247 +- x2apic_wrmsr_fence();
248 ++ /* x2apic MSRs are special and need a special fence: */
249 ++ weak_wrmsr_fence();
250 +
251 + local_irq_save(flags);
252 +
253 +diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
254 +index d2dc734f5bd0d..f1e86051aa5f3 100644
255 +--- a/arch/x86/kvm/svm.c
256 ++++ b/arch/x86/kvm/svm.c
257 +@@ -892,6 +892,11 @@ static int has_svm(void)
258 + return 0;
259 + }
260 +
261 ++ if (sev_active()) {
262 ++ pr_info("KVM is unsupported when running as an SEV guest\n");
263 ++ return 0;
264 ++ }
265 ++
266 + return 1;
267 + }
268 +
269 +diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
270 +index ee3ff0894d093..ef4e8423843f3 100644
271 +--- a/drivers/input/joystick/xpad.c
272 ++++ b/drivers/input/joystick/xpad.c
273 +@@ -229,9 +229,17 @@ static const struct xpad_device {
274 + { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
275 + { 0x0e6f, 0x021f, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
276 + { 0x0e6f, 0x0246, "Rock Candy Gamepad for Xbox One 2015", 0, XTYPE_XBOXONE },
277 +- { 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE },
278 ++ { 0x0e6f, 0x02a0, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
279 ++ { 0x0e6f, 0x02a1, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
280 ++ { 0x0e6f, 0x02a2, "PDP Wired Controller for Xbox One - Crimson Red", 0, XTYPE_XBOXONE },
281 + { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 0, XTYPE_XBOXONE },
282 + { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 0, XTYPE_XBOXONE },
283 ++ { 0x0e6f, 0x02a7, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
284 ++ { 0x0e6f, 0x02a8, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
285 ++ { 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE },
286 ++ { 0x0e6f, 0x02ad, "PDP Wired Controller for Xbox One - Stealth Series", 0, XTYPE_XBOXONE },
287 ++ { 0x0e6f, 0x02b3, "Afterglow Prismatic Wired Controller", 0, XTYPE_XBOXONE },
288 ++ { 0x0e6f, 0x02b8, "Afterglow Prismatic Wired Controller", 0, XTYPE_XBOXONE },
289 + { 0x0e6f, 0x0301, "Logic3 Controller", 0, XTYPE_XBOX360 },
290 + { 0x0e6f, 0x0346, "Rock Candy Gamepad for Xbox One 2016", 0, XTYPE_XBOXONE },
291 + { 0x0e6f, 0x0401, "Logic3 Controller", 0, XTYPE_XBOX360 },
292 +@@ -310,6 +318,9 @@ static const struct xpad_device {
293 + { 0x1bad, 0xfa01, "MadCatz GamePad", 0, XTYPE_XBOX360 },
294 + { 0x1bad, 0xfd00, "Razer Onza TE", 0, XTYPE_XBOX360 },
295 + { 0x1bad, 0xfd01, "Razer Onza", 0, XTYPE_XBOX360 },
296 ++ { 0x20d6, 0x2001, "BDA Xbox Series X Wired Controller", 0, XTYPE_XBOXONE },
297 ++ { 0x20d6, 0x281f, "PowerA Wired Controller For Xbox 360", 0, XTYPE_XBOX360 },
298 ++ { 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE },
299 + { 0x24c6, 0x5000, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
300 + { 0x24c6, 0x5300, "PowerA MINI PROEX Controller", 0, XTYPE_XBOX360 },
301 + { 0x24c6, 0x5303, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 },
302 +@@ -443,8 +454,12 @@ static const struct usb_device_id xpad_table[] = {
303 + XPAD_XBOX360_VENDOR(0x162e), /* Joytech X-Box 360 controllers */
304 + XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */
305 + XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */
306 ++ XPAD_XBOX360_VENDOR(0x20d6), /* PowerA Controllers */
307 ++ XPAD_XBOXONE_VENDOR(0x20d6), /* PowerA Controllers */
308 + XPAD_XBOX360_VENDOR(0x24c6), /* PowerA Controllers */
309 + XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */
310 ++ XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */
311 ++ XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
312 + { }
313 + };
314 +
315 +diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
316 +index b256e3006a6fb..844875df8cad7 100644
317 +--- a/drivers/input/serio/i8042-x86ia64io.h
318 ++++ b/drivers/input/serio/i8042-x86ia64io.h
319 +@@ -223,6 +223,8 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
320 + DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"),
321 + DMI_MATCH(DMI_PRODUCT_NAME, "C15B"),
322 + },
323 ++ },
324 ++ {
325 + .matches = {
326 + DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"),
327 + DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"),
328 +diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
329 +index 2a83fc31dd47a..d2166dfc8b3f8 100644
330 +--- a/drivers/iommu/intel-iommu.c
331 ++++ b/drivers/iommu/intel-iommu.c
332 +@@ -3364,6 +3364,12 @@ static int __init init_dmars(void)
333 +
334 + if (!ecap_pass_through(iommu->ecap))
335 + hw_pass_through = 0;
336 ++
337 ++ if (!intel_iommu_strict && cap_caching_mode(iommu->cap)) {
338 ++ pr_info("Disable batched IOTLB flush due to virtualization");
339 ++ intel_iommu_strict = 1;
340 ++ }
341 ++
342 + #ifdef CONFIG_INTEL_IOMMU_SVM
343 + if (pasid_enabled(iommu))
344 + intel_svm_init(iommu);
345 +diff --git a/drivers/md/md.c b/drivers/md/md.c
346 +index 80ca13594c182..09f0d8e70b709 100644
347 +--- a/drivers/md/md.c
348 ++++ b/drivers/md/md.c
349 +@@ -474,8 +474,10 @@ static void md_submit_flush_data(struct work_struct *ws)
350 + * could wait for this and below md_handle_request could wait for those
351 + * bios because of suspend check
352 + */
353 ++ spin_lock_irq(&mddev->lock);
354 + mddev->last_flush = mddev->start_flush;
355 + mddev->flush_bio = NULL;
356 ++ spin_unlock_irq(&mddev->lock);
357 + wake_up(&mddev->sb_wait);
358 +
359 + if (bio->bi_iter.bi_size == 0) {
360 +diff --git a/drivers/mmc/core/sdio_cis.c b/drivers/mmc/core/sdio_cis.c
361 +index 2ca5cd79018b4..dca72444b3122 100644
362 +--- a/drivers/mmc/core/sdio_cis.c
363 ++++ b/drivers/mmc/core/sdio_cis.c
364 +@@ -24,6 +24,8 @@
365 + #include "sdio_cis.h"
366 + #include "sdio_ops.h"
367 +
368 ++#define SDIO_READ_CIS_TIMEOUT_MS (10 * 1000) /* 10s */
369 ++
370 + static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func,
371 + const unsigned char *buf, unsigned size)
372 + {
373 +@@ -270,6 +272,8 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
374 +
375 + do {
376 + unsigned char tpl_code, tpl_link;
377 ++ unsigned long timeout = jiffies +
378 ++ msecs_to_jiffies(SDIO_READ_CIS_TIMEOUT_MS);
379 +
380 + ret = mmc_io_rw_direct(card, 0, 0, ptr++, 0, &tpl_code);
381 + if (ret)
382 +@@ -322,6 +326,8 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
383 + prev = &this->next;
384 +
385 + if (ret == -ENOENT) {
386 ++ if (time_after(jiffies, timeout))
387 ++ break;
388 + /* warn about unknown tuples */
389 + pr_warn_ratelimited("%s: queuing unknown"
390 + " CIS tuple 0x%02x (%u bytes)\n",
391 +diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
392 +index 6fa8aa69b4180..e04b7fa068aff 100644
393 +--- a/drivers/net/dsa/mv88e6xxx/chip.c
394 ++++ b/drivers/net/dsa/mv88e6xxx/chip.c
395 +@@ -1658,7 +1658,11 @@ static int mv88e6xxx_port_db_load_purge(struct mv88e6xxx_chip *chip, int port,
396 + if (!entry.portvec)
397 + entry.state = MV88E6XXX_G1_ATU_DATA_STATE_UNUSED;
398 + } else {
399 +- entry.portvec |= BIT(port);
400 ++ if (state == MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC)
401 ++ entry.portvec = BIT(port);
402 ++ else
403 ++ entry.portvec |= BIT(port);
404 ++
405 + entry.state = state;
406 + }
407 +
408 +diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c
409 +index a30eb90ba3d28..dd590086fe6a5 100644
410 +--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c
411 ++++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c
412 +@@ -29,16 +29,16 @@ static int mvpp2_prs_hw_write(struct mvpp2 *priv, struct mvpp2_prs_entry *pe)
413 + /* Clear entry invalidation bit */
414 + pe->tcam[MVPP2_PRS_TCAM_INV_WORD] &= ~MVPP2_PRS_TCAM_INV_MASK;
415 +
416 +- /* Write tcam index - indirect access */
417 +- mvpp2_write(priv, MVPP2_PRS_TCAM_IDX_REG, pe->index);
418 +- for (i = 0; i < MVPP2_PRS_TCAM_WORDS; i++)
419 +- mvpp2_write(priv, MVPP2_PRS_TCAM_DATA_REG(i), pe->tcam[i]);
420 +-
421 + /* Write sram index - indirect access */
422 + mvpp2_write(priv, MVPP2_PRS_SRAM_IDX_REG, pe->index);
423 + for (i = 0; i < MVPP2_PRS_SRAM_WORDS; i++)
424 + mvpp2_write(priv, MVPP2_PRS_SRAM_DATA_REG(i), pe->sram[i]);
425 +
426 ++ /* Write tcam index - indirect access */
427 ++ mvpp2_write(priv, MVPP2_PRS_TCAM_IDX_REG, pe->index);
428 ++ for (i = 0; i < MVPP2_PRS_TCAM_WORDS; i++)
429 ++ mvpp2_write(priv, MVPP2_PRS_TCAM_DATA_REG(i), pe->tcam[i]);
430 ++
431 + return 0;
432 + }
433 +
434 +diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
435 +index a52b2f15f372a..82d87d2e280c2 100644
436 +--- a/drivers/nvme/host/pci.c
437 ++++ b/drivers/nvme/host/pci.c
438 +@@ -2733,6 +2733,8 @@ static const struct pci_device_id nvme_id_table[] = {
439 + { PCI_DEVICE(0x1d1d, 0x2601), /* CNEX Granby */
440 + .driver_data = NVME_QUIRK_LIGHTNVM, },
441 + { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
442 ++ { PCI_DEVICE(0x2646, 0x2263), /* KINGSTON A2000 NVMe SSD */
443 ++ .driver_data = NVME_QUIRK_NO_DEEPEST_PS, },
444 + { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) },
445 + { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
446 + { 0, }
447 +diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
448 +index 5c00d79ac7a10..c9560d8ba3cb1 100644
449 +--- a/drivers/usb/class/usblp.c
450 ++++ b/drivers/usb/class/usblp.c
451 +@@ -1327,14 +1327,17 @@ static int usblp_set_protocol(struct usblp *usblp, int protocol)
452 + if (protocol < USBLP_FIRST_PROTOCOL || protocol > USBLP_LAST_PROTOCOL)
453 + return -EINVAL;
454 +
455 +- alts = usblp->protocol[protocol].alt_setting;
456 +- if (alts < 0)
457 +- return -EINVAL;
458 +- r = usb_set_interface(usblp->dev, usblp->ifnum, alts);
459 +- if (r < 0) {
460 +- printk(KERN_ERR "usblp: can't set desired altsetting %d on interface %d\n",
461 +- alts, usblp->ifnum);
462 +- return r;
463 ++ /* Don't unnecessarily set the interface if there's a single alt. */
464 ++ if (usblp->intf->num_altsetting > 1) {
465 ++ alts = usblp->protocol[protocol].alt_setting;
466 ++ if (alts < 0)
467 ++ return -EINVAL;
468 ++ r = usb_set_interface(usblp->dev, usblp->ifnum, alts);
469 ++ if (r < 0) {
470 ++ printk(KERN_ERR "usblp: can't set desired altsetting %d on interface %d\n",
471 ++ alts, usblp->ifnum);
472 ++ return r;
473 ++ }
474 + }
475 +
476 + usblp->bidir = (usblp->protocol[protocol].epread != NULL);
477 +diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
478 +index 8e98b4df9b109..42f66718bc184 100644
479 +--- a/drivers/usb/dwc2/gadget.c
480 ++++ b/drivers/usb/dwc2/gadget.c
481 +@@ -1453,7 +1453,6 @@ static void dwc2_hsotg_complete_oursetup(struct usb_ep *ep,
482 + static struct dwc2_hsotg_ep *ep_from_windex(struct dwc2_hsotg *hsotg,
483 + u32 windex)
484 + {
485 +- struct dwc2_hsotg_ep *ep;
486 + int dir = (windex & USB_DIR_IN) ? 1 : 0;
487 + int idx = windex & 0x7F;
488 +
489 +@@ -1463,12 +1462,7 @@ static struct dwc2_hsotg_ep *ep_from_windex(struct dwc2_hsotg *hsotg,
490 + if (idx > hsotg->num_of_eps)
491 + return NULL;
492 +
493 +- ep = index_to_ep(hsotg, idx, dir);
494 +-
495 +- if (idx && ep->dir_in != dir)
496 +- return NULL;
497 +-
498 +- return ep;
499 ++ return index_to_ep(hsotg, idx, dir);
500 + }
501 +
502 + /**
503 +diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
504 +index 86b1cfbe48a08..e890c26b6c826 100644
505 +--- a/drivers/usb/dwc3/core.c
506 ++++ b/drivers/usb/dwc3/core.c
507 +@@ -1700,7 +1700,7 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
508 + if (PMSG_IS_AUTO(msg))
509 + break;
510 +
511 +- ret = dwc3_core_init(dwc);
512 ++ ret = dwc3_core_init_for_resume(dwc);
513 + if (ret)
514 + return ret;
515 +
516 +diff --git a/drivers/usb/gadget/legacy/ether.c b/drivers/usb/gadget/legacy/ether.c
517 +index 30313b233680d..99c7fc0d1d597 100644
518 +--- a/drivers/usb/gadget/legacy/ether.c
519 ++++ b/drivers/usb/gadget/legacy/ether.c
520 +@@ -403,8 +403,10 @@ static int eth_bind(struct usb_composite_dev *cdev)
521 + struct usb_descriptor_header *usb_desc;
522 +
523 + usb_desc = usb_otg_descriptor_alloc(gadget);
524 +- if (!usb_desc)
525 ++ if (!usb_desc) {
526 ++ status = -ENOMEM;
527 + goto fail1;
528 ++ }
529 + usb_otg_descriptor_init(gadget, usb_desc);
530 + otg_desc[0] = usb_desc;
531 + otg_desc[1] = NULL;
532 +diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
533 +index 537bbcd47c463..22b1de99d02d1 100644
534 +--- a/drivers/usb/host/xhci-ring.c
535 ++++ b/drivers/usb/host/xhci-ring.c
536 +@@ -670,11 +670,16 @@ static void xhci_unmap_td_bounce_buffer(struct xhci_hcd *xhci,
537 + dma_unmap_single(dev, seg->bounce_dma, ring->bounce_buf_len,
538 + DMA_FROM_DEVICE);
539 + /* for in tranfers we need to copy the data from bounce to sg */
540 +- len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs, seg->bounce_buf,
541 +- seg->bounce_len, seg->bounce_offs);
542 +- if (len != seg->bounce_len)
543 +- xhci_warn(xhci, "WARN Wrong bounce buffer read length: %zu != %d\n",
544 +- len, seg->bounce_len);
545 ++ if (urb->num_sgs) {
546 ++ len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs, seg->bounce_buf,
547 ++ seg->bounce_len, seg->bounce_offs);
548 ++ if (len != seg->bounce_len)
549 ++ xhci_warn(xhci, "WARN Wrong bounce buffer read length: %zu != %d\n",
550 ++ len, seg->bounce_len);
551 ++ } else {
552 ++ memcpy(urb->transfer_buffer + seg->bounce_offs, seg->bounce_buf,
553 ++ seg->bounce_len);
554 ++ }
555 + seg->bounce_len = 0;
556 + seg->bounce_offs = 0;
557 + }
558 +@@ -3180,12 +3185,16 @@ static int xhci_align_td(struct xhci_hcd *xhci, struct urb *urb, u32 enqd_len,
559 +
560 + /* create a max max_pkt sized bounce buffer pointed to by last trb */
561 + if (usb_urb_dir_out(urb)) {
562 +- len = sg_pcopy_to_buffer(urb->sg, urb->num_sgs,
563 +- seg->bounce_buf, new_buff_len, enqd_len);
564 +- if (len != new_buff_len)
565 +- xhci_warn(xhci,
566 +- "WARN Wrong bounce buffer write length: %zu != %d\n",
567 +- len, new_buff_len);
568 ++ if (urb->num_sgs) {
569 ++ len = sg_pcopy_to_buffer(urb->sg, urb->num_sgs,
570 ++ seg->bounce_buf, new_buff_len, enqd_len);
571 ++ if (len != new_buff_len)
572 ++ xhci_warn(xhci, "WARN Wrong bounce buffer write length: %zu != %d\n",
573 ++ len, new_buff_len);
574 ++ } else {
575 ++ memcpy(seg->bounce_buf, urb->transfer_buffer + enqd_len, new_buff_len);
576 ++ }
577 ++
578 + seg->bounce_dma = dma_map_single(dev, seg->bounce_buf,
579 + max_pkt, DMA_TO_DEVICE);
580 + } else {
581 +diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
582 +index aeb53ec5cc6ab..6b92a57382db3 100644
583 +--- a/drivers/usb/renesas_usbhs/fifo.c
584 ++++ b/drivers/usb/renesas_usbhs/fifo.c
585 +@@ -126,6 +126,7 @@ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
586 + }
587 +
588 + usbhs_pipe_clear_without_sequence(pipe, 0, 0);
589 ++ usbhs_pipe_running(pipe, 0);
590 +
591 + __usbhsf_pkt_del(pkt);
592 + }
593 +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
594 +index 46ec30a2c5168..07a2c72fc3a71 100644
595 +--- a/drivers/usb/serial/cp210x.c
596 ++++ b/drivers/usb/serial/cp210x.c
597 +@@ -61,6 +61,7 @@ static const struct usb_device_id id_table[] = {
598 + { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */
599 + { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */
600 + { USB_DEVICE(0x0908, 0x01FF) }, /* Siemens RUGGEDCOM USB Serial Console */
601 ++ { USB_DEVICE(0x0988, 0x0578) }, /* Teraoka AD2000 */
602 + { USB_DEVICE(0x0B00, 0x3070) }, /* Ingenico 3070 */
603 + { USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */
604 + { USB_DEVICE(0x0BED, 0x1101) }, /* MEI series 2000 Combo Acceptor */
605 +@@ -201,6 +202,7 @@ static const struct usb_device_id id_table[] = {
606 + { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */
607 + { USB_DEVICE(0x1901, 0x0195) }, /* GE B850/B650/B450 CP2104 DP UART interface */
608 + { USB_DEVICE(0x1901, 0x0196) }, /* GE B850 CP2105 DP UART interface */
609 ++ { USB_DEVICE(0x199B, 0xBA30) }, /* LORD WSDA-200-USB */
610 + { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */
611 + { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */
612 + { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */
613 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
614 +index 1024aca252210..cdf25a39fca79 100644
615 +--- a/drivers/usb/serial/option.c
616 ++++ b/drivers/usb/serial/option.c
617 +@@ -425,6 +425,8 @@ static void option_instat_callback(struct urb *urb);
618 + #define CINTERION_PRODUCT_AHXX_2RMNET 0x0084
619 + #define CINTERION_PRODUCT_AHXX_AUDIO 0x0085
620 + #define CINTERION_PRODUCT_CLS8 0x00b0
621 ++#define CINTERION_PRODUCT_MV31_MBIM 0x00b3
622 ++#define CINTERION_PRODUCT_MV31_RMNET 0x00b7
623 +
624 + /* Olivetti products */
625 + #define OLIVETTI_VENDOR_ID 0x0b3c
626 +@@ -1914,6 +1916,10 @@ static const struct usb_device_id option_ids[] = {
627 + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) },
628 + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */
629 + { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) },
630 ++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_MBIM, 0xff),
631 ++ .driver_info = RSVD(3)},
632 ++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_RMNET, 0xff),
633 ++ .driver_info = RSVD(0)},
634 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100),
635 + .driver_info = RSVD(4) },
636 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120),
637 +diff --git a/fs/afs/main.c b/fs/afs/main.c
638 +index 107427688eddd..8ecb127be63f9 100644
639 +--- a/fs/afs/main.c
640 ++++ b/fs/afs/main.c
641 +@@ -190,7 +190,7 @@ static int __init afs_init(void)
642 + goto error_cache;
643 + #endif
644 +
645 +- ret = register_pernet_subsys(&afs_net_ops);
646 ++ ret = register_pernet_device(&afs_net_ops);
647 + if (ret < 0)
648 + goto error_net;
649 +
650 +@@ -210,7 +210,7 @@ static int __init afs_init(void)
651 + error_proc:
652 + afs_fs_exit();
653 + error_fs:
654 +- unregister_pernet_subsys(&afs_net_ops);
655 ++ unregister_pernet_device(&afs_net_ops);
656 + error_net:
657 + #ifdef CONFIG_AFS_FSCACHE
658 + fscache_unregister_netfs(&afs_cache_netfs);
659 +@@ -241,7 +241,7 @@ static void __exit afs_exit(void)
660 +
661 + proc_remove(afs_proc_symlink);
662 + afs_fs_exit();
663 +- unregister_pernet_subsys(&afs_net_ops);
664 ++ unregister_pernet_device(&afs_net_ops);
665 + #ifdef CONFIG_AFS_FSCACHE
666 + fscache_unregister_netfs(&afs_cache_netfs);
667 + #endif
668 +diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
669 +index f6e3c00898254..c7e162c9383dc 100644
670 +--- a/fs/cifs/dir.c
671 ++++ b/fs/cifs/dir.c
672 +@@ -840,6 +840,7 @@ static int
673 + cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
674 + {
675 + struct inode *inode;
676 ++ int rc;
677 +
678 + if (flags & LOOKUP_RCU)
679 + return -ECHILD;
680 +@@ -849,8 +850,25 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
681 + if ((flags & LOOKUP_REVAL) && !CIFS_CACHE_READ(CIFS_I(inode)))
682 + CIFS_I(inode)->time = 0; /* force reval */
683 +
684 +- if (cifs_revalidate_dentry(direntry))
685 +- return 0;
686 ++ rc = cifs_revalidate_dentry(direntry);
687 ++ if (rc) {
688 ++ cifs_dbg(FYI, "cifs_revalidate_dentry failed with rc=%d", rc);
689 ++ switch (rc) {
690 ++ case -ENOENT:
691 ++ case -ESTALE:
692 ++ /*
693 ++ * Those errors mean the dentry is invalid
694 ++ * (file was deleted or recreated)
695 ++ */
696 ++ return 0;
697 ++ default:
698 ++ /*
699 ++ * Otherwise some unexpected error happened
700 ++ * report it as-is to VFS layer
701 ++ */
702 ++ return rc;
703 ++ }
704 ++ }
705 + else {
706 + /*
707 + * If the inode wasn't known to be a dfs entry when
708 +diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
709 +index 48ed43e6aee84..8a44d59947b70 100644
710 +--- a/fs/cifs/smb2pdu.h
711 ++++ b/fs/cifs/smb2pdu.h
712 +@@ -222,7 +222,7 @@ struct smb2_negotiate_req {
713 + __le32 NegotiateContextOffset; /* SMB3.1.1 only. MBZ earlier */
714 + __le16 NegotiateContextCount; /* SMB3.1.1 only. MBZ earlier */
715 + __le16 Reserved2;
716 +- __le16 Dialects[1]; /* One dialect (vers=) at a time for now */
717 ++ __le16 Dialects[4]; /* BB expand this if autonegotiate > 4 dialects */
718 + } __packed;
719 +
720 + /* Dialects */
721 +diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
722 +index 7a24f91af29e4..3a2fea8d211d7 100644
723 +--- a/fs/hugetlbfs/inode.c
724 ++++ b/fs/hugetlbfs/inode.c
725 +@@ -654,9 +654,10 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset,
726 +
727 + mutex_unlock(&hugetlb_fault_mutex_table[hash]);
728 +
729 ++ set_page_huge_active(page);
730 + /*
731 + * unlock_page because locked by add_to_page_cache()
732 +- * page_put due to reference from alloc_huge_page()
733 ++ * put_page() due to reference from alloc_huge_page()
734 + */
735 + unlock_page(page);
736 + put_page(page);
737 +diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
738 +index 800bcad67325c..25be2ab6ff6cc 100644
739 +--- a/fs/overlayfs/dir.c
740 ++++ b/fs/overlayfs/dir.c
741 +@@ -946,8 +946,8 @@ static char *ovl_get_redirect(struct dentry *dentry, bool abs_redirect)
742 +
743 + buflen -= thislen;
744 + memcpy(&buf[buflen], name, thislen);
745 +- tmp = dget_dlock(d->d_parent);
746 + spin_unlock(&d->d_lock);
747 ++ tmp = dget_parent(d);
748 +
749 + dput(d);
750 + d = tmp;
751 +diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
752 +index 4cad0e784b286..b81f9e1d74b0a 100644
753 +--- a/include/linux/elfcore.h
754 ++++ b/include/linux/elfcore.h
755 +@@ -58,6 +58,7 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse
756 + }
757 + #endif
758 +
759 ++#if defined(CONFIG_UM) || defined(CONFIG_IA64)
760 + /*
761 + * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
762 + * extra segments containing the gate DSO contents. Dumping its
763 +@@ -72,5 +73,26 @@ elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset);
764 + extern int
765 + elf_core_write_extra_data(struct coredump_params *cprm);
766 + extern size_t elf_core_extra_data_size(void);
767 ++#else
768 ++static inline Elf_Half elf_core_extra_phdrs(void)
769 ++{
770 ++ return 0;
771 ++}
772 ++
773 ++static inline int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
774 ++{
775 ++ return 1;
776 ++}
777 ++
778 ++static inline int elf_core_write_extra_data(struct coredump_params *cprm)
779 ++{
780 ++ return 1;
781 ++}
782 ++
783 ++static inline size_t elf_core_extra_data_size(void)
784 ++{
785 ++ return 0;
786 ++}
787 ++#endif
788 +
789 + #endif /* _LINUX_ELFCORE_H */
790 +diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
791 +index d34112fb3d526..cae7fd6804488 100644
792 +--- a/include/linux/hugetlb.h
793 ++++ b/include/linux/hugetlb.h
794 +@@ -541,6 +541,9 @@ static inline void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long addr
795 + set_huge_pte_at(mm, addr, ptep, pte);
796 + }
797 + #endif
798 ++
799 ++void set_page_huge_active(struct page *page);
800 ++
801 + #else /* CONFIG_HUGETLB_PAGE */
802 + struct hstate {};
803 + #define alloc_huge_page(v, a, r) NULL
804 +diff --git a/include/linux/msi.h b/include/linux/msi.h
805 +index be8ec813dbfb2..5dd171849a27e 100644
806 +--- a/include/linux/msi.h
807 ++++ b/include/linux/msi.h
808 +@@ -118,6 +118,12 @@ struct msi_desc {
809 + list_for_each_entry((desc), dev_to_msi_list((dev)), list)
810 + #define for_each_msi_entry_safe(desc, tmp, dev) \
811 + list_for_each_entry_safe((desc), (tmp), dev_to_msi_list((dev)), list)
812 ++#define for_each_msi_vector(desc, __irq, dev) \
813 ++ for_each_msi_entry((desc), (dev)) \
814 ++ if ((desc)->irq) \
815 ++ for (__irq = (desc)->irq; \
816 ++ __irq < ((desc)->irq + (desc)->nvec_used); \
817 ++ __irq++)
818 +
819 + #ifdef CONFIG_PCI_MSI
820 + #define first_pci_msi_entry(pdev) first_msi_entry(&(pdev)->dev)
821 +diff --git a/kernel/Makefile b/kernel/Makefile
822 +index ad4b324d89061..01bc1d39b400a 100644
823 +--- a/kernel/Makefile
824 ++++ b/kernel/Makefile
825 +@@ -92,7 +92,6 @@ obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
826 + obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
827 + obj-$(CONFIG_TRACEPOINTS) += tracepoint.o
828 + obj-$(CONFIG_LATENCYTOP) += latencytop.o
829 +-obj-$(CONFIG_ELFCORE) += elfcore.o
830 + obj-$(CONFIG_FUNCTION_TRACER) += trace/
831 + obj-$(CONFIG_TRACING) += trace/
832 + obj-$(CONFIG_TRACE_CLOCK) += trace/
833 +diff --git a/kernel/elfcore.c b/kernel/elfcore.c
834 +deleted file mode 100644
835 +index 57fb4dcff4349..0000000000000
836 +--- a/kernel/elfcore.c
837 ++++ /dev/null
838 +@@ -1,26 +0,0 @@
839 +-// SPDX-License-Identifier: GPL-2.0
840 +-#include <linux/elf.h>
841 +-#include <linux/fs.h>
842 +-#include <linux/mm.h>
843 +-#include <linux/binfmts.h>
844 +-#include <linux/elfcore.h>
845 +-
846 +-Elf_Half __weak elf_core_extra_phdrs(void)
847 +-{
848 +- return 0;
849 +-}
850 +-
851 +-int __weak elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
852 +-{
853 +- return 1;
854 +-}
855 +-
856 +-int __weak elf_core_write_extra_data(struct coredump_params *cprm)
857 +-{
858 +- return 1;
859 +-}
860 +-
861 +-size_t __weak elf_core_extra_data_size(void)
862 +-{
863 +- return 0;
864 +-}
865 +diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
866 +index dc1186ce3ecdb..604974f2afb19 100644
867 +--- a/kernel/irq/msi.c
868 ++++ b/kernel/irq/msi.c
869 +@@ -437,22 +437,22 @@ int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
870 +
871 + can_reserve = msi_check_reservation_mode(domain, info, dev);
872 +
873 +- for_each_msi_entry(desc, dev) {
874 +- virq = desc->irq;
875 +- if (desc->nvec_used == 1)
876 +- dev_dbg(dev, "irq %d for MSI\n", virq);
877 +- else
878 ++ /*
879 ++ * This flag is set by the PCI layer as we need to activate
880 ++ * the MSI entries before the PCI layer enables MSI in the
881 ++ * card. Otherwise the card latches a random msi message.
882 ++ */
883 ++ if (!(info->flags & MSI_FLAG_ACTIVATE_EARLY))
884 ++ goto skip_activate;
885 ++
886 ++ for_each_msi_vector(desc, i, dev) {
887 ++ if (desc->irq == i) {
888 ++ virq = desc->irq;
889 + dev_dbg(dev, "irq [%d-%d] for MSI\n",
890 + virq, virq + desc->nvec_used - 1);
891 +- /*
892 +- * This flag is set by the PCI layer as we need to activate
893 +- * the MSI entries before the PCI layer enables MSI in the
894 +- * card. Otherwise the card latches a random msi message.
895 +- */
896 +- if (!(info->flags & MSI_FLAG_ACTIVATE_EARLY))
897 +- continue;
898 ++ }
899 +
900 +- irq_data = irq_domain_get_irq_data(domain, desc->irq);
901 ++ irq_data = irq_domain_get_irq_data(domain, i);
902 + if (!can_reserve) {
903 + irqd_clr_can_reserve(irq_data);
904 + if (domain->flags & IRQ_DOMAIN_MSI_NOMASK_QUIRK)
905 +@@ -463,28 +463,24 @@ int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
906 + goto cleanup;
907 + }
908 +
909 ++skip_activate:
910 + /*
911 + * If these interrupts use reservation mode, clear the activated bit
912 + * so request_irq() will assign the final vector.
913 + */
914 + if (can_reserve) {
915 +- for_each_msi_entry(desc, dev) {
916 +- irq_data = irq_domain_get_irq_data(domain, desc->irq);
917 ++ for_each_msi_vector(desc, i, dev) {
918 ++ irq_data = irq_domain_get_irq_data(domain, i);
919 + irqd_clr_activated(irq_data);
920 + }
921 + }
922 + return 0;
923 +
924 + cleanup:
925 +- for_each_msi_entry(desc, dev) {
926 +- struct irq_data *irqd;
927 +-
928 +- if (desc->irq == virq)
929 +- break;
930 +-
931 +- irqd = irq_domain_get_irq_data(domain, desc->irq);
932 +- if (irqd_is_activated(irqd))
933 +- irq_domain_deactivate_irq(irqd);
934 ++ for_each_msi_vector(desc, i, dev) {
935 ++ irq_data = irq_domain_get_irq_data(domain, i);
936 ++ if (irqd_is_activated(irq_data))
937 ++ irq_domain_deactivate_irq(irq_data);
938 + }
939 + msi_domain_free_irqs(domain, dev);
940 + return ret;
941 +diff --git a/kernel/kprobes.c b/kernel/kprobes.c
942 +index 2161f519d4812..6d02b78fde01e 100644
943 +--- a/kernel/kprobes.c
944 ++++ b/kernel/kprobes.c
945 +@@ -1945,6 +1945,10 @@ int register_kretprobe(struct kretprobe *rp)
946 + if (!kprobe_on_func_entry(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset))
947 + return -EINVAL;
948 +
949 ++ /* If only rp->kp.addr is specified, check reregistering kprobes */
950 ++ if (rp->kp.addr && check_kprobe_rereg(&rp->kp))
951 ++ return -EINVAL;
952 ++
953 + if (kretprobe_blacklist_size) {
954 + addr = kprobe_addr(&rp->kp);
955 + if (IS_ERR(addr))
956 +diff --git a/mm/huge_memory.c b/mm/huge_memory.c
957 +index d74afc256c07c..cf9e2bbffdc1a 100644
958 +--- a/mm/huge_memory.c
959 ++++ b/mm/huge_memory.c
960 +@@ -2278,7 +2278,7 @@ void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
961 + spinlock_t *ptl;
962 + struct mm_struct *mm = vma->vm_mm;
963 + unsigned long haddr = address & HPAGE_PMD_MASK;
964 +- bool was_locked = false;
965 ++ bool do_unlock_page = false;
966 + pmd_t _pmd;
967 +
968 + mmu_notifier_invalidate_range_start(mm, haddr, haddr + HPAGE_PMD_SIZE);
969 +@@ -2291,7 +2291,6 @@ void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
970 + VM_BUG_ON(freeze && !page);
971 + if (page) {
972 + VM_WARN_ON_ONCE(!PageLocked(page));
973 +- was_locked = true;
974 + if (page != pmd_page(*pmd))
975 + goto out;
976 + }
977 +@@ -2300,19 +2299,29 @@ repeat:
978 + if (pmd_trans_huge(*pmd)) {
979 + if (!page) {
980 + page = pmd_page(*pmd);
981 +- if (unlikely(!trylock_page(page))) {
982 +- get_page(page);
983 +- _pmd = *pmd;
984 +- spin_unlock(ptl);
985 +- lock_page(page);
986 +- spin_lock(ptl);
987 +- if (unlikely(!pmd_same(*pmd, _pmd))) {
988 +- unlock_page(page);
989 ++ /*
990 ++ * An anonymous page must be locked, to ensure that a
991 ++ * concurrent reuse_swap_page() sees stable mapcount;
992 ++ * but reuse_swap_page() is not used on shmem or file,
993 ++ * and page lock must not be taken when zap_pmd_range()
994 ++ * calls __split_huge_pmd() while i_mmap_lock is held.
995 ++ */
996 ++ if (PageAnon(page)) {
997 ++ if (unlikely(!trylock_page(page))) {
998 ++ get_page(page);
999 ++ _pmd = *pmd;
1000 ++ spin_unlock(ptl);
1001 ++ lock_page(page);
1002 ++ spin_lock(ptl);
1003 ++ if (unlikely(!pmd_same(*pmd, _pmd))) {
1004 ++ unlock_page(page);
1005 ++ put_page(page);
1006 ++ page = NULL;
1007 ++ goto repeat;
1008 ++ }
1009 + put_page(page);
1010 +- page = NULL;
1011 +- goto repeat;
1012 + }
1013 +- put_page(page);
1014 ++ do_unlock_page = true;
1015 + }
1016 + }
1017 + if (PageMlocked(page))
1018 +@@ -2322,7 +2331,7 @@ repeat:
1019 + __split_huge_pmd_locked(vma, pmd, haddr, freeze);
1020 + out:
1021 + spin_unlock(ptl);
1022 +- if (!was_locked && page)
1023 ++ if (do_unlock_page)
1024 + unlock_page(page);
1025 + /*
1026 + * No need to double call mmu_notifier->invalidate_range() callback.
1027 +diff --git a/mm/hugetlb.c b/mm/hugetlb.c
1028 +index 0b60ab3966968..df89aed023029 100644
1029 +--- a/mm/hugetlb.c
1030 ++++ b/mm/hugetlb.c
1031 +@@ -68,6 +68,21 @@ DEFINE_SPINLOCK(hugetlb_lock);
1032 + static int num_fault_mutexes;
1033 + struct mutex *hugetlb_fault_mutex_table ____cacheline_aligned_in_smp;
1034 +
1035 ++static inline bool PageHugeFreed(struct page *head)
1036 ++{
1037 ++ return page_private(head + 4) == -1UL;
1038 ++}
1039 ++
1040 ++static inline void SetPageHugeFreed(struct page *head)
1041 ++{
1042 ++ set_page_private(head + 4, -1UL);
1043 ++}
1044 ++
1045 ++static inline void ClearPageHugeFreed(struct page *head)
1046 ++{
1047 ++ set_page_private(head + 4, 0);
1048 ++}
1049 ++
1050 + /* Forward declaration */
1051 + static int hugetlb_acct_memory(struct hstate *h, long delta);
1052 +
1053 +@@ -858,6 +873,7 @@ static void enqueue_huge_page(struct hstate *h, struct page *page)
1054 + list_move(&page->lru, &h->hugepage_freelists[nid]);
1055 + h->free_huge_pages++;
1056 + h->free_huge_pages_node[nid]++;
1057 ++ SetPageHugeFreed(page);
1058 + }
1059 +
1060 + static struct page *dequeue_huge_page_node_exact(struct hstate *h, int nid)
1061 +@@ -875,6 +891,7 @@ static struct page *dequeue_huge_page_node_exact(struct hstate *h, int nid)
1062 + return NULL;
1063 + list_move(&page->lru, &h->hugepage_activelist);
1064 + set_page_refcounted(page);
1065 ++ ClearPageHugeFreed(page);
1066 + h->free_huge_pages--;
1067 + h->free_huge_pages_node[nid]--;
1068 + return page;
1069 +@@ -1196,12 +1213,11 @@ struct hstate *size_to_hstate(unsigned long size)
1070 + */
1071 + bool page_huge_active(struct page *page)
1072 + {
1073 +- VM_BUG_ON_PAGE(!PageHuge(page), page);
1074 +- return PageHead(page) && PagePrivate(&page[1]);
1075 ++ return PageHeadHuge(page) && PagePrivate(&page[1]);
1076 + }
1077 +
1078 + /* never called for tail page */
1079 +-static void set_page_huge_active(struct page *page)
1080 ++void set_page_huge_active(struct page *page)
1081 + {
1082 + VM_BUG_ON_PAGE(!PageHeadHuge(page), page);
1083 + SetPagePrivate(&page[1]);
1084 +@@ -1305,6 +1321,7 @@ static void prep_new_huge_page(struct hstate *h, struct page *page, int nid)
1085 + set_hugetlb_cgroup(page, NULL);
1086 + h->nr_huge_pages++;
1087 + h->nr_huge_pages_node[nid]++;
1088 ++ ClearPageHugeFreed(page);
1089 + spin_unlock(&hugetlb_lock);
1090 + }
1091 +
1092 +@@ -1500,6 +1517,7 @@ int dissolve_free_huge_page(struct page *page)
1093 + {
1094 + int rc = -EBUSY;
1095 +
1096 ++retry:
1097 + /* Not to disrupt normal path by vainly holding hugetlb_lock */
1098 + if (!PageHuge(page))
1099 + return 0;
1100 +@@ -1516,6 +1534,26 @@ int dissolve_free_huge_page(struct page *page)
1101 + int nid = page_to_nid(head);
1102 + if (h->free_huge_pages - h->resv_huge_pages == 0)
1103 + goto out;
1104 ++
1105 ++ /*
1106 ++ * We should make sure that the page is already on the free list
1107 ++ * when it is dissolved.
1108 ++ */
1109 ++ if (unlikely(!PageHugeFreed(head))) {
1110 ++ spin_unlock(&hugetlb_lock);
1111 ++ cond_resched();
1112 ++
1113 ++ /*
1114 ++ * Theoretically, we should return -EBUSY when we
1115 ++ * encounter this race. In fact, we have a chance
1116 ++ * to successfully dissolve the page if we do a
1117 ++ * retry. Because the race window is quite small.
1118 ++ * If we seize this opportunity, it is an optimization
1119 ++ * for increasing the success rate of dissolving page.
1120 ++ */
1121 ++ goto retry;
1122 ++ }
1123 ++
1124 + /*
1125 + * Move PageHWPoison flag from head page to the raw error page,
1126 + * which makes any subpages rather than the error page reusable.
1127 +@@ -4940,9 +4978,9 @@ bool isolate_huge_page(struct page *page, struct list_head *list)
1128 + {
1129 + bool ret = true;
1130 +
1131 +- VM_BUG_ON_PAGE(!PageHead(page), page);
1132 + spin_lock(&hugetlb_lock);
1133 +- if (!page_huge_active(page) || !get_page_unless_zero(page)) {
1134 ++ if (!PageHeadHuge(page) || !page_huge_active(page) ||
1135 ++ !get_page_unless_zero(page)) {
1136 + ret = false;
1137 + goto unlock;
1138 + }
1139 +diff --git a/mm/memblock.c b/mm/memblock.c
1140 +index bb4e32c6b19e9..4f7c5c3c442c3 100644
1141 +--- a/mm/memblock.c
1142 ++++ b/mm/memblock.c
1143 +@@ -234,14 +234,6 @@ __memblock_find_range_top_down(phys_addr_t start, phys_addr_t end,
1144 + *
1145 + * Find @size free area aligned to @align in the specified range and node.
1146 + *
1147 +- * When allocation direction is bottom-up, the @start should be greater
1148 +- * than the end of the kernel image. Otherwise, it will be trimmed. The
1149 +- * reason is that we want the bottom-up allocation just near the kernel
1150 +- * image so it is highly likely that the allocated memory and the kernel
1151 +- * will reside in the same node.
1152 +- *
1153 +- * If bottom-up allocation failed, will try to allocate memory top-down.
1154 +- *
1155 + * Return:
1156 + * Found address on success, 0 on failure.
1157 + */
1158 +@@ -250,8 +242,6 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size,
1159 + phys_addr_t end, int nid,
1160 + enum memblock_flags flags)
1161 + {
1162 +- phys_addr_t kernel_end, ret;
1163 +-
1164 + /* pump up @end */
1165 + if (end == MEMBLOCK_ALLOC_ACCESSIBLE)
1166 + end = memblock.current_limit;
1167 +@@ -259,40 +249,13 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size,
1168 + /* avoid allocating the first page */
1169 + start = max_t(phys_addr_t, start, PAGE_SIZE);
1170 + end = max(start, end);
1171 +- kernel_end = __pa_symbol(_end);
1172 +-
1173 +- /*
1174 +- * try bottom-up allocation only when bottom-up mode
1175 +- * is set and @end is above the kernel image.
1176 +- */
1177 +- if (memblock_bottom_up() && end > kernel_end) {
1178 +- phys_addr_t bottom_up_start;
1179 +-
1180 +- /* make sure we will allocate above the kernel */
1181 +- bottom_up_start = max(start, kernel_end);
1182 +
1183 +- /* ok, try bottom-up allocation first */
1184 +- ret = __memblock_find_range_bottom_up(bottom_up_start, end,
1185 +- size, align, nid, flags);
1186 +- if (ret)
1187 +- return ret;
1188 +-
1189 +- /*
1190 +- * we always limit bottom-up allocation above the kernel,
1191 +- * but top-down allocation doesn't have the limit, so
1192 +- * retrying top-down allocation may succeed when bottom-up
1193 +- * allocation failed.
1194 +- *
1195 +- * bottom-up allocation is expected to be fail very rarely,
1196 +- * so we use WARN_ONCE() here to see the stack trace if
1197 +- * fail happens.
1198 +- */
1199 +- WARN_ONCE(IS_ENABLED(CONFIG_MEMORY_HOTREMOVE),
1200 +- "memblock: bottom-up allocation failed, memory hotremove may be affected\n");
1201 +- }
1202 +-
1203 +- return __memblock_find_range_top_down(start, end, size, align, nid,
1204 +- flags);
1205 ++ if (memblock_bottom_up())
1206 ++ return __memblock_find_range_bottom_up(start, end, size, align,
1207 ++ nid, flags);
1208 ++ else
1209 ++ return __memblock_find_range_top_down(start, end, size, align,
1210 ++ nid, flags);
1211 + }
1212 +
1213 + /**
1214 +diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
1215 +index 1cad731039c37..bdd073ea300ae 100644
1216 +--- a/net/ipv4/ip_tunnel.c
1217 ++++ b/net/ipv4/ip_tunnel.c
1218 +@@ -330,7 +330,7 @@ static int ip_tunnel_bind_dev(struct net_device *dev)
1219 + }
1220 +
1221 + dev->needed_headroom = t_hlen + hlen;
1222 +- mtu -= (dev->hard_header_len + t_hlen);
1223 ++ mtu -= t_hlen;
1224 +
1225 + if (mtu < IPV4_MIN_MTU)
1226 + mtu = IPV4_MIN_MTU;
1227 +@@ -360,7 +360,7 @@ static struct ip_tunnel *ip_tunnel_create(struct net *net,
1228 + nt = netdev_priv(dev);
1229 + t_hlen = nt->hlen + sizeof(struct iphdr);
1230 + dev->min_mtu = ETH_MIN_MTU;
1231 +- dev->max_mtu = IP_MAX_MTU - dev->hard_header_len - t_hlen;
1232 ++ dev->max_mtu = IP_MAX_MTU - t_hlen;
1233 + ip_tunnel_add(itn, nt);
1234 + return nt;
1235 +
1236 +@@ -502,12 +502,11 @@ static int tnl_update_pmtu(struct net_device *dev, struct sk_buff *skb,
1237 + const struct iphdr *inner_iph)
1238 + {
1239 + struct ip_tunnel *tunnel = netdev_priv(dev);
1240 +- int pkt_size = skb->len - tunnel->hlen - dev->hard_header_len;
1241 ++ int pkt_size = skb->len - tunnel->hlen;
1242 + int mtu;
1243 +
1244 + if (df)
1245 +- mtu = dst_mtu(&rt->dst) - dev->hard_header_len
1246 +- - sizeof(struct iphdr) - tunnel->hlen;
1247 ++ mtu = dst_mtu(&rt->dst) - (sizeof(struct iphdr) + tunnel->hlen);
1248 + else
1249 + mtu = skb_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
1250 +
1251 +@@ -935,7 +934,7 @@ int __ip_tunnel_change_mtu(struct net_device *dev, int new_mtu, bool strict)
1252 + {
1253 + struct ip_tunnel *tunnel = netdev_priv(dev);
1254 + int t_hlen = tunnel->hlen + sizeof(struct iphdr);
1255 +- int max_mtu = IP_MAX_MTU - dev->hard_header_len - t_hlen;
1256 ++ int max_mtu = IP_MAX_MTU - t_hlen;
1257 +
1258 + if (new_mtu < ETH_MIN_MTU)
1259 + return -EINVAL;
1260 +@@ -1112,10 +1111,9 @@ int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[],
1261 +
1262 + mtu = ip_tunnel_bind_dev(dev);
1263 + if (tb[IFLA_MTU]) {
1264 +- unsigned int max = IP_MAX_MTU - dev->hard_header_len - nt->hlen;
1265 ++ unsigned int max = IP_MAX_MTU - (nt->hlen + sizeof(struct iphdr));
1266 +
1267 +- mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU,
1268 +- (unsigned int)(max - sizeof(struct iphdr)));
1269 ++ mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU, max);
1270 + }
1271 +
1272 + err = dev_set_mtu(dev, mtu);
1273 +diff --git a/net/lapb/lapb_out.c b/net/lapb/lapb_out.c
1274 +index eda726e22f645..621c66f001177 100644
1275 +--- a/net/lapb/lapb_out.c
1276 ++++ b/net/lapb/lapb_out.c
1277 +@@ -87,7 +87,8 @@ void lapb_kick(struct lapb_cb *lapb)
1278 + skb = skb_dequeue(&lapb->write_queue);
1279 +
1280 + do {
1281 +- if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {
1282 ++ skbn = skb_copy(skb, GFP_ATOMIC);
1283 ++ if (!skbn) {
1284 + skb_queue_head(&lapb->write_queue, skb);
1285 + break;
1286 + }
1287 +diff --git a/net/mac80211/driver-ops.c b/net/mac80211/driver-ops.c
1288 +index f783d1377d9a8..9f0f437a09b95 100644
1289 +--- a/net/mac80211/driver-ops.c
1290 ++++ b/net/mac80211/driver-ops.c
1291 +@@ -128,8 +128,11 @@ int drv_sta_state(struct ieee80211_local *local,
1292 + } else if (old_state == IEEE80211_STA_AUTH &&
1293 + new_state == IEEE80211_STA_ASSOC) {
1294 + ret = drv_sta_add(local, sdata, &sta->sta);
1295 +- if (ret == 0)
1296 ++ if (ret == 0) {
1297 + sta->uploaded = true;
1298 ++ if (rcu_access_pointer(sta->sta.rates))
1299 ++ drv_sta_rate_tbl_update(local, sdata, &sta->sta);
1300 ++ }
1301 + } else if (old_state == IEEE80211_STA_ASSOC &&
1302 + new_state == IEEE80211_STA_AUTH) {
1303 + drv_sta_remove(local, sdata, &sta->sta);
1304 +diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
1305 +index 76f303fda3eda..954b932fd7b86 100644
1306 +--- a/net/mac80211/rate.c
1307 ++++ b/net/mac80211/rate.c
1308 +@@ -941,7 +941,8 @@ int rate_control_set_rates(struct ieee80211_hw *hw,
1309 + if (old)
1310 + kfree_rcu(old, rcu_head);
1311 +
1312 +- drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta);
1313 ++ if (sta->uploaded)
1314 ++ drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta);
1315 +
1316 + ieee80211_sta_set_expected_throughput(pubsta, sta_get_expected_throughput(sta));
1317 +
1318 +diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
1319 +index 57f835d2442ec..fb7e3fffcb5ef 100644
1320 +--- a/net/rxrpc/af_rxrpc.c
1321 ++++ b/net/rxrpc/af_rxrpc.c
1322 +@@ -1010,7 +1010,7 @@ static int __init af_rxrpc_init(void)
1323 + goto error_security;
1324 + }
1325 +
1326 +- ret = register_pernet_subsys(&rxrpc_net_ops);
1327 ++ ret = register_pernet_device(&rxrpc_net_ops);
1328 + if (ret)
1329 + goto error_pernet;
1330 +
1331 +@@ -1055,7 +1055,7 @@ error_key_type:
1332 + error_sock:
1333 + proto_unregister(&rxrpc_proto);
1334 + error_proto:
1335 +- unregister_pernet_subsys(&rxrpc_net_ops);
1336 ++ unregister_pernet_device(&rxrpc_net_ops);
1337 + error_pernet:
1338 + rxrpc_exit_security();
1339 + error_security:
1340 +@@ -1077,7 +1077,7 @@ static void __exit af_rxrpc_exit(void)
1341 + unregister_key_type(&key_type_rxrpc);
1342 + sock_unregister(PF_RXRPC);
1343 + proto_unregister(&rxrpc_proto);
1344 +- unregister_pernet_subsys(&rxrpc_net_ops);
1345 ++ unregister_pernet_device(&rxrpc_net_ops);
1346 + ASSERTCMP(atomic_read(&rxrpc_n_tx_skbs), ==, 0);
1347 + ASSERTCMP(atomic_read(&rxrpc_n_rx_skbs), ==, 0);
1348 +