1 |
commit: 76e8d94b9affef2279cd7db6939eaf09a1aac056 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 25 10:27:17 2018 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 25 10:27:17 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=76e8d94b |
7 |
|
8 |
Linux patch 4.14.58 |
9 |
|
10 |
0000_README | 4 + |
11 |
1057_linux-4.14.58.patch | 1431 ++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 1435 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index d3e06d1..7e760df 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -271,6 +271,10 @@ Patch: 1056_linux-4.14.57.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.14.57 |
21 |
|
22 |
+Patch: 1057_linux-4.14.58.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.14.58 |
25 |
+ |
26 |
Patch: 1500_XATTR_USER_PREFIX.patch |
27 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
28 |
Desc: Support for namespace user.pax.* on tmpfs. |
29 |
|
30 |
diff --git a/1057_linux-4.14.58.patch b/1057_linux-4.14.58.patch |
31 |
new file mode 100644 |
32 |
index 0000000..ba096a0 |
33 |
--- /dev/null |
34 |
+++ b/1057_linux-4.14.58.patch |
35 |
@@ -0,0 +1,1431 @@ |
36 |
+diff --git a/Makefile b/Makefile |
37 |
+index a44d6b2adb76..ffc9b4e3867e 100644 |
38 |
+--- a/Makefile |
39 |
++++ b/Makefile |
40 |
+@@ -1,7 +1,7 @@ |
41 |
+ # SPDX-License-Identifier: GPL-2.0 |
42 |
+ VERSION = 4 |
43 |
+ PATCHLEVEL = 14 |
44 |
+-SUBLEVEL = 57 |
45 |
++SUBLEVEL = 58 |
46 |
+ EXTRAVERSION = |
47 |
+ NAME = Petit Gorille |
48 |
+ |
49 |
+diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c |
50 |
+index 75a5c35a2067..a48976dc9bcd 100644 |
51 |
+--- a/arch/alpha/kernel/osf_sys.c |
52 |
++++ b/arch/alpha/kernel/osf_sys.c |
53 |
+@@ -1183,13 +1183,10 @@ SYSCALL_DEFINE2(osf_getrusage, int, who, struct rusage32 __user *, ru) |
54 |
+ SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options, |
55 |
+ struct rusage32 __user *, ur) |
56 |
+ { |
57 |
+- unsigned int status = 0; |
58 |
+ struct rusage r; |
59 |
+- long err = kernel_wait4(pid, &status, options, &r); |
60 |
++ long err = kernel_wait4(pid, ustatus, options, &r); |
61 |
+ if (err <= 0) |
62 |
+ return err; |
63 |
+- if (put_user(status, ustatus)) |
64 |
+- return -EFAULT; |
65 |
+ if (!ur) |
66 |
+ return err; |
67 |
+ if (put_tv32(&ur->ru_utime, &r.ru_utime)) |
68 |
+diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig |
69 |
+index 4383313b064a..5c8caf85c350 100644 |
70 |
+--- a/arch/arc/Kconfig |
71 |
++++ b/arch/arc/Kconfig |
72 |
+@@ -408,7 +408,7 @@ config ARC_HAS_DIV_REM |
73 |
+ |
74 |
+ config ARC_HAS_ACCL_REGS |
75 |
+ bool "Reg Pair ACCL:ACCH (FPU and/or MPY > 6)" |
76 |
+- default n |
77 |
++ default y |
78 |
+ help |
79 |
+ Depending on the configuration, CPU can contain accumulator reg-pair |
80 |
+ (also referred to as r58:r59). These can also be used by gcc as GPR so |
81 |
+diff --git a/arch/arc/configs/axs101_defconfig b/arch/arc/configs/axs101_defconfig |
82 |
+index ec7c849a5c8e..a8242362e551 100644 |
83 |
+--- a/arch/arc/configs/axs101_defconfig |
84 |
++++ b/arch/arc/configs/axs101_defconfig |
85 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
86 |
+ # CONFIG_UTS_NS is not set |
87 |
+ # CONFIG_PID_NS is not set |
88 |
+ CONFIG_BLK_DEV_INITRD=y |
89 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs/" |
90 |
+ CONFIG_EMBEDDED=y |
91 |
+ CONFIG_PERF_EVENTS=y |
92 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
93 |
+diff --git a/arch/arc/configs/axs103_defconfig b/arch/arc/configs/axs103_defconfig |
94 |
+index 63d3cf69e0b0..ef3c31cd7737 100644 |
95 |
+--- a/arch/arc/configs/axs103_defconfig |
96 |
++++ b/arch/arc/configs/axs103_defconfig |
97 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
98 |
+ # CONFIG_UTS_NS is not set |
99 |
+ # CONFIG_PID_NS is not set |
100 |
+ CONFIG_BLK_DEV_INITRD=y |
101 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
102 |
+ CONFIG_EMBEDDED=y |
103 |
+ CONFIG_PERF_EVENTS=y |
104 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
105 |
+diff --git a/arch/arc/configs/axs103_smp_defconfig b/arch/arc/configs/axs103_smp_defconfig |
106 |
+index f613ecac14a7..1757ac9cecbc 100644 |
107 |
+--- a/arch/arc/configs/axs103_smp_defconfig |
108 |
++++ b/arch/arc/configs/axs103_smp_defconfig |
109 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
110 |
+ # CONFIG_UTS_NS is not set |
111 |
+ # CONFIG_PID_NS is not set |
112 |
+ CONFIG_BLK_DEV_INITRD=y |
113 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
114 |
+ CONFIG_EMBEDDED=y |
115 |
+ CONFIG_PERF_EVENTS=y |
116 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
117 |
+diff --git a/arch/arc/configs/haps_hs_defconfig b/arch/arc/configs/haps_hs_defconfig |
118 |
+index db04ea4dd2d9..aa8240a92b60 100644 |
119 |
+--- a/arch/arc/configs/haps_hs_defconfig |
120 |
++++ b/arch/arc/configs/haps_hs_defconfig |
121 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
122 |
+ # CONFIG_UTS_NS is not set |
123 |
+ # CONFIG_PID_NS is not set |
124 |
+ CONFIG_BLK_DEV_INITRD=y |
125 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
126 |
+ CONFIG_EXPERT=y |
127 |
+ CONFIG_PERF_EVENTS=y |
128 |
+ # CONFIG_COMPAT_BRK is not set |
129 |
+diff --git a/arch/arc/configs/haps_hs_smp_defconfig b/arch/arc/configs/haps_hs_smp_defconfig |
130 |
+index 3507be2af6fe..bc5a24ea6cf7 100644 |
131 |
+--- a/arch/arc/configs/haps_hs_smp_defconfig |
132 |
++++ b/arch/arc/configs/haps_hs_smp_defconfig |
133 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
134 |
+ # CONFIG_UTS_NS is not set |
135 |
+ # CONFIG_PID_NS is not set |
136 |
+ CONFIG_BLK_DEV_INITRD=y |
137 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
138 |
+ CONFIG_EMBEDDED=y |
139 |
+ CONFIG_PERF_EVENTS=y |
140 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
141 |
+diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig |
142 |
+index 7b8f8faf8a24..762b1fcd93dc 100644 |
143 |
+--- a/arch/arc/configs/hsdk_defconfig |
144 |
++++ b/arch/arc/configs/hsdk_defconfig |
145 |
+@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y |
146 |
+ # CONFIG_UTS_NS is not set |
147 |
+ # CONFIG_PID_NS is not set |
148 |
+ CONFIG_BLK_DEV_INITRD=y |
149 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
150 |
+ CONFIG_EMBEDDED=y |
151 |
+ CONFIG_PERF_EVENTS=y |
152 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
153 |
+diff --git a/arch/arc/configs/nsim_700_defconfig b/arch/arc/configs/nsim_700_defconfig |
154 |
+index 6dff83a238b8..b1a78222699c 100644 |
155 |
+--- a/arch/arc/configs/nsim_700_defconfig |
156 |
++++ b/arch/arc/configs/nsim_700_defconfig |
157 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
158 |
+ # CONFIG_UTS_NS is not set |
159 |
+ # CONFIG_PID_NS is not set |
160 |
+ CONFIG_BLK_DEV_INITRD=y |
161 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs/" |
162 |
+ CONFIG_KALLSYMS_ALL=y |
163 |
+ CONFIG_EMBEDDED=y |
164 |
+ CONFIG_PERF_EVENTS=y |
165 |
+diff --git a/arch/arc/configs/nsim_hs_defconfig b/arch/arc/configs/nsim_hs_defconfig |
166 |
+index 31ee51b987e7..217d7ea3c956 100644 |
167 |
+--- a/arch/arc/configs/nsim_hs_defconfig |
168 |
++++ b/arch/arc/configs/nsim_hs_defconfig |
169 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
170 |
+ # CONFIG_UTS_NS is not set |
171 |
+ # CONFIG_PID_NS is not set |
172 |
+ CONFIG_BLK_DEV_INITRD=y |
173 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
174 |
+ CONFIG_KALLSYMS_ALL=y |
175 |
+ CONFIG_EMBEDDED=y |
176 |
+ CONFIG_PERF_EVENTS=y |
177 |
+diff --git a/arch/arc/configs/nsim_hs_smp_defconfig b/arch/arc/configs/nsim_hs_smp_defconfig |
178 |
+index 8d3b1f67cae4..e733e4f1a320 100644 |
179 |
+--- a/arch/arc/configs/nsim_hs_smp_defconfig |
180 |
++++ b/arch/arc/configs/nsim_hs_smp_defconfig |
181 |
+@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y |
182 |
+ # CONFIG_UTS_NS is not set |
183 |
+ # CONFIG_PID_NS is not set |
184 |
+ CONFIG_BLK_DEV_INITRD=y |
185 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs_hs/" |
186 |
+ CONFIG_KALLSYMS_ALL=y |
187 |
+ CONFIG_EMBEDDED=y |
188 |
+ CONFIG_PERF_EVENTS=y |
189 |
+diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig |
190 |
+index 6168ce2ac2ef..14377b8234f7 100644 |
191 |
+--- a/arch/arc/configs/nsimosci_defconfig |
192 |
++++ b/arch/arc/configs/nsimosci_defconfig |
193 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
194 |
+ # CONFIG_UTS_NS is not set |
195 |
+ # CONFIG_PID_NS is not set |
196 |
+ CONFIG_BLK_DEV_INITRD=y |
197 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs/" |
198 |
+ CONFIG_KALLSYMS_ALL=y |
199 |
+ CONFIG_EMBEDDED=y |
200 |
+ CONFIG_PERF_EVENTS=y |
201 |
+diff --git a/arch/arc/configs/nsimosci_hs_defconfig b/arch/arc/configs/nsimosci_hs_defconfig |
202 |
+index a70bdeb2b3fd..7e61c923a3cd 100644 |
203 |
+--- a/arch/arc/configs/nsimosci_hs_defconfig |
204 |
++++ b/arch/arc/configs/nsimosci_hs_defconfig |
205 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
206 |
+ # CONFIG_UTS_NS is not set |
207 |
+ # CONFIG_PID_NS is not set |
208 |
+ CONFIG_BLK_DEV_INITRD=y |
209 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs_hs/" |
210 |
+ CONFIG_KALLSYMS_ALL=y |
211 |
+ CONFIG_EMBEDDED=y |
212 |
+ CONFIG_PERF_EVENTS=y |
213 |
+diff --git a/arch/arc/configs/nsimosci_hs_smp_defconfig b/arch/arc/configs/nsimosci_hs_smp_defconfig |
214 |
+index ef96406c446e..299fbe8003b2 100644 |
215 |
+--- a/arch/arc/configs/nsimosci_hs_smp_defconfig |
216 |
++++ b/arch/arc/configs/nsimosci_hs_smp_defconfig |
217 |
+@@ -9,7 +9,6 @@ CONFIG_IKCONFIG_PROC=y |
218 |
+ # CONFIG_UTS_NS is not set |
219 |
+ # CONFIG_PID_NS is not set |
220 |
+ CONFIG_BLK_DEV_INITRD=y |
221 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs_hs/" |
222 |
+ CONFIG_PERF_EVENTS=y |
223 |
+ # CONFIG_COMPAT_BRK is not set |
224 |
+ CONFIG_KPROBES=y |
225 |
+diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h |
226 |
+index 109baa06831c..09ddddf71cc5 100644 |
227 |
+--- a/arch/arc/include/asm/page.h |
228 |
++++ b/arch/arc/include/asm/page.h |
229 |
+@@ -105,7 +105,7 @@ typedef pte_t * pgtable_t; |
230 |
+ #define virt_addr_valid(kaddr) pfn_valid(virt_to_pfn(kaddr)) |
231 |
+ |
232 |
+ /* Default Permissions for stack/heaps pages (Non Executable) */ |
233 |
+-#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE) |
234 |
++#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
235 |
+ |
236 |
+ #define WANT_PAGE_VIRTUAL 1 |
237 |
+ |
238 |
+diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h |
239 |
+index 08fe33830d4b..77676e18da69 100644 |
240 |
+--- a/arch/arc/include/asm/pgtable.h |
241 |
++++ b/arch/arc/include/asm/pgtable.h |
242 |
+@@ -379,7 +379,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, |
243 |
+ |
244 |
+ /* Decode a PTE containing swap "identifier "into constituents */ |
245 |
+ #define __swp_type(pte_lookalike) (((pte_lookalike).val) & 0x1f) |
246 |
+-#define __swp_offset(pte_lookalike) ((pte_lookalike).val << 13) |
247 |
++#define __swp_offset(pte_lookalike) ((pte_lookalike).val >> 13) |
248 |
+ |
249 |
+ /* NOPs, to keep generic kernel happy */ |
250 |
+ #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) |
251 |
+diff --git a/arch/arc/plat-hsdk/Kconfig b/arch/arc/plat-hsdk/Kconfig |
252 |
+index 19ab3cf98f0f..fcc9a9e27e9c 100644 |
253 |
+--- a/arch/arc/plat-hsdk/Kconfig |
254 |
++++ b/arch/arc/plat-hsdk/Kconfig |
255 |
+@@ -7,5 +7,7 @@ |
256 |
+ |
257 |
+ menuconfig ARC_SOC_HSDK |
258 |
+ bool "ARC HS Development Kit SOC" |
259 |
++ depends on ISA_ARCV2 |
260 |
++ select ARC_HAS_ACCL_REGS |
261 |
+ select CLK_HSDK |
262 |
+ select RESET_HSDK |
263 |
+diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S |
264 |
+index e35cebd45c35..4efbde0984b2 100644 |
265 |
+--- a/arch/powerpc/kernel/idle_book3s.S |
266 |
++++ b/arch/powerpc/kernel/idle_book3s.S |
267 |
+@@ -140,6 +140,8 @@ power9_restore_additional_sprs: |
268 |
+ ld r4, STOP_MMCR2(r13) |
269 |
+ mtspr SPRN_MMCR1, r3 |
270 |
+ mtspr SPRN_MMCR2, r4 |
271 |
++ ld r4, PACA_SPRG_VDSO(r13) |
272 |
++ mtspr SPRN_SPRG3, r4 |
273 |
+ blr |
274 |
+ |
275 |
+ /* |
276 |
+diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c |
277 |
+index 10b39d44981c..25386be0d757 100644 |
278 |
+--- a/arch/x86/events/intel/ds.c |
279 |
++++ b/arch/x86/events/intel/ds.c |
280 |
+@@ -410,9 +410,11 @@ static int alloc_bts_buffer(int cpu) |
281 |
+ ds->bts_buffer_base = (unsigned long) cea; |
282 |
+ ds_update_cea(cea, buffer, BTS_BUFFER_SIZE, PAGE_KERNEL); |
283 |
+ ds->bts_index = ds->bts_buffer_base; |
284 |
+- max = BTS_RECORD_SIZE * (BTS_BUFFER_SIZE / BTS_RECORD_SIZE); |
285 |
+- ds->bts_absolute_maximum = ds->bts_buffer_base + max; |
286 |
+- ds->bts_interrupt_threshold = ds->bts_absolute_maximum - (max / 16); |
287 |
++ max = BTS_BUFFER_SIZE / BTS_RECORD_SIZE; |
288 |
++ ds->bts_absolute_maximum = ds->bts_buffer_base + |
289 |
++ max * BTS_RECORD_SIZE; |
290 |
++ ds->bts_interrupt_threshold = ds->bts_absolute_maximum - |
291 |
++ (max / 16) * BTS_RECORD_SIZE; |
292 |
+ return 0; |
293 |
+ } |
294 |
+ |
295 |
+diff --git a/arch/x86/include/asm/apm.h b/arch/x86/include/asm/apm.h |
296 |
+index c356098b6fb9..4d4015ddcf26 100644 |
297 |
+--- a/arch/x86/include/asm/apm.h |
298 |
++++ b/arch/x86/include/asm/apm.h |
299 |
+@@ -7,8 +7,6 @@ |
300 |
+ #ifndef _ASM_X86_MACH_DEFAULT_APM_H |
301 |
+ #define _ASM_X86_MACH_DEFAULT_APM_H |
302 |
+ |
303 |
+-#include <asm/nospec-branch.h> |
304 |
+- |
305 |
+ #ifdef APM_ZERO_SEGS |
306 |
+ # define APM_DO_ZERO_SEGS \ |
307 |
+ "pushl %%ds\n\t" \ |
308 |
+@@ -34,7 +32,6 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in, |
309 |
+ * N.B. We do NOT need a cld after the BIOS call |
310 |
+ * because we always save and restore the flags. |
311 |
+ */ |
312 |
+- firmware_restrict_branch_speculation_start(); |
313 |
+ __asm__ __volatile__(APM_DO_ZERO_SEGS |
314 |
+ "pushl %%edi\n\t" |
315 |
+ "pushl %%ebp\n\t" |
316 |
+@@ -47,7 +44,6 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in, |
317 |
+ "=S" (*esi) |
318 |
+ : "a" (func), "b" (ebx_in), "c" (ecx_in) |
319 |
+ : "memory", "cc"); |
320 |
+- firmware_restrict_branch_speculation_end(); |
321 |
+ } |
322 |
+ |
323 |
+ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in, |
324 |
+@@ -60,7 +56,6 @@ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in, |
325 |
+ * N.B. We do NOT need a cld after the BIOS call |
326 |
+ * because we always save and restore the flags. |
327 |
+ */ |
328 |
+- firmware_restrict_branch_speculation_start(); |
329 |
+ __asm__ __volatile__(APM_DO_ZERO_SEGS |
330 |
+ "pushl %%edi\n\t" |
331 |
+ "pushl %%ebp\n\t" |
332 |
+@@ -73,7 +68,6 @@ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in, |
333 |
+ "=S" (si) |
334 |
+ : "a" (func), "b" (ebx_in), "c" (ecx_in) |
335 |
+ : "memory", "cc"); |
336 |
+- firmware_restrict_branch_speculation_end(); |
337 |
+ return error; |
338 |
+ } |
339 |
+ |
340 |
+diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c |
341 |
+index 2a7fd56e67b3..63d3e6a6b5ef 100644 |
342 |
+--- a/arch/x86/kernel/apm_32.c |
343 |
++++ b/arch/x86/kernel/apm_32.c |
344 |
+@@ -240,6 +240,7 @@ |
345 |
+ #include <asm/olpc.h> |
346 |
+ #include <asm/paravirt.h> |
347 |
+ #include <asm/reboot.h> |
348 |
++#include <asm/nospec-branch.h> |
349 |
+ |
350 |
+ #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT) |
351 |
+ extern int (*console_blank_hook)(int); |
352 |
+@@ -614,11 +615,13 @@ static long __apm_bios_call(void *_call) |
353 |
+ gdt[0x40 / 8] = bad_bios_desc; |
354 |
+ |
355 |
+ apm_irq_save(flags); |
356 |
++ firmware_restrict_branch_speculation_start(); |
357 |
+ APM_DO_SAVE_SEGS; |
358 |
+ apm_bios_call_asm(call->func, call->ebx, call->ecx, |
359 |
+ &call->eax, &call->ebx, &call->ecx, &call->edx, |
360 |
+ &call->esi); |
361 |
+ APM_DO_RESTORE_SEGS; |
362 |
++ firmware_restrict_branch_speculation_end(); |
363 |
+ apm_irq_restore(flags); |
364 |
+ gdt[0x40 / 8] = save_desc_40; |
365 |
+ put_cpu(); |
366 |
+@@ -690,10 +693,12 @@ static long __apm_bios_call_simple(void *_call) |
367 |
+ gdt[0x40 / 8] = bad_bios_desc; |
368 |
+ |
369 |
+ apm_irq_save(flags); |
370 |
++ firmware_restrict_branch_speculation_start(); |
371 |
+ APM_DO_SAVE_SEGS; |
372 |
+ error = apm_bios_call_simple_asm(call->func, call->ebx, call->ecx, |
373 |
+ &call->eax); |
374 |
+ APM_DO_RESTORE_SEGS; |
375 |
++ firmware_restrict_branch_speculation_end(); |
376 |
+ apm_irq_restore(flags); |
377 |
+ gdt[0x40 / 8] = save_desc_40; |
378 |
+ put_cpu(); |
379 |
+diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c |
380 |
+index 58f887f5e036..98e4e4dc4a3b 100644 |
381 |
+--- a/arch/x86/kernel/cpu/mcheck/mce.c |
382 |
++++ b/arch/x86/kernel/cpu/mcheck/mce.c |
383 |
+@@ -2150,9 +2150,6 @@ static ssize_t store_int_with_restart(struct device *s, |
384 |
+ if (check_interval == old_check_interval) |
385 |
+ return ret; |
386 |
+ |
387 |
+- if (check_interval < 1) |
388 |
+- check_interval = 1; |
389 |
+- |
390 |
+ mutex_lock(&mce_sysfs_mutex); |
391 |
+ mce_restart(); |
392 |
+ mutex_unlock(&mce_sysfs_mutex); |
393 |
+diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c |
394 |
+index a905bbb45667..114dfe67015b 100644 |
395 |
+--- a/drivers/cpufreq/intel_pstate.c |
396 |
++++ b/drivers/cpufreq/intel_pstate.c |
397 |
+@@ -2188,6 +2188,18 @@ static bool __init intel_pstate_no_acpi_pss(void) |
398 |
+ return true; |
399 |
+ } |
400 |
+ |
401 |
++static bool __init intel_pstate_no_acpi_pcch(void) |
402 |
++{ |
403 |
++ acpi_status status; |
404 |
++ acpi_handle handle; |
405 |
++ |
406 |
++ status = acpi_get_handle(NULL, "\\_SB", &handle); |
407 |
++ if (ACPI_FAILURE(status)) |
408 |
++ return true; |
409 |
++ |
410 |
++ return !acpi_has_method(handle, "PCCH"); |
411 |
++} |
412 |
++ |
413 |
+ static bool __init intel_pstate_has_acpi_ppc(void) |
414 |
+ { |
415 |
+ int i; |
416 |
+@@ -2247,7 +2259,10 @@ static bool __init intel_pstate_platform_pwr_mgmt_exists(void) |
417 |
+ |
418 |
+ switch (plat_info[idx].data) { |
419 |
+ case PSS: |
420 |
+- return intel_pstate_no_acpi_pss(); |
421 |
++ if (!intel_pstate_no_acpi_pss()) |
422 |
++ return false; |
423 |
++ |
424 |
++ return intel_pstate_no_acpi_pcch(); |
425 |
+ case PPC: |
426 |
+ return intel_pstate_has_acpi_ppc() && !force_load; |
427 |
+ } |
428 |
+diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c |
429 |
+index 3f0ce2ae35ee..0c56c9759672 100644 |
430 |
+--- a/drivers/cpufreq/pcc-cpufreq.c |
431 |
++++ b/drivers/cpufreq/pcc-cpufreq.c |
432 |
+@@ -580,6 +580,10 @@ static int __init pcc_cpufreq_init(void) |
433 |
+ { |
434 |
+ int ret; |
435 |
+ |
436 |
++ /* Skip initialization if another cpufreq driver is there. */ |
437 |
++ if (cpufreq_get_current_driver()) |
438 |
++ return 0; |
439 |
++ |
440 |
+ if (acpi_disabled) |
441 |
+ return 0; |
442 |
+ |
443 |
+diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c |
444 |
+index b63893eeca73..20a471ad0ad2 100644 |
445 |
+--- a/drivers/gpu/drm/i915/i915_irq.c |
446 |
++++ b/drivers/gpu/drm/i915/i915_irq.c |
447 |
+@@ -1786,10 +1786,38 @@ static void valleyview_pipestat_irq_handler(struct drm_i915_private *dev_priv, |
448 |
+ |
449 |
+ static u32 i9xx_hpd_irq_ack(struct drm_i915_private *dev_priv) |
450 |
+ { |
451 |
+- u32 hotplug_status = I915_READ(PORT_HOTPLUG_STAT); |
452 |
++ u32 hotplug_status = 0, hotplug_status_mask; |
453 |
++ int i; |
454 |
++ |
455 |
++ if (IS_G4X(dev_priv) || |
456 |
++ IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) |
457 |
++ hotplug_status_mask = HOTPLUG_INT_STATUS_G4X | |
458 |
++ DP_AUX_CHANNEL_MASK_INT_STATUS_G4X; |
459 |
++ else |
460 |
++ hotplug_status_mask = HOTPLUG_INT_STATUS_I915; |
461 |
+ |
462 |
+- if (hotplug_status) |
463 |
++ /* |
464 |
++ * We absolutely have to clear all the pending interrupt |
465 |
++ * bits in PORT_HOTPLUG_STAT. Otherwise the ISR port |
466 |
++ * interrupt bit won't have an edge, and the i965/g4x |
467 |
++ * edge triggered IIR will not notice that an interrupt |
468 |
++ * is still pending. We can't use PORT_HOTPLUG_EN to |
469 |
++ * guarantee the edge as the act of toggling the enable |
470 |
++ * bits can itself generate a new hotplug interrupt :( |
471 |
++ */ |
472 |
++ for (i = 0; i < 10; i++) { |
473 |
++ u32 tmp = I915_READ(PORT_HOTPLUG_STAT) & hotplug_status_mask; |
474 |
++ |
475 |
++ if (tmp == 0) |
476 |
++ return hotplug_status; |
477 |
++ |
478 |
++ hotplug_status |= tmp; |
479 |
+ I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); |
480 |
++ } |
481 |
++ |
482 |
++ WARN_ONCE(1, |
483 |
++ "PORT_HOTPLUG_STAT did not clear (0x%08x)\n", |
484 |
++ I915_READ(PORT_HOTPLUG_STAT)); |
485 |
+ |
486 |
+ return hotplug_status; |
487 |
+ } |
488 |
+diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c |
489 |
+index debbbf0fd4bd..408b955e5c39 100644 |
490 |
+--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c |
491 |
++++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c |
492 |
+@@ -267,6 +267,7 @@ nouveau_backlight_init(struct drm_device *dev) |
493 |
+ struct nouveau_drm *drm = nouveau_drm(dev); |
494 |
+ struct nvif_device *device = &drm->client.device; |
495 |
+ struct drm_connector *connector; |
496 |
++ struct drm_connector_list_iter conn_iter; |
497 |
+ |
498 |
+ INIT_LIST_HEAD(&drm->bl_connectors); |
499 |
+ |
500 |
+@@ -275,7 +276,8 @@ nouveau_backlight_init(struct drm_device *dev) |
501 |
+ return 0; |
502 |
+ } |
503 |
+ |
504 |
+- list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
505 |
++ drm_connector_list_iter_begin(dev, &conn_iter); |
506 |
++ drm_for_each_connector_iter(connector, &conn_iter) { |
507 |
+ if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS && |
508 |
+ connector->connector_type != DRM_MODE_CONNECTOR_eDP) |
509 |
+ continue; |
510 |
+@@ -292,7 +294,7 @@ nouveau_backlight_init(struct drm_device *dev) |
511 |
+ break; |
512 |
+ } |
513 |
+ } |
514 |
+- |
515 |
++ drm_connector_list_iter_end(&conn_iter); |
516 |
+ |
517 |
+ return 0; |
518 |
+ } |
519 |
+diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c |
520 |
+index c902a851eb51..430830d63a33 100644 |
521 |
+--- a/drivers/gpu/drm/nouveau/nouveau_connector.c |
522 |
++++ b/drivers/gpu/drm/nouveau/nouveau_connector.c |
523 |
+@@ -1208,14 +1208,19 @@ nouveau_connector_create(struct drm_device *dev, int index) |
524 |
+ struct nouveau_display *disp = nouveau_display(dev); |
525 |
+ struct nouveau_connector *nv_connector = NULL; |
526 |
+ struct drm_connector *connector; |
527 |
++ struct drm_connector_list_iter conn_iter; |
528 |
+ int type, ret = 0; |
529 |
+ bool dummy; |
530 |
+ |
531 |
+- list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
532 |
++ drm_connector_list_iter_begin(dev, &conn_iter); |
533 |
++ nouveau_for_each_non_mst_connector_iter(connector, &conn_iter) { |
534 |
+ nv_connector = nouveau_connector(connector); |
535 |
+- if (nv_connector->index == index) |
536 |
++ if (nv_connector->index == index) { |
537 |
++ drm_connector_list_iter_end(&conn_iter); |
538 |
+ return connector; |
539 |
++ } |
540 |
+ } |
541 |
++ drm_connector_list_iter_end(&conn_iter); |
542 |
+ |
543 |
+ nv_connector = kzalloc(sizeof(*nv_connector), GFP_KERNEL); |
544 |
+ if (!nv_connector) |
545 |
+diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h |
546 |
+index a4d1a059bd3d..dc7454e7f19a 100644 |
547 |
+--- a/drivers/gpu/drm/nouveau/nouveau_connector.h |
548 |
++++ b/drivers/gpu/drm/nouveau/nouveau_connector.h |
549 |
+@@ -33,6 +33,7 @@ |
550 |
+ #include <drm/drm_encoder.h> |
551 |
+ #include <drm/drm_dp_helper.h> |
552 |
+ #include "nouveau_crtc.h" |
553 |
++#include "nouveau_encoder.h" |
554 |
+ |
555 |
+ struct nvkm_i2c_port; |
556 |
+ |
557 |
+@@ -60,19 +61,46 @@ static inline struct nouveau_connector *nouveau_connector( |
558 |
+ return container_of(con, struct nouveau_connector, base); |
559 |
+ } |
560 |
+ |
561 |
++static inline bool |
562 |
++nouveau_connector_is_mst(struct drm_connector *connector) |
563 |
++{ |
564 |
++ const struct nouveau_encoder *nv_encoder; |
565 |
++ const struct drm_encoder *encoder; |
566 |
++ |
567 |
++ if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort) |
568 |
++ return false; |
569 |
++ |
570 |
++ nv_encoder = find_encoder(connector, DCB_OUTPUT_ANY); |
571 |
++ if (!nv_encoder) |
572 |
++ return false; |
573 |
++ |
574 |
++ encoder = &nv_encoder->base.base; |
575 |
++ return encoder->encoder_type == DRM_MODE_ENCODER_DPMST; |
576 |
++} |
577 |
++ |
578 |
++#define nouveau_for_each_non_mst_connector_iter(connector, iter) \ |
579 |
++ drm_for_each_connector_iter(connector, iter) \ |
580 |
++ for_each_if(!nouveau_connector_is_mst(connector)) |
581 |
++ |
582 |
+ static inline struct nouveau_connector * |
583 |
+ nouveau_crtc_connector_get(struct nouveau_crtc *nv_crtc) |
584 |
+ { |
585 |
+ struct drm_device *dev = nv_crtc->base.dev; |
586 |
+ struct drm_connector *connector; |
587 |
++ struct drm_connector_list_iter conn_iter; |
588 |
++ struct nouveau_connector *nv_connector = NULL; |
589 |
+ struct drm_crtc *crtc = to_drm_crtc(nv_crtc); |
590 |
+ |
591 |
+- list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
592 |
+- if (connector->encoder && connector->encoder->crtc == crtc) |
593 |
+- return nouveau_connector(connector); |
594 |
++ drm_connector_list_iter_begin(dev, &conn_iter); |
595 |
++ nouveau_for_each_non_mst_connector_iter(connector, &conn_iter) { |
596 |
++ if (connector->encoder && connector->encoder->crtc == crtc) { |
597 |
++ nv_connector = nouveau_connector(connector); |
598 |
++ break; |
599 |
++ } |
600 |
+ } |
601 |
++ drm_connector_list_iter_end(&conn_iter); |
602 |
+ |
603 |
+- return NULL; |
604 |
++ return nv_connector; |
605 |
+ } |
606 |
+ |
607 |
+ struct drm_connector * |
608 |
+diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c |
609 |
+index 2e7785f49e6d..caf53503c0f7 100644 |
610 |
+--- a/drivers/gpu/drm/nouveau/nouveau_display.c |
611 |
++++ b/drivers/gpu/drm/nouveau/nouveau_display.c |
612 |
+@@ -405,6 +405,7 @@ nouveau_display_init(struct drm_device *dev) |
613 |
+ struct nouveau_display *disp = nouveau_display(dev); |
614 |
+ struct nouveau_drm *drm = nouveau_drm(dev); |
615 |
+ struct drm_connector *connector; |
616 |
++ struct drm_connector_list_iter conn_iter; |
617 |
+ int ret; |
618 |
+ |
619 |
+ ret = disp->init(dev); |
620 |
+@@ -412,10 +413,12 @@ nouveau_display_init(struct drm_device *dev) |
621 |
+ return ret; |
622 |
+ |
623 |
+ /* enable hotplug interrupts */ |
624 |
+- list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
625 |
++ drm_connector_list_iter_begin(dev, &conn_iter); |
626 |
++ nouveau_for_each_non_mst_connector_iter(connector, &conn_iter) { |
627 |
+ struct nouveau_connector *conn = nouveau_connector(connector); |
628 |
+ nvif_notify_get(&conn->hpd); |
629 |
+ } |
630 |
++ drm_connector_list_iter_end(&conn_iter); |
631 |
+ |
632 |
+ /* enable flip completion events */ |
633 |
+ nvif_notify_get(&drm->flip); |
634 |
+@@ -428,6 +431,7 @@ nouveau_display_fini(struct drm_device *dev, bool suspend) |
635 |
+ struct nouveau_display *disp = nouveau_display(dev); |
636 |
+ struct nouveau_drm *drm = nouveau_drm(dev); |
637 |
+ struct drm_connector *connector; |
638 |
++ struct drm_connector_list_iter conn_iter; |
639 |
+ |
640 |
+ if (!suspend) { |
641 |
+ if (drm_drv_uses_atomic_modeset(dev)) |
642 |
+@@ -440,10 +444,12 @@ nouveau_display_fini(struct drm_device *dev, bool suspend) |
643 |
+ nvif_notify_put(&drm->flip); |
644 |
+ |
645 |
+ /* disable hotplug interrupts */ |
646 |
+- list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
647 |
++ drm_connector_list_iter_begin(dev, &conn_iter); |
648 |
++ nouveau_for_each_non_mst_connector_iter(connector, &conn_iter) { |
649 |
+ struct nouveau_connector *conn = nouveau_connector(connector); |
650 |
+ nvif_notify_put(&conn->hpd); |
651 |
+ } |
652 |
++ drm_connector_list_iter_end(&conn_iter); |
653 |
+ |
654 |
+ drm_kms_helper_poll_disable(dev); |
655 |
+ disp->fini(dev); |
656 |
+diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c |
657 |
+index a0c44d16bf30..c75daba57fd7 100644 |
658 |
+--- a/drivers/misc/cxl/api.c |
659 |
++++ b/drivers/misc/cxl/api.c |
660 |
+@@ -102,15 +102,15 @@ static struct file *cxl_getfile(const char *name, |
661 |
+ d_instantiate(path.dentry, inode); |
662 |
+ |
663 |
+ file = alloc_file(&path, OPEN_FMODE(flags), fops); |
664 |
+- if (IS_ERR(file)) |
665 |
+- goto err_dput; |
666 |
++ if (IS_ERR(file)) { |
667 |
++ path_put(&path); |
668 |
++ goto err_fs; |
669 |
++ } |
670 |
+ file->f_flags = flags & (O_ACCMODE | O_NONBLOCK); |
671 |
+ file->private_data = priv; |
672 |
+ |
673 |
+ return file; |
674 |
+ |
675 |
+-err_dput: |
676 |
+- path_put(&path); |
677 |
+ err_inode: |
678 |
+ iput(inode); |
679 |
+ err_fs: |
680 |
+diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c |
681 |
+index 1e856e8b9a92..0fff2432ab4c 100644 |
682 |
+--- a/drivers/net/ethernet/broadcom/bcmsysport.c |
683 |
++++ b/drivers/net/ethernet/broadcom/bcmsysport.c |
684 |
+@@ -1851,8 +1851,8 @@ static int bcm_sysport_open(struct net_device *dev) |
685 |
+ if (!priv->is_lite) |
686 |
+ priv->crc_fwd = !!(umac_readl(priv, UMAC_CMD) & CMD_CRC_FWD); |
687 |
+ else |
688 |
+- priv->crc_fwd = !!(gib_readl(priv, GIB_CONTROL) & |
689 |
+- GIB_FCS_STRIP); |
690 |
++ priv->crc_fwd = !((gib_readl(priv, GIB_CONTROL) & |
691 |
++ GIB_FCS_STRIP) >> GIB_FCS_STRIP_SHIFT); |
692 |
+ |
693 |
+ phydev = of_phy_connect(dev, priv->phy_dn, bcm_sysport_adj_link, |
694 |
+ 0, priv->phy_interface); |
695 |
+diff --git a/drivers/net/ethernet/broadcom/bcmsysport.h b/drivers/net/ethernet/broadcom/bcmsysport.h |
696 |
+index a2006f5fc26f..86ae751ccb5c 100644 |
697 |
+--- a/drivers/net/ethernet/broadcom/bcmsysport.h |
698 |
++++ b/drivers/net/ethernet/broadcom/bcmsysport.h |
699 |
+@@ -277,7 +277,8 @@ struct bcm_rsb { |
700 |
+ #define GIB_GTX_CLK_EXT_CLK (0 << GIB_GTX_CLK_SEL_SHIFT) |
701 |
+ #define GIB_GTX_CLK_125MHZ (1 << GIB_GTX_CLK_SEL_SHIFT) |
702 |
+ #define GIB_GTX_CLK_250MHZ (2 << GIB_GTX_CLK_SEL_SHIFT) |
703 |
+-#define GIB_FCS_STRIP (1 << 6) |
704 |
++#define GIB_FCS_STRIP_SHIFT 6 |
705 |
++#define GIB_FCS_STRIP (1 << GIB_FCS_STRIP_SHIFT) |
706 |
+ #define GIB_LCL_LOOP_EN (1 << 7) |
707 |
+ #define GIB_LCL_LOOP_TXEN (1 << 8) |
708 |
+ #define GIB_RMT_LOOP_EN (1 << 9) |
709 |
+diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c |
710 |
+index 9a8ef630466f..1b1d2a67f412 100644 |
711 |
+--- a/drivers/net/ethernet/broadcom/tg3.c |
712 |
++++ b/drivers/net/ethernet/broadcom/tg3.c |
713 |
+@@ -9279,6 +9279,15 @@ static int tg3_chip_reset(struct tg3 *tp) |
714 |
+ |
715 |
+ tg3_restore_clk(tp); |
716 |
+ |
717 |
++ /* Increase the core clock speed to fix tx timeout issue for 5762 |
718 |
++ * with 100Mbps link speed. |
719 |
++ */ |
720 |
++ if (tg3_asic_rev(tp) == ASIC_REV_5762) { |
721 |
++ val = tr32(TG3_CPMU_CLCK_ORIDE_ENABLE); |
722 |
++ tw32(TG3_CPMU_CLCK_ORIDE_ENABLE, val | |
723 |
++ TG3_CPMU_MAC_ORIDE_ENABLE); |
724 |
++ } |
725 |
++ |
726 |
+ /* Reprobe ASF enable state. */ |
727 |
+ tg3_flag_clear(tp, ENABLE_ASF); |
728 |
+ tp->phy_flags &= ~(TG3_PHYFLG_1G_ON_VAUX_OK | |
729 |
+diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
730 |
+index b97a55c827eb..ab2a9dbb46c7 100644 |
731 |
+--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
732 |
++++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
733 |
+@@ -472,10 +472,10 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, |
734 |
+ { |
735 |
+ const struct mlx4_en_frag_info *frag_info = priv->frag_info; |
736 |
+ unsigned int truesize = 0; |
737 |
++ bool release = true; |
738 |
+ int nr, frag_size; |
739 |
+ struct page *page; |
740 |
+ dma_addr_t dma; |
741 |
+- bool release; |
742 |
+ |
743 |
+ /* Collect used fragments while replacing them in the HW descriptors */ |
744 |
+ for (nr = 0;; frags++) { |
745 |
+@@ -498,7 +498,11 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, |
746 |
+ release = page_count(page) != 1 || |
747 |
+ page_is_pfmemalloc(page) || |
748 |
+ page_to_nid(page) != numa_mem_id(); |
749 |
+- } else { |
750 |
++ } else if (!priv->rx_headroom) { |
751 |
++ /* rx_headroom for non XDP setup is always 0. |
752 |
++ * When XDP is set, the above condition will |
753 |
++ * guarantee page is always released. |
754 |
++ */ |
755 |
+ u32 sz_align = ALIGN(frag_size, SMP_CACHE_BYTES); |
756 |
+ |
757 |
+ frags->page_offset += sz_align; |
758 |
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c |
759 |
+index 701be5d81062..806239b89990 100644 |
760 |
+--- a/drivers/net/hyperv/netvsc.c |
761 |
++++ b/drivers/net/hyperv/netvsc.c |
762 |
+@@ -1250,6 +1250,7 @@ int netvsc_poll(struct napi_struct *napi, int budget) |
763 |
+ struct hv_device *device = netvsc_channel_to_device(channel); |
764 |
+ struct net_device *ndev = hv_get_drvdata(device); |
765 |
+ int work_done = 0; |
766 |
++ int ret; |
767 |
+ |
768 |
+ /* If starting a new interval */ |
769 |
+ if (!nvchan->desc) |
770 |
+@@ -1261,16 +1262,18 @@ int netvsc_poll(struct napi_struct *napi, int budget) |
771 |
+ nvchan->desc = hv_pkt_iter_next(channel, nvchan->desc); |
772 |
+ } |
773 |
+ |
774 |
+- /* If send of pending receive completions suceeded |
775 |
+- * and did not exhaust NAPI budget this time |
776 |
+- * and not doing busy poll |
777 |
++ /* Send any pending receive completions */ |
778 |
++ ret = send_recv_completions(ndev, net_device, nvchan); |
779 |
++ |
780 |
++ /* If it did not exhaust NAPI budget this time |
781 |
++ * and not doing busy poll |
782 |
+ * then re-enable host interrupts |
783 |
+- * and reschedule if ring is not empty. |
784 |
++ * and reschedule if ring is not empty |
785 |
++ * or sending receive completion failed. |
786 |
+ */ |
787 |
+- if (send_recv_completions(ndev, net_device, nvchan) == 0 && |
788 |
+- work_done < budget && |
789 |
++ if (work_done < budget && |
790 |
+ napi_complete_done(napi, work_done) && |
791 |
+- hv_end_read(&channel->inbound) && |
792 |
++ (ret || hv_end_read(&channel->inbound)) && |
793 |
+ napi_schedule_prep(napi)) { |
794 |
+ hv_begin_read(&channel->inbound); |
795 |
+ __napi_schedule(napi); |
796 |
+diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c |
797 |
+index a1e7ea4d4b16..a174d05a9752 100644 |
798 |
+--- a/drivers/net/phy/phy_device.c |
799 |
++++ b/drivers/net/phy/phy_device.c |
800 |
+@@ -1686,11 +1686,8 @@ EXPORT_SYMBOL(genphy_loopback); |
801 |
+ |
802 |
+ static int __set_phy_supported(struct phy_device *phydev, u32 max_speed) |
803 |
+ { |
804 |
+- /* The default values for phydev->supported are provided by the PHY |
805 |
+- * driver "features" member, we want to reset to sane defaults first |
806 |
+- * before supporting higher speeds. |
807 |
+- */ |
808 |
+- phydev->supported &= PHY_DEFAULT_FEATURES; |
809 |
++ phydev->supported &= ~(PHY_1000BT_FEATURES | PHY_100BT_FEATURES | |
810 |
++ PHY_10BT_FEATURES); |
811 |
+ |
812 |
+ switch (max_speed) { |
813 |
+ default: |
814 |
+diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c |
815 |
+index 3d4f7959dabb..b1b3d8f7e67d 100644 |
816 |
+--- a/drivers/net/usb/asix_devices.c |
817 |
++++ b/drivers/net/usb/asix_devices.c |
818 |
+@@ -642,10 +642,12 @@ static void ax88772_restore_phy(struct usbnet *dev) |
819 |
+ priv->presvd_phy_advertise); |
820 |
+ |
821 |
+ /* Restore BMCR */ |
822 |
++ if (priv->presvd_phy_bmcr & BMCR_ANENABLE) |
823 |
++ priv->presvd_phy_bmcr |= BMCR_ANRESTART; |
824 |
++ |
825 |
+ asix_mdio_write_nopm(dev->net, dev->mii.phy_id, MII_BMCR, |
826 |
+ priv->presvd_phy_bmcr); |
827 |
+ |
828 |
+- mii_nway_restart(&dev->mii); |
829 |
+ priv->presvd_phy_advertise = 0; |
830 |
+ priv->presvd_phy_bmcr = 0; |
831 |
+ } |
832 |
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c |
833 |
+index 0db500bf86d9..6d3811c869fd 100644 |
834 |
+--- a/drivers/net/usb/qmi_wwan.c |
835 |
++++ b/drivers/net/usb/qmi_wwan.c |
836 |
+@@ -1252,6 +1252,7 @@ static const struct usb_device_id products[] = { |
837 |
+ {QMI_FIXED_INTF(0x1e0e, 0x9001, 5)}, /* SIMCom 7230E */ |
838 |
+ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0125, 4)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ |
839 |
+ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */ |
840 |
++ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0191, 4)}, /* Quectel EG91 */ |
841 |
+ {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */ |
842 |
+ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0306, 4)}, /* Quectel EP06 Mini PCIe */ |
843 |
+ |
844 |
+diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c |
845 |
+index 58a97d420572..51364621f77c 100644 |
846 |
+--- a/drivers/ptp/ptp_chardev.c |
847 |
++++ b/drivers/ptp/ptp_chardev.c |
848 |
+@@ -89,6 +89,7 @@ int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin, |
849 |
+ case PTP_PF_PHYSYNC: |
850 |
+ if (chan != 0) |
851 |
+ return -EINVAL; |
852 |
++ break; |
853 |
+ default: |
854 |
+ return -EINVAL; |
855 |
+ } |
856 |
+diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c |
857 |
+index ea9e1e0ed5b8..f4944dde6c8e 100644 |
858 |
+--- a/drivers/scsi/sd_zbc.c |
859 |
++++ b/drivers/scsi/sd_zbc.c |
860 |
+@@ -430,7 +430,8 @@ static int sd_zbc_check_capacity(struct scsi_disk *sdkp, |
861 |
+ * Check that all zones of the device are equal. The last zone can however |
862 |
+ * be smaller. The zone size must also be a power of two number of LBAs. |
863 |
+ * |
864 |
+- * Returns the zone size in bytes upon success or an error code upon failure. |
865 |
++ * Returns the zone size in number of blocks upon success or an error code |
866 |
++ * upon failure. |
867 |
+ */ |
868 |
+ static s64 sd_zbc_check_zone_size(struct scsi_disk *sdkp) |
869 |
+ { |
870 |
+@@ -440,7 +441,7 @@ static s64 sd_zbc_check_zone_size(struct scsi_disk *sdkp) |
871 |
+ unsigned char *rec; |
872 |
+ unsigned int buf_len; |
873 |
+ unsigned int list_length; |
874 |
+- int ret; |
875 |
++ s64 ret; |
876 |
+ u8 same; |
877 |
+ |
878 |
+ /* Get a buffer */ |
879 |
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c |
880 |
+index e5bccc6d49cf..fe84b36627ec 100644 |
881 |
+--- a/drivers/usb/host/xhci.c |
882 |
++++ b/drivers/usb/host/xhci.c |
883 |
+@@ -856,6 +856,41 @@ static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci) |
884 |
+ spin_unlock_irqrestore(&xhci->lock, flags); |
885 |
+ } |
886 |
+ |
887 |
++static bool xhci_pending_portevent(struct xhci_hcd *xhci) |
888 |
++{ |
889 |
++ __le32 __iomem **port_array; |
890 |
++ int port_index; |
891 |
++ u32 status; |
892 |
++ u32 portsc; |
893 |
++ |
894 |
++ status = readl(&xhci->op_regs->status); |
895 |
++ if (status & STS_EINT) |
896 |
++ return true; |
897 |
++ /* |
898 |
++ * Checking STS_EINT is not enough as there is a lag between a change |
899 |
++ * bit being set and the Port Status Change Event that it generated |
900 |
++ * being written to the Event Ring. See note in xhci 1.1 section 4.19.2. |
901 |
++ */ |
902 |
++ |
903 |
++ port_index = xhci->num_usb2_ports; |
904 |
++ port_array = xhci->usb2_ports; |
905 |
++ while (port_index--) { |
906 |
++ portsc = readl(port_array[port_index]); |
907 |
++ if (portsc & PORT_CHANGE_MASK || |
908 |
++ (portsc & PORT_PLS_MASK) == XDEV_RESUME) |
909 |
++ return true; |
910 |
++ } |
911 |
++ port_index = xhci->num_usb3_ports; |
912 |
++ port_array = xhci->usb3_ports; |
913 |
++ while (port_index--) { |
914 |
++ portsc = readl(port_array[port_index]); |
915 |
++ if (portsc & PORT_CHANGE_MASK || |
916 |
++ (portsc & PORT_PLS_MASK) == XDEV_RESUME) |
917 |
++ return true; |
918 |
++ } |
919 |
++ return false; |
920 |
++} |
921 |
++ |
922 |
+ /* |
923 |
+ * Stop HC (not bus-specific) |
924 |
+ * |
925 |
+@@ -955,7 +990,7 @@ EXPORT_SYMBOL_GPL(xhci_suspend); |
926 |
+ */ |
927 |
+ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
928 |
+ { |
929 |
+- u32 command, temp = 0, status; |
930 |
++ u32 command, temp = 0; |
931 |
+ struct usb_hcd *hcd = xhci_to_hcd(xhci); |
932 |
+ struct usb_hcd *secondary_hcd; |
933 |
+ int retval = 0; |
934 |
+@@ -1077,8 +1112,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
935 |
+ done: |
936 |
+ if (retval == 0) { |
937 |
+ /* Resume root hubs only when have pending events. */ |
938 |
+- status = readl(&xhci->op_regs->status); |
939 |
+- if (status & STS_EINT) { |
940 |
++ if (xhci_pending_portevent(xhci)) { |
941 |
+ usb_hcd_resume_root_hub(xhci->shared_hcd); |
942 |
+ usb_hcd_resume_root_hub(hcd); |
943 |
+ } |
944 |
+diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h |
945 |
+index 2a72060dda1b..11232e62b898 100644 |
946 |
+--- a/drivers/usb/host/xhci.h |
947 |
++++ b/drivers/usb/host/xhci.h |
948 |
+@@ -392,6 +392,10 @@ struct xhci_op_regs { |
949 |
+ #define PORT_PLC (1 << 22) |
950 |
+ /* port configure error change - port failed to configure its link partner */ |
951 |
+ #define PORT_CEC (1 << 23) |
952 |
++#define PORT_CHANGE_MASK (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \ |
953 |
++ PORT_RC | PORT_PLC | PORT_CEC) |
954 |
++ |
955 |
++ |
956 |
+ /* Cold Attach Status - xHC can set this bit to report device attached during |
957 |
+ * Sx state. Warm port reset should be perfomed to clear this bit and move port |
958 |
+ * to connected state. |
959 |
+diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c |
960 |
+index f041b1a6cf66..695b9d1a1aae 100644 |
961 |
+--- a/drivers/vfio/pci/vfio_pci.c |
962 |
++++ b/drivers/vfio/pci/vfio_pci.c |
963 |
+@@ -28,6 +28,7 @@ |
964 |
+ #include <linux/uaccess.h> |
965 |
+ #include <linux/vfio.h> |
966 |
+ #include <linux/vgaarb.h> |
967 |
++#include <linux/nospec.h> |
968 |
+ |
969 |
+ #include "vfio_pci_private.h" |
970 |
+ |
971 |
+@@ -746,6 +747,9 @@ static long vfio_pci_ioctl(void *device_data, |
972 |
+ if (info.index >= |
973 |
+ VFIO_PCI_NUM_REGIONS + vdev->num_regions) |
974 |
+ return -EINVAL; |
975 |
++ info.index = array_index_nospec(info.index, |
976 |
++ VFIO_PCI_NUM_REGIONS + |
977 |
++ vdev->num_regions); |
978 |
+ |
979 |
+ i = info.index - VFIO_PCI_NUM_REGIONS; |
980 |
+ |
981 |
+diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c |
982 |
+index 63112c36ab2d..b751dd60e41a 100644 |
983 |
+--- a/drivers/vfio/vfio_iommu_spapr_tce.c |
984 |
++++ b/drivers/vfio/vfio_iommu_spapr_tce.c |
985 |
+@@ -457,13 +457,13 @@ static void tce_iommu_unuse_page(struct tce_container *container, |
986 |
+ } |
987 |
+ |
988 |
+ static int tce_iommu_prereg_ua_to_hpa(struct tce_container *container, |
989 |
+- unsigned long tce, unsigned long size, |
990 |
++ unsigned long tce, unsigned long shift, |
991 |
+ unsigned long *phpa, struct mm_iommu_table_group_mem_t **pmem) |
992 |
+ { |
993 |
+ long ret = 0; |
994 |
+ struct mm_iommu_table_group_mem_t *mem; |
995 |
+ |
996 |
+- mem = mm_iommu_lookup(container->mm, tce, size); |
997 |
++ mem = mm_iommu_lookup(container->mm, tce, 1ULL << shift); |
998 |
+ if (!mem) |
999 |
+ return -EINVAL; |
1000 |
+ |
1001 |
+@@ -487,7 +487,7 @@ static void tce_iommu_unuse_page_v2(struct tce_container *container, |
1002 |
+ if (!pua) |
1003 |
+ return; |
1004 |
+ |
1005 |
+- ret = tce_iommu_prereg_ua_to_hpa(container, *pua, IOMMU_PAGE_SIZE(tbl), |
1006 |
++ ret = tce_iommu_prereg_ua_to_hpa(container, *pua, tbl->it_page_shift, |
1007 |
+ &hpa, &mem); |
1008 |
+ if (ret) |
1009 |
+ pr_debug("%s: tce %lx at #%lx was not cached, ret=%d\n", |
1010 |
+@@ -609,7 +609,7 @@ static long tce_iommu_build_v2(struct tce_container *container, |
1011 |
+ entry + i); |
1012 |
+ |
1013 |
+ ret = tce_iommu_prereg_ua_to_hpa(container, |
1014 |
+- tce, IOMMU_PAGE_SIZE(tbl), &hpa, &mem); |
1015 |
++ tce, tbl->it_page_shift, &hpa, &mem); |
1016 |
+ if (ret) |
1017 |
+ break; |
1018 |
+ |
1019 |
+diff --git a/fs/fat/inode.c b/fs/fat/inode.c |
1020 |
+index c7a4dee206b9..3b40937b942a 100644 |
1021 |
+--- a/fs/fat/inode.c |
1022 |
++++ b/fs/fat/inode.c |
1023 |
+@@ -696,13 +696,21 @@ static void fat_set_state(struct super_block *sb, |
1024 |
+ brelse(bh); |
1025 |
+ } |
1026 |
+ |
1027 |
++static void fat_reset_iocharset(struct fat_mount_options *opts) |
1028 |
++{ |
1029 |
++ if (opts->iocharset != fat_default_iocharset) { |
1030 |
++ /* Note: opts->iocharset can be NULL here */ |
1031 |
++ kfree(opts->iocharset); |
1032 |
++ opts->iocharset = fat_default_iocharset; |
1033 |
++ } |
1034 |
++} |
1035 |
++ |
1036 |
+ static void delayed_free(struct rcu_head *p) |
1037 |
+ { |
1038 |
+ struct msdos_sb_info *sbi = container_of(p, struct msdos_sb_info, rcu); |
1039 |
+ unload_nls(sbi->nls_disk); |
1040 |
+ unload_nls(sbi->nls_io); |
1041 |
+- if (sbi->options.iocharset != fat_default_iocharset) |
1042 |
+- kfree(sbi->options.iocharset); |
1043 |
++ fat_reset_iocharset(&sbi->options); |
1044 |
+ kfree(sbi); |
1045 |
+ } |
1046 |
+ |
1047 |
+@@ -1117,7 +1125,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat, |
1048 |
+ opts->fs_fmask = opts->fs_dmask = current_umask(); |
1049 |
+ opts->allow_utime = -1; |
1050 |
+ opts->codepage = fat_default_codepage; |
1051 |
+- opts->iocharset = fat_default_iocharset; |
1052 |
++ fat_reset_iocharset(opts); |
1053 |
+ if (is_vfat) { |
1054 |
+ opts->shortname = VFAT_SFN_DISPLAY_WINNT|VFAT_SFN_CREATE_WIN95; |
1055 |
+ opts->rodir = 0; |
1056 |
+@@ -1274,8 +1282,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat, |
1057 |
+ |
1058 |
+ /* vfat specific */ |
1059 |
+ case Opt_charset: |
1060 |
+- if (opts->iocharset != fat_default_iocharset) |
1061 |
+- kfree(opts->iocharset); |
1062 |
++ fat_reset_iocharset(opts); |
1063 |
+ iocharset = match_strdup(&args[0]); |
1064 |
+ if (!iocharset) |
1065 |
+ return -ENOMEM; |
1066 |
+@@ -1866,8 +1873,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, |
1067 |
+ iput(fat_inode); |
1068 |
+ unload_nls(sbi->nls_io); |
1069 |
+ unload_nls(sbi->nls_disk); |
1070 |
+- if (sbi->options.iocharset != fat_default_iocharset) |
1071 |
+- kfree(sbi->options.iocharset); |
1072 |
++ fat_reset_iocharset(&sbi->options); |
1073 |
+ sb->s_fs_info = NULL; |
1074 |
+ kfree(sbi); |
1075 |
+ return error; |
1076 |
+diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h |
1077 |
+index 05b8650f06f5..a74ec619ac51 100644 |
1078 |
+--- a/include/linux/sched/task.h |
1079 |
++++ b/include/linux/sched/task.h |
1080 |
+@@ -75,7 +75,7 @@ extern long _do_fork(unsigned long, unsigned long, unsigned long, int __user *, |
1081 |
+ extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); |
1082 |
+ struct task_struct *fork_idle(int); |
1083 |
+ extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); |
1084 |
+-extern long kernel_wait4(pid_t, int *, int, struct rusage *); |
1085 |
++extern long kernel_wait4(pid_t, int __user *, int, struct rusage *); |
1086 |
+ |
1087 |
+ extern void free_task(struct task_struct *tsk); |
1088 |
+ |
1089 |
+diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h |
1090 |
+index be45224b01d7..9cf971c68401 100644 |
1091 |
+--- a/include/linux/skbuff.h |
1092 |
++++ b/include/linux/skbuff.h |
1093 |
+@@ -624,6 +624,7 @@ typedef unsigned char *sk_buff_data_t; |
1094 |
+ * @hash: the packet hash |
1095 |
+ * @queue_mapping: Queue mapping for multiqueue devices |
1096 |
+ * @xmit_more: More SKBs are pending for this queue |
1097 |
++ * @pfmemalloc: skbuff was allocated from PFMEMALLOC reserves |
1098 |
+ * @ndisc_nodetype: router type (from link layer) |
1099 |
+ * @ooo_okay: allow the mapping of a socket to a queue to be changed |
1100 |
+ * @l4_hash: indicate hash is a canonical 4-tuple hash over transport |
1101 |
+@@ -722,7 +723,7 @@ struct sk_buff { |
1102 |
+ peeked:1, |
1103 |
+ head_frag:1, |
1104 |
+ xmit_more:1, |
1105 |
+- __unused:1; /* one bit hole */ |
1106 |
++ pfmemalloc:1; |
1107 |
+ |
1108 |
+ /* fields enclosed in headers_start/headers_end are copied |
1109 |
+ * using a single memcpy() in __copy_skb_header() |
1110 |
+@@ -741,31 +742,30 @@ struct sk_buff { |
1111 |
+ |
1112 |
+ __u8 __pkt_type_offset[0]; |
1113 |
+ __u8 pkt_type:3; |
1114 |
+- __u8 pfmemalloc:1; |
1115 |
+ __u8 ignore_df:1; |
1116 |
+- |
1117 |
+ __u8 nf_trace:1; |
1118 |
+ __u8 ip_summed:2; |
1119 |
+ __u8 ooo_okay:1; |
1120 |
++ |
1121 |
+ __u8 l4_hash:1; |
1122 |
+ __u8 sw_hash:1; |
1123 |
+ __u8 wifi_acked_valid:1; |
1124 |
+ __u8 wifi_acked:1; |
1125 |
+- |
1126 |
+ __u8 no_fcs:1; |
1127 |
+ /* Indicates the inner headers are valid in the skbuff. */ |
1128 |
+ __u8 encapsulation:1; |
1129 |
+ __u8 encap_hdr_csum:1; |
1130 |
+ __u8 csum_valid:1; |
1131 |
++ |
1132 |
+ __u8 csum_complete_sw:1; |
1133 |
+ __u8 csum_level:2; |
1134 |
+ __u8 csum_not_inet:1; |
1135 |
+- |
1136 |
+ __u8 dst_pending_confirm:1; |
1137 |
+ #ifdef CONFIG_IPV6_NDISC_NODETYPE |
1138 |
+ __u8 ndisc_nodetype:2; |
1139 |
+ #endif |
1140 |
+ __u8 ipvs_property:1; |
1141 |
++ |
1142 |
+ __u8 inner_protocol_type:1; |
1143 |
+ __u8 remcsum_offload:1; |
1144 |
+ #ifdef CONFIG_NET_SWITCHDEV |
1145 |
+diff --git a/include/net/ipv6.h b/include/net/ipv6.h |
1146 |
+index a54b8c58ccb7..e59f385da38e 100644 |
1147 |
+--- a/include/net/ipv6.h |
1148 |
++++ b/include/net/ipv6.h |
1149 |
+@@ -795,7 +795,7 @@ static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb, |
1150 |
+ * to minimize possbility that any useful information to an |
1151 |
+ * attacker is leaked. Only lower 20 bits are relevant. |
1152 |
+ */ |
1153 |
+- rol32(hash, 16); |
1154 |
++ hash = rol32(hash, 16); |
1155 |
+ |
1156 |
+ flowlabel = (__force __be32)hash & IPV6_FLOWLABEL_MASK; |
1157 |
+ |
1158 |
+diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c |
1159 |
+index 64c0291b579c..2f6fa95de2d8 100644 |
1160 |
+--- a/kernel/stop_machine.c |
1161 |
++++ b/kernel/stop_machine.c |
1162 |
+@@ -270,7 +270,11 @@ static int cpu_stop_queue_two_works(int cpu1, struct cpu_stop_work *work1, |
1163 |
+ goto retry; |
1164 |
+ } |
1165 |
+ |
1166 |
+- wake_up_q(&wakeq); |
1167 |
++ if (!err) { |
1168 |
++ preempt_disable(); |
1169 |
++ wake_up_q(&wakeq); |
1170 |
++ preempt_enable(); |
1171 |
++ } |
1172 |
+ |
1173 |
+ return err; |
1174 |
+ } |
1175 |
+diff --git a/lib/rhashtable.c b/lib/rhashtable.c |
1176 |
+index b734ce731a7a..39215c724fc7 100644 |
1177 |
+--- a/lib/rhashtable.c |
1178 |
++++ b/lib/rhashtable.c |
1179 |
+@@ -878,8 +878,16 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_stop); |
1180 |
+ |
1181 |
+ static size_t rounded_hashtable_size(const struct rhashtable_params *params) |
1182 |
+ { |
1183 |
+- return max(roundup_pow_of_two(params->nelem_hint * 4 / 3), |
1184 |
+- (unsigned long)params->min_size); |
1185 |
++ size_t retsize; |
1186 |
++ |
1187 |
++ if (params->nelem_hint) |
1188 |
++ retsize = max(roundup_pow_of_two(params->nelem_hint * 4 / 3), |
1189 |
++ (unsigned long)params->min_size); |
1190 |
++ else |
1191 |
++ retsize = max(HASH_DEFAULT_SIZE, |
1192 |
++ (unsigned long)params->min_size); |
1193 |
++ |
1194 |
++ return retsize; |
1195 |
+ } |
1196 |
+ |
1197 |
+ static u32 rhashtable_jhash2(const void *key, u32 length, u32 seed) |
1198 |
+@@ -936,8 +944,6 @@ int rhashtable_init(struct rhashtable *ht, |
1199 |
+ struct bucket_table *tbl; |
1200 |
+ size_t size; |
1201 |
+ |
1202 |
+- size = HASH_DEFAULT_SIZE; |
1203 |
+- |
1204 |
+ if ((!params->key_len && !params->obj_hashfn) || |
1205 |
+ (params->obj_hashfn && !params->obj_cmpfn)) |
1206 |
+ return -EINVAL; |
1207 |
+@@ -964,8 +970,7 @@ int rhashtable_init(struct rhashtable *ht, |
1208 |
+ |
1209 |
+ ht->p.min_size = max_t(u16, ht->p.min_size, HASH_MIN_SIZE); |
1210 |
+ |
1211 |
+- if (params->nelem_hint) |
1212 |
+- size = rounded_hashtable_size(&ht->p); |
1213 |
++ size = rounded_hashtable_size(&ht->p); |
1214 |
+ |
1215 |
+ if (params->locks_mul) |
1216 |
+ ht->p.locks_mul = roundup_pow_of_two(params->locks_mul); |
1217 |
+diff --git a/mm/huge_memory.c b/mm/huge_memory.c |
1218 |
+index 8af604f3b370..255469f78217 100644 |
1219 |
+--- a/mm/huge_memory.c |
1220 |
++++ b/mm/huge_memory.c |
1221 |
+@@ -2069,6 +2069,8 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, |
1222 |
+ if (vma_is_dax(vma)) |
1223 |
+ return; |
1224 |
+ page = pmd_page(_pmd); |
1225 |
++ if (!PageDirty(page) && pmd_dirty(_pmd)) |
1226 |
++ set_page_dirty(page); |
1227 |
+ if (!PageReferenced(page) && pmd_young(_pmd)) |
1228 |
+ SetPageReferenced(page); |
1229 |
+ page_remove_rmap(page, true); |
1230 |
+diff --git a/mm/memcontrol.c b/mm/memcontrol.c |
1231 |
+index 942d9342b63b..db69d938e9ed 100644 |
1232 |
+--- a/mm/memcontrol.c |
1233 |
++++ b/mm/memcontrol.c |
1234 |
+@@ -879,7 +879,7 @@ static void invalidate_reclaim_iterators(struct mem_cgroup *dead_memcg) |
1235 |
+ int nid; |
1236 |
+ int i; |
1237 |
+ |
1238 |
+- while ((memcg = parent_mem_cgroup(memcg))) { |
1239 |
++ for (; memcg; memcg = parent_mem_cgroup(memcg)) { |
1240 |
+ for_each_node(nid) { |
1241 |
+ mz = mem_cgroup_nodeinfo(memcg, nid); |
1242 |
+ for (i = 0; i <= DEF_PRIORITY; i++) { |
1243 |
+diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c |
1244 |
+index 87f28557b329..441c04adedba 100644 |
1245 |
+--- a/net/core/gen_stats.c |
1246 |
++++ b/net/core/gen_stats.c |
1247 |
+@@ -77,8 +77,20 @@ gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type, |
1248 |
+ d->lock = lock; |
1249 |
+ spin_lock_bh(lock); |
1250 |
+ } |
1251 |
+- if (d->tail) |
1252 |
+- return gnet_stats_copy(d, type, NULL, 0, padattr); |
1253 |
++ if (d->tail) { |
1254 |
++ int ret = gnet_stats_copy(d, type, NULL, 0, padattr); |
1255 |
++ |
1256 |
++ /* The initial attribute added in gnet_stats_copy() may be |
1257 |
++ * preceded by a padding attribute, in which case d->tail will |
1258 |
++ * end up pointing at the padding instead of the real attribute. |
1259 |
++ * Fix this so gnet_stats_finish_copy() adjusts the length of |
1260 |
++ * the right attribute. |
1261 |
++ */ |
1262 |
++ if (ret == 0 && d->tail->nla_type == padattr) |
1263 |
++ d->tail = (struct nlattr *)((char *)d->tail + |
1264 |
++ NLA_ALIGN(d->tail->nla_len)); |
1265 |
++ return ret; |
1266 |
++ } |
1267 |
+ |
1268 |
+ return 0; |
1269 |
+ } |
1270 |
+diff --git a/net/core/skbuff.c b/net/core/skbuff.c |
1271 |
+index c132eca9e383..23041b5c0b27 100644 |
1272 |
+--- a/net/core/skbuff.c |
1273 |
++++ b/net/core/skbuff.c |
1274 |
+@@ -858,6 +858,7 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb) |
1275 |
+ n->cloned = 1; |
1276 |
+ n->nohdr = 0; |
1277 |
+ n->peeked = 0; |
1278 |
++ C(pfmemalloc); |
1279 |
+ n->destructor = NULL; |
1280 |
+ C(tail); |
1281 |
+ C(end); |
1282 |
+diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c |
1283 |
+index df8fd3ce713d..67eebcb113f3 100644 |
1284 |
+--- a/net/ipv4/fib_frontend.c |
1285 |
++++ b/net/ipv4/fib_frontend.c |
1286 |
+@@ -290,6 +290,7 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb) |
1287 |
+ if (!ipv4_is_zeronet(ip_hdr(skb)->saddr)) { |
1288 |
+ struct flowi4 fl4 = { |
1289 |
+ .flowi4_iif = LOOPBACK_IFINDEX, |
1290 |
++ .flowi4_oif = l3mdev_master_ifindex_rcu(dev), |
1291 |
+ .daddr = ip_hdr(skb)->saddr, |
1292 |
+ .flowi4_tos = RT_TOS(ip_hdr(skb)->tos), |
1293 |
+ .flowi4_scope = scope, |
1294 |
+diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c |
1295 |
+index 5a29dc5083a3..d82e8344fc54 100644 |
1296 |
+--- a/net/ipv4/sysctl_net_ipv4.c |
1297 |
++++ b/net/ipv4/sysctl_net_ipv4.c |
1298 |
+@@ -186,8 +186,9 @@ static int ipv4_ping_group_range(struct ctl_table *table, int write, |
1299 |
+ if (write && ret == 0) { |
1300 |
+ low = make_kgid(user_ns, urange[0]); |
1301 |
+ high = make_kgid(user_ns, urange[1]); |
1302 |
+- if (!gid_valid(low) || !gid_valid(high) || |
1303 |
+- (urange[1] < urange[0]) || gid_lt(high, low)) { |
1304 |
++ if (!gid_valid(low) || !gid_valid(high)) |
1305 |
++ return -EINVAL; |
1306 |
++ if (urange[1] < urange[0] || gid_lt(high, low)) { |
1307 |
+ low = make_kgid(&init_user_ns, 1); |
1308 |
+ high = make_kgid(&init_user_ns, 0); |
1309 |
+ } |
1310 |
+diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c |
1311 |
+index e3ece12f0250..e81ff9d545a4 100644 |
1312 |
+--- a/net/ipv4/tcp.c |
1313 |
++++ b/net/ipv4/tcp.c |
1314 |
+@@ -3415,8 +3415,7 @@ int tcp_abort(struct sock *sk, int err) |
1315 |
+ struct request_sock *req = inet_reqsk(sk); |
1316 |
+ |
1317 |
+ local_bh_disable(); |
1318 |
+- inet_csk_reqsk_queue_drop_and_put(req->rsk_listener, |
1319 |
+- req); |
1320 |
++ inet_csk_reqsk_queue_drop(req->rsk_listener, req); |
1321 |
+ local_bh_enable(); |
1322 |
+ return 0; |
1323 |
+ } |
1324 |
+diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig |
1325 |
+index ea71e4b0ab7a..2d36fd097299 100644 |
1326 |
+--- a/net/ipv6/Kconfig |
1327 |
++++ b/net/ipv6/Kconfig |
1328 |
+@@ -109,6 +109,7 @@ config IPV6_MIP6 |
1329 |
+ config IPV6_ILA |
1330 |
+ tristate "IPv6: Identifier Locator Addressing (ILA)" |
1331 |
+ depends on NETFILTER |
1332 |
++ select DST_CACHE |
1333 |
+ select LWTUNNEL |
1334 |
+ ---help--- |
1335 |
+ Support for IPv6 Identifier Locator Addressing (ILA). |
1336 |
+diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c |
1337 |
+index d081db125905..528218460bc5 100644 |
1338 |
+--- a/net/ipv6/ndisc.c |
1339 |
++++ b/net/ipv6/ndisc.c |
1340 |
+@@ -803,7 +803,7 @@ static void ndisc_recv_ns(struct sk_buff *skb) |
1341 |
+ return; |
1342 |
+ } |
1343 |
+ } |
1344 |
+- if (ndopts.nd_opts_nonce) |
1345 |
++ if (ndopts.nd_opts_nonce && ndopts.nd_opts_nonce->nd_opt_len == 1) |
1346 |
+ memcpy(&nonce, (u8 *)(ndopts.nd_opts_nonce + 1), 6); |
1347 |
+ |
1348 |
+ inc = ipv6_addr_is_multicast(daddr); |
1349 |
+diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c |
1350 |
+index f055ca10bbc1..abacbbc0b0e8 100644 |
1351 |
+--- a/sound/core/rawmidi.c |
1352 |
++++ b/sound/core/rawmidi.c |
1353 |
+@@ -635,7 +635,7 @@ static int snd_rawmidi_info_select_user(struct snd_card *card, |
1354 |
+ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, |
1355 |
+ struct snd_rawmidi_params * params) |
1356 |
+ { |
1357 |
+- char *newbuf; |
1358 |
++ char *newbuf, *oldbuf; |
1359 |
+ struct snd_rawmidi_runtime *runtime = substream->runtime; |
1360 |
+ |
1361 |
+ if (substream->append && substream->use_count > 1) |
1362 |
+@@ -648,13 +648,17 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, |
1363 |
+ return -EINVAL; |
1364 |
+ } |
1365 |
+ if (params->buffer_size != runtime->buffer_size) { |
1366 |
+- newbuf = krealloc(runtime->buffer, params->buffer_size, |
1367 |
+- GFP_KERNEL); |
1368 |
++ newbuf = kmalloc(params->buffer_size, GFP_KERNEL); |
1369 |
+ if (!newbuf) |
1370 |
+ return -ENOMEM; |
1371 |
++ spin_lock_irq(&runtime->lock); |
1372 |
++ oldbuf = runtime->buffer; |
1373 |
+ runtime->buffer = newbuf; |
1374 |
+ runtime->buffer_size = params->buffer_size; |
1375 |
+ runtime->avail = runtime->buffer_size; |
1376 |
++ runtime->appl_ptr = runtime->hw_ptr = 0; |
1377 |
++ spin_unlock_irq(&runtime->lock); |
1378 |
++ kfree(oldbuf); |
1379 |
+ } |
1380 |
+ runtime->avail_min = params->avail_min; |
1381 |
+ substream->active_sensing = !params->no_active_sensing; |
1382 |
+@@ -665,7 +669,7 @@ EXPORT_SYMBOL(snd_rawmidi_output_params); |
1383 |
+ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, |
1384 |
+ struct snd_rawmidi_params * params) |
1385 |
+ { |
1386 |
+- char *newbuf; |
1387 |
++ char *newbuf, *oldbuf; |
1388 |
+ struct snd_rawmidi_runtime *runtime = substream->runtime; |
1389 |
+ |
1390 |
+ snd_rawmidi_drain_input(substream); |
1391 |
+@@ -676,12 +680,16 @@ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, |
1392 |
+ return -EINVAL; |
1393 |
+ } |
1394 |
+ if (params->buffer_size != runtime->buffer_size) { |
1395 |
+- newbuf = krealloc(runtime->buffer, params->buffer_size, |
1396 |
+- GFP_KERNEL); |
1397 |
++ newbuf = kmalloc(params->buffer_size, GFP_KERNEL); |
1398 |
+ if (!newbuf) |
1399 |
+ return -ENOMEM; |
1400 |
++ spin_lock_irq(&runtime->lock); |
1401 |
++ oldbuf = runtime->buffer; |
1402 |
+ runtime->buffer = newbuf; |
1403 |
+ runtime->buffer_size = params->buffer_size; |
1404 |
++ runtime->appl_ptr = runtime->hw_ptr = 0; |
1405 |
++ spin_unlock_irq(&runtime->lock); |
1406 |
++ kfree(oldbuf); |
1407 |
+ } |
1408 |
+ runtime->avail_min = params->avail_min; |
1409 |
+ return 0; |
1410 |
+diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c |
1411 |
+index ba9a7e552183..88ce2f1022e1 100644 |
1412 |
+--- a/sound/pci/hda/patch_conexant.c |
1413 |
++++ b/sound/pci/hda/patch_conexant.c |
1414 |
+@@ -965,6 +965,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = { |
1415 |
+ SND_PCI_QUIRK(0x103c, 0x8115, "HP Z1 Gen3", CXT_FIXUP_HP_GATE_MIC), |
1416 |
+ SND_PCI_QUIRK(0x103c, 0x814f, "HP ZBook 15u G3", CXT_FIXUP_MUTE_LED_GPIO), |
1417 |
+ SND_PCI_QUIRK(0x103c, 0x822e, "HP ProBook 440 G4", CXT_FIXUP_MUTE_LED_GPIO), |
1418 |
++ SND_PCI_QUIRK(0x103c, 0x836e, "HP ProBook 455 G5", CXT_FIXUP_MUTE_LED_GPIO), |
1419 |
+ SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
1420 |
+ SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
1421 |
+ SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
1422 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
1423 |
+index bf7737fc3b28..dcc9e6551b51 100644 |
1424 |
+--- a/sound/pci/hda/patch_realtek.c |
1425 |
++++ b/sound/pci/hda/patch_realtek.c |
1426 |
+@@ -6402,6 +6402,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
1427 |
+ SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), |
1428 |
+ SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
1429 |
+ SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
1430 |
++ SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), |
1431 |
+ SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), |
1432 |
+ SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), |
1433 |
+ SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
1434 |
+diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c |
1435 |
+index f2ac53ab8243..58a9b31b0dd5 100644 |
1436 |
+--- a/virt/kvm/eventfd.c |
1437 |
++++ b/virt/kvm/eventfd.c |
1438 |
+@@ -119,8 +119,12 @@ irqfd_shutdown(struct work_struct *work) |
1439 |
+ { |
1440 |
+ struct kvm_kernel_irqfd *irqfd = |
1441 |
+ container_of(work, struct kvm_kernel_irqfd, shutdown); |
1442 |
++ struct kvm *kvm = irqfd->kvm; |
1443 |
+ u64 cnt; |
1444 |
+ |
1445 |
++ /* Make sure irqfd has been initalized in assign path. */ |
1446 |
++ synchronize_srcu(&kvm->irq_srcu); |
1447 |
++ |
1448 |
+ /* |
1449 |
+ * Synchronize with the wait-queue and unhook ourselves to prevent |
1450 |
+ * further events. |
1451 |
+@@ -387,7 +391,6 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) |
1452 |
+ |
1453 |
+ idx = srcu_read_lock(&kvm->irq_srcu); |
1454 |
+ irqfd_update(kvm, irqfd); |
1455 |
+- srcu_read_unlock(&kvm->irq_srcu, idx); |
1456 |
+ |
1457 |
+ list_add_tail(&irqfd->list, &kvm->irqfds.items); |
1458 |
+ |
1459 |
+@@ -421,6 +424,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) |
1460 |
+ } |
1461 |
+ #endif |
1462 |
+ |
1463 |
++ srcu_read_unlock(&kvm->irq_srcu, idx); |
1464 |
+ return 0; |
1465 |
+ |
1466 |
+ fail: |