1 |
commit: e1faa06af3c08517d7d8167fcf1bb83efad3a450 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 16 23:30:18 2019 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 16 23:30:18 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=e1faa06a |
7 |
|
8 |
proj/linux-patches: Linux patch 4.14.94 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1093_linux-4.14.94.patch | 1074 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 1078 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 6f66609..41aba45 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -415,6 +415,10 @@ Patch: 1092_4.14.93.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.14.93 |
23 |
|
24 |
+Patch: 1093_4.14.94.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.14.94 |
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/1093_linux-4.14.94.patch b/1093_linux-4.14.94.patch |
33 |
new file mode 100644 |
34 |
index 0000000..48ff9f4 |
35 |
--- /dev/null |
36 |
+++ b/1093_linux-4.14.94.patch |
37 |
@@ -0,0 +1,1074 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index a521e4cbd66f..e9a138dd964a 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 14 |
46 |
+-SUBLEVEL = 93 |
47 |
++SUBLEVEL = 94 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Petit Gorille |
50 |
+ |
51 |
+diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h |
52 |
+index 523308d030d2..72fac8646e9b 100644 |
53 |
+--- a/arch/x86/include/asm/kvm_host.h |
54 |
++++ b/arch/x86/include/asm/kvm_host.h |
55 |
+@@ -539,7 +539,20 @@ struct kvm_vcpu_arch { |
56 |
+ struct kvm_mmu_memory_cache mmu_page_cache; |
57 |
+ struct kvm_mmu_memory_cache mmu_page_header_cache; |
58 |
+ |
59 |
++ /* |
60 |
++ * QEMU userspace and the guest each have their own FPU state. |
61 |
++ * In vcpu_run, we switch between the user and guest FPU contexts. |
62 |
++ * While running a VCPU, the VCPU thread will have the guest FPU |
63 |
++ * context. |
64 |
++ * |
65 |
++ * Note that while the PKRU state lives inside the fpu registers, |
66 |
++ * it is switched out separately at VMENTER and VMEXIT time. The |
67 |
++ * "guest_fpu" state here contains the guest FPU context, with the |
68 |
++ * host PRKU bits. |
69 |
++ */ |
70 |
++ struct fpu user_fpu; |
71 |
+ struct fpu guest_fpu; |
72 |
++ |
73 |
+ u64 xcr0; |
74 |
+ u64 guest_supported_xcr0; |
75 |
+ u32 guest_xstate_size; |
76 |
+diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c |
77 |
+index 98b24d668b08..004e60470a77 100644 |
78 |
+--- a/arch/x86/kernel/cpu/bugs.c |
79 |
++++ b/arch/x86/kernel/cpu/bugs.c |
80 |
+@@ -212,7 +212,7 @@ static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init = |
81 |
+ static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init = |
82 |
+ SPECTRE_V2_USER_NONE; |
83 |
+ |
84 |
+-#ifdef RETPOLINE |
85 |
++#ifdef CONFIG_RETPOLINE |
86 |
+ static bool spectre_v2_bad_module; |
87 |
+ |
88 |
+ bool retpoline_module_ok(bool has_retpoline) |
89 |
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c |
90 |
+index ac431fa778aa..130be2efafbe 100644 |
91 |
+--- a/arch/x86/kvm/x86.c |
92 |
++++ b/arch/x86/kvm/x86.c |
93 |
+@@ -3020,7 +3020,6 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) |
94 |
+ srcu_read_unlock(&vcpu->kvm->srcu, idx); |
95 |
+ pagefault_enable(); |
96 |
+ kvm_x86_ops->vcpu_put(vcpu); |
97 |
+- kvm_put_guest_fpu(vcpu); |
98 |
+ vcpu->arch.last_host_tsc = rdtsc(); |
99 |
+ /* |
100 |
+ * If userspace has set any breakpoints or watchpoints, dr6 is restored |
101 |
+@@ -5377,13 +5376,10 @@ static void emulator_halt(struct x86_emulate_ctxt *ctxt) |
102 |
+ |
103 |
+ static void emulator_get_fpu(struct x86_emulate_ctxt *ctxt) |
104 |
+ { |
105 |
+- preempt_disable(); |
106 |
+- kvm_load_guest_fpu(emul_to_vcpu(ctxt)); |
107 |
+ } |
108 |
+ |
109 |
+ static void emulator_put_fpu(struct x86_emulate_ctxt *ctxt) |
110 |
+ { |
111 |
+- preempt_enable(); |
112 |
+ } |
113 |
+ |
114 |
+ static int emulator_intercept(struct x86_emulate_ctxt *ctxt, |
115 |
+@@ -7083,7 +7079,6 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) |
116 |
+ preempt_disable(); |
117 |
+ |
118 |
+ kvm_x86_ops->prepare_guest_switch(vcpu); |
119 |
+- kvm_load_guest_fpu(vcpu); |
120 |
+ |
121 |
+ /* |
122 |
+ * Disable IRQs before setting IN_GUEST_MODE. Posted interrupt |
123 |
+@@ -7428,12 +7423,14 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) |
124 |
+ } |
125 |
+ } |
126 |
+ |
127 |
++ kvm_load_guest_fpu(vcpu); |
128 |
++ |
129 |
+ if (unlikely(vcpu->arch.complete_userspace_io)) { |
130 |
+ int (*cui)(struct kvm_vcpu *) = vcpu->arch.complete_userspace_io; |
131 |
+ vcpu->arch.complete_userspace_io = NULL; |
132 |
+ r = cui(vcpu); |
133 |
+ if (r <= 0) |
134 |
+- goto out; |
135 |
++ goto out_fpu; |
136 |
+ } else |
137 |
+ WARN_ON(vcpu->arch.pio.count || vcpu->mmio_needed); |
138 |
+ |
139 |
+@@ -7442,6 +7439,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) |
140 |
+ else |
141 |
+ r = vcpu_run(vcpu); |
142 |
+ |
143 |
++out_fpu: |
144 |
++ kvm_put_guest_fpu(vcpu); |
145 |
+ out: |
146 |
+ kvm_put_guest_fpu(vcpu); |
147 |
+ post_kvm_run_save(vcpu); |
148 |
+@@ -7865,32 +7864,25 @@ static void fx_init(struct kvm_vcpu *vcpu) |
149 |
+ vcpu->arch.cr0 |= X86_CR0_ET; |
150 |
+ } |
151 |
+ |
152 |
++/* Swap (qemu) user FPU context for the guest FPU context. */ |
153 |
+ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu) |
154 |
+ { |
155 |
+- if (vcpu->guest_fpu_loaded) |
156 |
+- return; |
157 |
+- |
158 |
+- /* |
159 |
+- * Restore all possible states in the guest, |
160 |
+- * and assume host would use all available bits. |
161 |
+- * Guest xcr0 would be loaded later. |
162 |
+- */ |
163 |
+- vcpu->guest_fpu_loaded = 1; |
164 |
+- __kernel_fpu_begin(); |
165 |
++ preempt_disable(); |
166 |
++ copy_fpregs_to_fpstate(&vcpu->arch.user_fpu); |
167 |
+ /* PKRU is separately restored in kvm_x86_ops->run. */ |
168 |
+ __copy_kernel_to_fpregs(&vcpu->arch.guest_fpu.state, |
169 |
+ ~XFEATURE_MASK_PKRU); |
170 |
++ preempt_enable(); |
171 |
+ trace_kvm_fpu(1); |
172 |
+ } |
173 |
+ |
174 |
++/* When vcpu_run ends, restore user space FPU context. */ |
175 |
+ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu) |
176 |
+ { |
177 |
+- if (!vcpu->guest_fpu_loaded) |
178 |
+- return; |
179 |
+- |
180 |
+- vcpu->guest_fpu_loaded = 0; |
181 |
++ preempt_disable(); |
182 |
+ copy_fpregs_to_fpstate(&vcpu->arch.guest_fpu); |
183 |
+- __kernel_fpu_end(); |
184 |
++ copy_kernel_to_fpregs(&vcpu->arch.user_fpu.state); |
185 |
++ preempt_enable(); |
186 |
+ ++vcpu->stat.fpu_reload; |
187 |
+ trace_kvm_fpu(0); |
188 |
+ } |
189 |
+diff --git a/drivers/acpi/pmic/intel_pmic_xpower.c b/drivers/acpi/pmic/intel_pmic_xpower.c |
190 |
+index 6c99d3f81095..8735ac99566f 100644 |
191 |
+--- a/drivers/acpi/pmic/intel_pmic_xpower.c |
192 |
++++ b/drivers/acpi/pmic/intel_pmic_xpower.c |
193 |
+@@ -27,8 +27,11 @@ |
194 |
+ #define GPI1_LDO_ON (3 << 0) |
195 |
+ #define GPI1_LDO_OFF (4 << 0) |
196 |
+ |
197 |
+-#define AXP288_ADC_TS_PIN_GPADC 0xf2 |
198 |
+-#define AXP288_ADC_TS_PIN_ON 0xf3 |
199 |
++#define AXP288_ADC_TS_CURRENT_ON_OFF_MASK GENMASK(1, 0) |
200 |
++#define AXP288_ADC_TS_CURRENT_OFF (0 << 0) |
201 |
++#define AXP288_ADC_TS_CURRENT_ON_WHEN_CHARGING (1 << 0) |
202 |
++#define AXP288_ADC_TS_CURRENT_ON_ONDEMAND (2 << 0) |
203 |
++#define AXP288_ADC_TS_CURRENT_ON (3 << 0) |
204 |
+ |
205 |
+ static struct pmic_table power_table[] = { |
206 |
+ { |
207 |
+@@ -211,22 +214,44 @@ static int intel_xpower_pmic_update_power(struct regmap *regmap, int reg, |
208 |
+ */ |
209 |
+ static int intel_xpower_pmic_get_raw_temp(struct regmap *regmap, int reg) |
210 |
+ { |
211 |
++ int ret, adc_ts_pin_ctrl; |
212 |
+ u8 buf[2]; |
213 |
+- int ret; |
214 |
+ |
215 |
+- ret = regmap_write(regmap, AXP288_ADC_TS_PIN_CTRL, |
216 |
+- AXP288_ADC_TS_PIN_GPADC); |
217 |
++ /* |
218 |
++ * The current-source used for the battery temp-sensor (TS) is shared |
219 |
++ * with the GPADC. For proper fuel-gauge and charger operation the TS |
220 |
++ * current-source needs to be permanently on. But to read the GPADC we |
221 |
++ * need to temporary switch the TS current-source to ondemand, so that |
222 |
++ * the GPADC can use it, otherwise we will always read an all 0 value. |
223 |
++ * |
224 |
++ * Note that the switching from on to on-ondemand is not necessary |
225 |
++ * when the TS current-source is off (this happens on devices which |
226 |
++ * do not use the TS-pin). |
227 |
++ */ |
228 |
++ ret = regmap_read(regmap, AXP288_ADC_TS_PIN_CTRL, &adc_ts_pin_ctrl); |
229 |
+ if (ret) |
230 |
+ return ret; |
231 |
+ |
232 |
+- /* After switching to the GPADC pin give things some time to settle */ |
233 |
+- usleep_range(6000, 10000); |
234 |
++ if (adc_ts_pin_ctrl & AXP288_ADC_TS_CURRENT_ON_OFF_MASK) { |
235 |
++ ret = regmap_update_bits(regmap, AXP288_ADC_TS_PIN_CTRL, |
236 |
++ AXP288_ADC_TS_CURRENT_ON_OFF_MASK, |
237 |
++ AXP288_ADC_TS_CURRENT_ON_ONDEMAND); |
238 |
++ if (ret) |
239 |
++ return ret; |
240 |
++ |
241 |
++ /* Wait a bit after switching the current-source */ |
242 |
++ usleep_range(6000, 10000); |
243 |
++ } |
244 |
+ |
245 |
+ ret = regmap_bulk_read(regmap, AXP288_GP_ADC_H, buf, 2); |
246 |
+ if (ret == 0) |
247 |
+ ret = (buf[0] << 4) + ((buf[1] >> 4) & 0x0f); |
248 |
+ |
249 |
+- regmap_write(regmap, AXP288_ADC_TS_PIN_CTRL, AXP288_ADC_TS_PIN_ON); |
250 |
++ if (adc_ts_pin_ctrl & AXP288_ADC_TS_CURRENT_ON_OFF_MASK) { |
251 |
++ regmap_update_bits(regmap, AXP288_ADC_TS_PIN_CTRL, |
252 |
++ AXP288_ADC_TS_CURRENT_ON_OFF_MASK, |
253 |
++ AXP288_ADC_TS_CURRENT_ON); |
254 |
++ } |
255 |
+ |
256 |
+ return ret; |
257 |
+ } |
258 |
+diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c |
259 |
+index 1b475bc1ae16..665e93ca0b40 100644 |
260 |
+--- a/drivers/acpi/power.c |
261 |
++++ b/drivers/acpi/power.c |
262 |
+@@ -131,6 +131,23 @@ void acpi_power_resources_list_free(struct list_head *list) |
263 |
+ } |
264 |
+ } |
265 |
+ |
266 |
++static bool acpi_power_resource_is_dup(union acpi_object *package, |
267 |
++ unsigned int start, unsigned int i) |
268 |
++{ |
269 |
++ acpi_handle rhandle, dup; |
270 |
++ unsigned int j; |
271 |
++ |
272 |
++ /* The caller is expected to check the package element types */ |
273 |
++ rhandle = package->package.elements[i].reference.handle; |
274 |
++ for (j = start; j < i; j++) { |
275 |
++ dup = package->package.elements[j].reference.handle; |
276 |
++ if (dup == rhandle) |
277 |
++ return true; |
278 |
++ } |
279 |
++ |
280 |
++ return false; |
281 |
++} |
282 |
++ |
283 |
+ int acpi_extract_power_resources(union acpi_object *package, unsigned int start, |
284 |
+ struct list_head *list) |
285 |
+ { |
286 |
+@@ -150,6 +167,11 @@ int acpi_extract_power_resources(union acpi_object *package, unsigned int start, |
287 |
+ err = -ENODEV; |
288 |
+ break; |
289 |
+ } |
290 |
++ |
291 |
++ /* Some ACPI tables contain duplicate power resource references */ |
292 |
++ if (acpi_power_resource_is_dup(package, start, i)) |
293 |
++ continue; |
294 |
++ |
295 |
+ err = acpi_add_power_resource(rhandle); |
296 |
+ if (err) |
297 |
+ break; |
298 |
+diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c |
299 |
+index 9057dad2a64c..f2b1994d58a0 100644 |
300 |
+--- a/drivers/block/rbd.c |
301 |
++++ b/drivers/block/rbd.c |
302 |
+@@ -6308,7 +6308,6 @@ static ssize_t do_rbd_remove(struct bus_type *bus, |
303 |
+ struct list_head *tmp; |
304 |
+ int dev_id; |
305 |
+ char opt_buf[6]; |
306 |
+- bool already = false; |
307 |
+ bool force = false; |
308 |
+ int ret; |
309 |
+ |
310 |
+@@ -6341,13 +6340,13 @@ static ssize_t do_rbd_remove(struct bus_type *bus, |
311 |
+ spin_lock_irq(&rbd_dev->lock); |
312 |
+ if (rbd_dev->open_count && !force) |
313 |
+ ret = -EBUSY; |
314 |
+- else |
315 |
+- already = test_and_set_bit(RBD_DEV_FLAG_REMOVING, |
316 |
+- &rbd_dev->flags); |
317 |
++ else if (test_and_set_bit(RBD_DEV_FLAG_REMOVING, |
318 |
++ &rbd_dev->flags)) |
319 |
++ ret = -EINPROGRESS; |
320 |
+ spin_unlock_irq(&rbd_dev->lock); |
321 |
+ } |
322 |
+ spin_unlock(&rbd_dev_list_lock); |
323 |
+- if (ret < 0 || already) |
324 |
++ if (ret) |
325 |
+ return ret; |
326 |
+ |
327 |
+ if (force) { |
328 |
+diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c |
329 |
+index 29d1d3df3164..ad6812baa611 100644 |
330 |
+--- a/drivers/gpu/drm/drm_fb_helper.c |
331 |
++++ b/drivers/gpu/drm/drm_fb_helper.c |
332 |
+@@ -1509,6 +1509,64 @@ static bool drm_fb_pixel_format_equal(const struct fb_var_screeninfo *var_1, |
333 |
+ var_1->transp.msb_right == var_2->transp.msb_right; |
334 |
+ } |
335 |
+ |
336 |
++static void drm_fb_helper_fill_pixel_fmt(struct fb_var_screeninfo *var, |
337 |
++ u8 depth) |
338 |
++{ |
339 |
++ switch (depth) { |
340 |
++ case 8: |
341 |
++ var->red.offset = 0; |
342 |
++ var->green.offset = 0; |
343 |
++ var->blue.offset = 0; |
344 |
++ var->red.length = 8; /* 8bit DAC */ |
345 |
++ var->green.length = 8; |
346 |
++ var->blue.length = 8; |
347 |
++ var->transp.offset = 0; |
348 |
++ var->transp.length = 0; |
349 |
++ break; |
350 |
++ case 15: |
351 |
++ var->red.offset = 10; |
352 |
++ var->green.offset = 5; |
353 |
++ var->blue.offset = 0; |
354 |
++ var->red.length = 5; |
355 |
++ var->green.length = 5; |
356 |
++ var->blue.length = 5; |
357 |
++ var->transp.offset = 15; |
358 |
++ var->transp.length = 1; |
359 |
++ break; |
360 |
++ case 16: |
361 |
++ var->red.offset = 11; |
362 |
++ var->green.offset = 5; |
363 |
++ var->blue.offset = 0; |
364 |
++ var->red.length = 5; |
365 |
++ var->green.length = 6; |
366 |
++ var->blue.length = 5; |
367 |
++ var->transp.offset = 0; |
368 |
++ break; |
369 |
++ case 24: |
370 |
++ var->red.offset = 16; |
371 |
++ var->green.offset = 8; |
372 |
++ var->blue.offset = 0; |
373 |
++ var->red.length = 8; |
374 |
++ var->green.length = 8; |
375 |
++ var->blue.length = 8; |
376 |
++ var->transp.offset = 0; |
377 |
++ var->transp.length = 0; |
378 |
++ break; |
379 |
++ case 32: |
380 |
++ var->red.offset = 16; |
381 |
++ var->green.offset = 8; |
382 |
++ var->blue.offset = 0; |
383 |
++ var->red.length = 8; |
384 |
++ var->green.length = 8; |
385 |
++ var->blue.length = 8; |
386 |
++ var->transp.offset = 24; |
387 |
++ var->transp.length = 8; |
388 |
++ break; |
389 |
++ default: |
390 |
++ break; |
391 |
++ } |
392 |
++} |
393 |
++ |
394 |
+ /** |
395 |
+ * drm_fb_helper_check_var - implementation for &fb_ops.fb_check_var |
396 |
+ * @var: screeninfo to check |
397 |
+@@ -1538,6 +1596,20 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, |
398 |
+ return -EINVAL; |
399 |
+ } |
400 |
+ |
401 |
++ /* |
402 |
++ * Workaround for SDL 1.2, which is known to be setting all pixel format |
403 |
++ * fields values to zero in some cases. We treat this situation as a |
404 |
++ * kind of "use some reasonable autodetected values". |
405 |
++ */ |
406 |
++ if (!var->red.offset && !var->green.offset && |
407 |
++ !var->blue.offset && !var->transp.offset && |
408 |
++ !var->red.length && !var->green.length && |
409 |
++ !var->blue.length && !var->transp.length && |
410 |
++ !var->red.msb_right && !var->green.msb_right && |
411 |
++ !var->blue.msb_right && !var->transp.msb_right) { |
412 |
++ drm_fb_helper_fill_pixel_fmt(var, fb->format->depth); |
413 |
++ } |
414 |
++ |
415 |
+ /* |
416 |
+ * drm fbdev emulation doesn't support changing the pixel format at all, |
417 |
+ * so reject all pixel format changing requests. |
418 |
+@@ -1848,59 +1920,7 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe |
419 |
+ info->var.yoffset = 0; |
420 |
+ info->var.activate = FB_ACTIVATE_NOW; |
421 |
+ |
422 |
+- switch (fb->format->depth) { |
423 |
+- case 8: |
424 |
+- info->var.red.offset = 0; |
425 |
+- info->var.green.offset = 0; |
426 |
+- info->var.blue.offset = 0; |
427 |
+- info->var.red.length = 8; /* 8bit DAC */ |
428 |
+- info->var.green.length = 8; |
429 |
+- info->var.blue.length = 8; |
430 |
+- info->var.transp.offset = 0; |
431 |
+- info->var.transp.length = 0; |
432 |
+- break; |
433 |
+- case 15: |
434 |
+- info->var.red.offset = 10; |
435 |
+- info->var.green.offset = 5; |
436 |
+- info->var.blue.offset = 0; |
437 |
+- info->var.red.length = 5; |
438 |
+- info->var.green.length = 5; |
439 |
+- info->var.blue.length = 5; |
440 |
+- info->var.transp.offset = 15; |
441 |
+- info->var.transp.length = 1; |
442 |
+- break; |
443 |
+- case 16: |
444 |
+- info->var.red.offset = 11; |
445 |
+- info->var.green.offset = 5; |
446 |
+- info->var.blue.offset = 0; |
447 |
+- info->var.red.length = 5; |
448 |
+- info->var.green.length = 6; |
449 |
+- info->var.blue.length = 5; |
450 |
+- info->var.transp.offset = 0; |
451 |
+- break; |
452 |
+- case 24: |
453 |
+- info->var.red.offset = 16; |
454 |
+- info->var.green.offset = 8; |
455 |
+- info->var.blue.offset = 0; |
456 |
+- info->var.red.length = 8; |
457 |
+- info->var.green.length = 8; |
458 |
+- info->var.blue.length = 8; |
459 |
+- info->var.transp.offset = 0; |
460 |
+- info->var.transp.length = 0; |
461 |
+- break; |
462 |
+- case 32: |
463 |
+- info->var.red.offset = 16; |
464 |
+- info->var.green.offset = 8; |
465 |
+- info->var.blue.offset = 0; |
466 |
+- info->var.red.length = 8; |
467 |
+- info->var.green.length = 8; |
468 |
+- info->var.blue.length = 8; |
469 |
+- info->var.transp.offset = 24; |
470 |
+- info->var.transp.length = 8; |
471 |
+- break; |
472 |
+- default: |
473 |
+- break; |
474 |
+- } |
475 |
++ drm_fb_helper_fill_pixel_fmt(&info->var, fb->format->depth); |
476 |
+ |
477 |
+ info->var.xres = fb_width; |
478 |
+ info->var.yres = fb_height; |
479 |
+diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c |
480 |
+index 6f638bbc922d..00e8e675cbeb 100644 |
481 |
+--- a/drivers/i2c/i2c-dev.c |
482 |
++++ b/drivers/i2c/i2c-dev.c |
483 |
+@@ -461,9 +461,15 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
484 |
+ return i2cdev_ioctl_smbus(client, arg); |
485 |
+ |
486 |
+ case I2C_RETRIES: |
487 |
++ if (arg > INT_MAX) |
488 |
++ return -EINVAL; |
489 |
++ |
490 |
+ client->adapter->retries = arg; |
491 |
+ break; |
492 |
+ case I2C_TIMEOUT: |
493 |
++ if (arg > INT_MAX) |
494 |
++ return -EINVAL; |
495 |
++ |
496 |
+ /* For historical reasons, user-space sets the timeout |
497 |
+ * value in units of 10 ms. |
498 |
+ */ |
499 |
+diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c |
500 |
+index 423a339e53bc..8ab0195f8d32 100644 |
501 |
+--- a/drivers/usb/class/cdc-acm.c |
502 |
++++ b/drivers/usb/class/cdc-acm.c |
503 |
+@@ -1893,6 +1893,13 @@ static const struct usb_device_id acm_ids[] = { |
504 |
+ .driver_info = IGNORE_DEVICE, |
505 |
+ }, |
506 |
+ |
507 |
++ { USB_DEVICE(0x1bc7, 0x0021), /* Telit 3G ACM only composition */ |
508 |
++ .driver_info = SEND_ZERO_PACKET, |
509 |
++ }, |
510 |
++ { USB_DEVICE(0x1bc7, 0x0023), /* Telit 3G ACM + ECM composition */ |
511 |
++ .driver_info = SEND_ZERO_PACKET, |
512 |
++ }, |
513 |
++ |
514 |
+ /* control interfaces without any protocol set */ |
515 |
+ { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, |
516 |
+ USB_CDC_PROTO_NONE) }, |
517 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
518 |
+index cf378b1ed373..733479ddf8a7 100644 |
519 |
+--- a/drivers/usb/core/quirks.c |
520 |
++++ b/drivers/usb/core/quirks.c |
521 |
+@@ -240,7 +240,8 @@ static const struct usb_device_id usb_quirk_list[] = { |
522 |
+ USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, |
523 |
+ |
524 |
+ /* Corsair K70 RGB */ |
525 |
+- { USB_DEVICE(0x1b1c, 0x1b13), .driver_info = USB_QUIRK_DELAY_INIT }, |
526 |
++ { USB_DEVICE(0x1b1c, 0x1b13), .driver_info = USB_QUIRK_DELAY_INIT | |
527 |
++ USB_QUIRK_DELAY_CTRL_MSG }, |
528 |
+ |
529 |
+ /* Corsair Strafe */ |
530 |
+ { USB_DEVICE(0x1b1c, 0x1b15), .driver_info = USB_QUIRK_DELAY_INIT | |
531 |
+diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c |
532 |
+index 344ec8631481..13f2c051dbf2 100644 |
533 |
+--- a/drivers/usb/storage/scsiglue.c |
534 |
++++ b/drivers/usb/storage/scsiglue.c |
535 |
+@@ -251,8 +251,12 @@ static int slave_configure(struct scsi_device *sdev) |
536 |
+ if (!(us->fflags & US_FL_NEEDS_CAP16)) |
537 |
+ sdev->try_rc_10_first = 1; |
538 |
+ |
539 |
+- /* assume SPC3 or latter devices support sense size > 18 */ |
540 |
+- if (sdev->scsi_level > SCSI_SPC_2) |
541 |
++ /* |
542 |
++ * assume SPC3 or latter devices support sense size > 18 |
543 |
++ * unless US_FL_BAD_SENSE quirk is specified. |
544 |
++ */ |
545 |
++ if (sdev->scsi_level > SCSI_SPC_2 && |
546 |
++ !(us->fflags & US_FL_BAD_SENSE)) |
547 |
+ us->fflags |= US_FL_SANE_SENSE; |
548 |
+ |
549 |
+ /* |
550 |
+diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h |
551 |
+index 5e9b35a91431..0fa88daed149 100644 |
552 |
+--- a/drivers/usb/storage/unusual_devs.h |
553 |
++++ b/drivers/usb/storage/unusual_devs.h |
554 |
+@@ -1284,6 +1284,18 @@ UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff, |
555 |
+ USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
556 |
+ US_FL_FIX_CAPACITY ), |
557 |
+ |
558 |
++/* |
559 |
++ * Reported by Icenowy Zheng <icenowy@××××.io> |
560 |
++ * The SMI SM3350 USB-UFS bridge controller will enter a wrong state |
561 |
++ * that do not process read/write command if a long sense is requested, |
562 |
++ * so force to use 18-byte sense. |
563 |
++ */ |
564 |
++UNUSUAL_DEV( 0x090c, 0x3350, 0x0000, 0xffff, |
565 |
++ "SMI", |
566 |
++ "SM3350 UFS-to-USB-Mass-Storage bridge", |
567 |
++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
568 |
++ US_FL_BAD_SENSE ), |
569 |
++ |
570 |
+ /* |
571 |
+ * Reported by Paul Hartman <paul.hartman+linux@×××××.com> |
572 |
+ * This card reader returns "Illegal Request, Logical Block Address |
573 |
+diff --git a/fs/cifs/file.c b/fs/cifs/file.c |
574 |
+index 7d6539a04fac..1e176e11dbfa 100644 |
575 |
+--- a/fs/cifs/file.c |
576 |
++++ b/fs/cifs/file.c |
577 |
+@@ -1120,10 +1120,10 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) |
578 |
+ |
579 |
+ /* |
580 |
+ * Accessing maxBuf is racy with cifs_reconnect - need to store value |
581 |
+- * and check it for zero before using. |
582 |
++ * and check it before using. |
583 |
+ */ |
584 |
+ max_buf = tcon->ses->server->maxBuf; |
585 |
+- if (!max_buf) { |
586 |
++ if (max_buf < (sizeof(struct smb_hdr) + sizeof(LOCKING_ANDX_RANGE))) { |
587 |
+ free_xid(xid); |
588 |
+ return -EINVAL; |
589 |
+ } |
590 |
+@@ -1460,10 +1460,10 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, |
591 |
+ |
592 |
+ /* |
593 |
+ * Accessing maxBuf is racy with cifs_reconnect - need to store value |
594 |
+- * and check it for zero before using. |
595 |
++ * and check it before using. |
596 |
+ */ |
597 |
+ max_buf = tcon->ses->server->maxBuf; |
598 |
+- if (!max_buf) |
599 |
++ if (max_buf < (sizeof(struct smb_hdr) + sizeof(LOCKING_ANDX_RANGE))) |
600 |
+ return -EINVAL; |
601 |
+ |
602 |
+ max_num = (max_buf - sizeof(struct smb_hdr)) / |
603 |
+diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c |
604 |
+index b4b1f0305f29..79078533f807 100644 |
605 |
+--- a/fs/cifs/smb2file.c |
606 |
++++ b/fs/cifs/smb2file.c |
607 |
+@@ -124,10 +124,10 @@ smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, |
608 |
+ |
609 |
+ /* |
610 |
+ * Accessing maxBuf is racy with cifs_reconnect - need to store value |
611 |
+- * and check it for zero before using. |
612 |
++ * and check it before using. |
613 |
+ */ |
614 |
+ max_buf = tcon->ses->server->maxBuf; |
615 |
+- if (!max_buf) |
616 |
++ if (max_buf < sizeof(struct smb2_lock_element)) |
617 |
+ return -EINVAL; |
618 |
+ |
619 |
+ max_num = max_buf / sizeof(struct smb2_lock_element); |
620 |
+diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c |
621 |
+index 1581e8668b09..c0f8087d9819 100644 |
622 |
+--- a/fs/cifs/smb2pdu.c |
623 |
++++ b/fs/cifs/smb2pdu.c |
624 |
+@@ -2632,12 +2632,14 @@ smb2_async_readv(struct cifs_readdata *rdata) |
625 |
+ if (rdata->credits) { |
626 |
+ shdr->CreditCharge = cpu_to_le16(DIV_ROUND_UP(rdata->bytes, |
627 |
+ SMB2_MAX_BUFFER_SIZE)); |
628 |
+- shdr->CreditRequest = shdr->CreditCharge; |
629 |
++ shdr->CreditRequest = |
630 |
++ cpu_to_le16(le16_to_cpu(shdr->CreditCharge) + 1); |
631 |
+ spin_lock(&server->req_lock); |
632 |
+ server->credits += rdata->credits - |
633 |
+ le16_to_cpu(shdr->CreditCharge); |
634 |
+ spin_unlock(&server->req_lock); |
635 |
+ wake_up(&server->request_q); |
636 |
++ rdata->credits = le16_to_cpu(shdr->CreditCharge); |
637 |
+ flags |= CIFS_HAS_CREDITS; |
638 |
+ } |
639 |
+ |
640 |
+@@ -2842,12 +2844,14 @@ smb2_async_writev(struct cifs_writedata *wdata, |
641 |
+ if (wdata->credits) { |
642 |
+ shdr->CreditCharge = cpu_to_le16(DIV_ROUND_UP(wdata->bytes, |
643 |
+ SMB2_MAX_BUFFER_SIZE)); |
644 |
+- shdr->CreditRequest = shdr->CreditCharge; |
645 |
++ shdr->CreditRequest = |
646 |
++ cpu_to_le16(le16_to_cpu(shdr->CreditCharge) + 1); |
647 |
+ spin_lock(&server->req_lock); |
648 |
+ server->credits += wdata->credits - |
649 |
+ le16_to_cpu(shdr->CreditCharge); |
650 |
+ spin_unlock(&server->req_lock); |
651 |
+ wake_up(&server->request_q); |
652 |
++ wdata->credits = le16_to_cpu(shdr->CreditCharge); |
653 |
+ flags |= CIFS_HAS_CREDITS; |
654 |
+ } |
655 |
+ |
656 |
+diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c |
657 |
+index a10f51dfa7f5..ffc8757e5a3c 100644 |
658 |
+--- a/fs/cifs/transport.c |
659 |
++++ b/fs/cifs/transport.c |
660 |
+@@ -318,7 +318,7 @@ uncork: |
661 |
+ if (rc < 0 && rc != -EINTR) |
662 |
+ cifs_dbg(VFS, "Error %d sending data on socket to server\n", |
663 |
+ rc); |
664 |
+- else |
665 |
++ else if (rc > 0) |
666 |
+ rc = 0; |
667 |
+ |
668 |
+ return rc; |
669 |
+diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c |
670 |
+index 26a7fe5c4fd3..712f00995390 100644 |
671 |
+--- a/fs/ext4/fsync.c |
672 |
++++ b/fs/ext4/fsync.c |
673 |
+@@ -116,8 +116,16 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) |
674 |
+ goto out; |
675 |
+ } |
676 |
+ |
677 |
++ ret = file_write_and_wait_range(file, start, end); |
678 |
++ if (ret) |
679 |
++ return ret; |
680 |
++ |
681 |
+ if (!journal) { |
682 |
+- ret = __generic_file_fsync(file, start, end, datasync); |
683 |
++ struct writeback_control wbc = { |
684 |
++ .sync_mode = WB_SYNC_ALL |
685 |
++ }; |
686 |
++ |
687 |
++ ret = ext4_write_inode(inode, &wbc); |
688 |
+ if (!ret) |
689 |
+ ret = ext4_sync_parent(inode); |
690 |
+ if (test_opt(inode->i_sb, BARRIER)) |
691 |
+@@ -125,9 +133,6 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) |
692 |
+ goto out; |
693 |
+ } |
694 |
+ |
695 |
+- ret = file_write_and_wait_range(file, start, end); |
696 |
+- if (ret) |
697 |
+- return ret; |
698 |
+ /* |
699 |
+ * data=writeback,ordered: |
700 |
+ * The caller's filemap_fdatawrite()/wait will sync the data. |
701 |
+@@ -159,6 +164,9 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) |
702 |
+ ret = err; |
703 |
+ } |
704 |
+ out: |
705 |
++ err = file_check_and_advance_wb_err(file); |
706 |
++ if (ret == 0) |
707 |
++ ret = err; |
708 |
+ trace_ext4_sync_file_exit(inode, ret); |
709 |
+ return ret; |
710 |
+ } |
711 |
+diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c |
712 |
+index 40a2d1a428c2..137c752ab985 100644 |
713 |
+--- a/fs/ext4/inline.c |
714 |
++++ b/fs/ext4/inline.c |
715 |
+@@ -1864,12 +1864,12 @@ int ext4_inline_data_fiemap(struct inode *inode, |
716 |
+ physical += (char *)ext4_raw_inode(&iloc) - iloc.bh->b_data; |
717 |
+ physical += offsetof(struct ext4_inode, i_block); |
718 |
+ |
719 |
+- if (physical) |
720 |
+- error = fiemap_fill_next_extent(fieinfo, start, physical, |
721 |
+- inline_len, flags); |
722 |
+ brelse(iloc.bh); |
723 |
+ out: |
724 |
+ up_read(&EXT4_I(inode)->xattr_sem); |
725 |
++ if (physical) |
726 |
++ error = fiemap_fill_next_extent(fieinfo, start, physical, |
727 |
++ inline_len, flags); |
728 |
+ return (error < 0 ? error : 0); |
729 |
+ } |
730 |
+ |
731 |
+diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c |
732 |
+index 22c9bb8c671f..5eb28dcaa0f0 100644 |
733 |
+--- a/fs/ext4/inode.c |
734 |
++++ b/fs/ext4/inode.c |
735 |
+@@ -2776,7 +2776,8 @@ static int ext4_writepages(struct address_space *mapping, |
736 |
+ * We may need to convert up to one extent per block in |
737 |
+ * the page and we may dirty the inode. |
738 |
+ */ |
739 |
+- rsv_blocks = 1 + (PAGE_SIZE >> inode->i_blkbits); |
740 |
++ rsv_blocks = 1 + ext4_chunk_trans_blocks(inode, |
741 |
++ PAGE_SIZE >> inode->i_blkbits); |
742 |
+ } |
743 |
+ |
744 |
+ /* |
745 |
+diff --git a/fs/ext4/super.c b/fs/ext4/super.c |
746 |
+index 77300b8ca211..d0049064f62f 100644 |
747 |
+--- a/fs/ext4/super.c |
748 |
++++ b/fs/ext4/super.c |
749 |
+@@ -4844,7 +4844,7 @@ static int ext4_commit_super(struct super_block *sb, int sync) |
750 |
+ ext4_superblock_csum_set(sb); |
751 |
+ if (sync) |
752 |
+ lock_buffer(sbh); |
753 |
+- if (buffer_write_io_error(sbh)) { |
754 |
++ if (buffer_write_io_error(sbh) || !buffer_uptodate(sbh)) { |
755 |
+ /* |
756 |
+ * Oh, dear. A previous attempt to write the |
757 |
+ * superblock failed. This could happen because the |
758 |
+diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h |
759 |
+index c11032b06d68..00b06d7efb83 100644 |
760 |
+--- a/include/linux/compiler-gcc.h |
761 |
++++ b/include/linux/compiler-gcc.h |
762 |
+@@ -108,7 +108,7 @@ |
763 |
+ #define __weak __attribute__((weak)) |
764 |
+ #define __alias(symbol) __attribute__((alias(#symbol))) |
765 |
+ |
766 |
+-#ifdef RETPOLINE |
767 |
++#ifdef CONFIG_RETPOLINE |
768 |
+ #define __noretpoline __attribute__((indirect_branch("keep"))) |
769 |
+ #endif |
770 |
+ |
771 |
+diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h |
772 |
+index b81d458ad4fb..b6962ae6237e 100644 |
773 |
+--- a/include/linux/kvm_host.h |
774 |
++++ b/include/linux/kvm_host.h |
775 |
+@@ -232,7 +232,7 @@ struct kvm_vcpu { |
776 |
+ struct mutex mutex; |
777 |
+ struct kvm_run *run; |
778 |
+ |
779 |
+- int guest_fpu_loaded, guest_xcr0_loaded; |
780 |
++ int guest_xcr0_loaded; |
781 |
+ struct swait_queue_head wq; |
782 |
+ struct pid __rcu *pid; |
783 |
+ int sigset_active; |
784 |
+diff --git a/include/linux/module.h b/include/linux/module.h |
785 |
+index b1cc541f2ddf..a9d546c5b9aa 100644 |
786 |
+--- a/include/linux/module.h |
787 |
++++ b/include/linux/module.h |
788 |
+@@ -794,7 +794,7 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr, |
789 |
+ static inline void module_bug_cleanup(struct module *mod) {} |
790 |
+ #endif /* CONFIG_GENERIC_BUG */ |
791 |
+ |
792 |
+-#ifdef RETPOLINE |
793 |
++#ifdef CONFIG_RETPOLINE |
794 |
+ extern bool retpoline_module_ok(bool has_retpoline); |
795 |
+ #else |
796 |
+ static inline bool retpoline_module_ok(bool has_retpoline) |
797 |
+diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h |
798 |
+index 3b9f0d1dbb80..e1aa80c4d6db 100644 |
799 |
+--- a/include/linux/sunrpc/svc.h |
800 |
++++ b/include/linux/sunrpc/svc.h |
801 |
+@@ -292,9 +292,12 @@ struct svc_rqst { |
802 |
+ struct svc_cacherep * rq_cacherep; /* cache info */ |
803 |
+ struct task_struct *rq_task; /* service thread */ |
804 |
+ spinlock_t rq_lock; /* per-request lock */ |
805 |
++ struct net *rq_bc_net; /* pointer to backchannel's |
806 |
++ * net namespace |
807 |
++ */ |
808 |
+ }; |
809 |
+ |
810 |
+-#define SVC_NET(svc_rqst) (svc_rqst->rq_xprt->xpt_net) |
811 |
++#define SVC_NET(rqst) (rqst->rq_xprt ? rqst->rq_xprt->xpt_net : rqst->rq_bc_net) |
812 |
+ |
813 |
+ /* |
814 |
+ * Rigorous type checking on sockaddr type conversions |
815 |
+diff --git a/mm/memory.c b/mm/memory.c |
816 |
+index b6cfe0cf0ead..fb9f7737c1ff 100644 |
817 |
+--- a/mm/memory.c |
818 |
++++ b/mm/memory.c |
819 |
+@@ -3191,6 +3191,29 @@ static int __do_fault(struct vm_fault *vmf) |
820 |
+ struct vm_area_struct *vma = vmf->vma; |
821 |
+ int ret; |
822 |
+ |
823 |
++ /* |
824 |
++ * Preallocate pte before we take page_lock because this might lead to |
825 |
++ * deadlocks for memcg reclaim which waits for pages under writeback: |
826 |
++ * lock_page(A) |
827 |
++ * SetPageWriteback(A) |
828 |
++ * unlock_page(A) |
829 |
++ * lock_page(B) |
830 |
++ * lock_page(B) |
831 |
++ * pte_alloc_pne |
832 |
++ * shrink_page_list |
833 |
++ * wait_on_page_writeback(A) |
834 |
++ * SetPageWriteback(B) |
835 |
++ * unlock_page(B) |
836 |
++ * # flush A, B to clear the writeback |
837 |
++ */ |
838 |
++ if (pmd_none(*vmf->pmd) && !vmf->prealloc_pte) { |
839 |
++ vmf->prealloc_pte = pte_alloc_one(vmf->vma->vm_mm, |
840 |
++ vmf->address); |
841 |
++ if (!vmf->prealloc_pte) |
842 |
++ return VM_FAULT_OOM; |
843 |
++ smp_wmb(); /* See comment in __pte_alloc() */ |
844 |
++ } |
845 |
++ |
846 |
+ ret = vma->vm_ops->fault(vmf); |
847 |
+ if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY | |
848 |
+ VM_FAULT_DONE_COW))) |
849 |
+diff --git a/mm/slab.c b/mm/slab.c |
850 |
+index 68ab88e2920e..09df506ae830 100644 |
851 |
+--- a/mm/slab.c |
852 |
++++ b/mm/slab.c |
853 |
+@@ -679,8 +679,10 @@ static struct alien_cache *__alloc_alien_cache(int node, int entries, |
854 |
+ struct alien_cache *alc = NULL; |
855 |
+ |
856 |
+ alc = kmalloc_node(memsize, gfp, node); |
857 |
+- init_arraycache(&alc->ac, entries, batch); |
858 |
+- spin_lock_init(&alc->lock); |
859 |
++ if (alc) { |
860 |
++ init_arraycache(&alc->ac, entries, batch); |
861 |
++ spin_lock_init(&alc->lock); |
862 |
++ } |
863 |
+ return alc; |
864 |
+ } |
865 |
+ |
866 |
+diff --git a/mm/util.c b/mm/util.c |
867 |
+index 547e04b5cfff..842ba5fb662e 100644 |
868 |
+--- a/mm/util.c |
869 |
++++ b/mm/util.c |
870 |
+@@ -449,7 +449,7 @@ bool page_mapped(struct page *page) |
871 |
+ return true; |
872 |
+ if (PageHuge(page)) |
873 |
+ return false; |
874 |
+- for (i = 0; i < hpage_nr_pages(page); i++) { |
875 |
++ for (i = 0; i < (1 << compound_order(page)); i++) { |
876 |
+ if (atomic_read(&page[i]._mapcount) >= 0) |
877 |
+ return true; |
878 |
+ } |
879 |
+diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c |
880 |
+index aa04666f929d..3a9a03717212 100644 |
881 |
+--- a/net/sunrpc/svc.c |
882 |
++++ b/net/sunrpc/svc.c |
883 |
+@@ -1144,6 +1144,8 @@ void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) |
884 |
+ static __printf(2,3) void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) {} |
885 |
+ #endif |
886 |
+ |
887 |
++extern void svc_tcp_prep_reply_hdr(struct svc_rqst *); |
888 |
++ |
889 |
+ /* |
890 |
+ * Common routine for processing the RPC request. |
891 |
+ */ |
892 |
+@@ -1172,7 +1174,8 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) |
893 |
+ clear_bit(RQ_DROPME, &rqstp->rq_flags); |
894 |
+ |
895 |
+ /* Setup reply header */ |
896 |
+- rqstp->rq_xprt->xpt_ops->xpo_prep_reply_hdr(rqstp); |
897 |
++ if (rqstp->rq_prot == IPPROTO_TCP) |
898 |
++ svc_tcp_prep_reply_hdr(rqstp); |
899 |
+ |
900 |
+ svc_putu32(resv, rqstp->rq_xid); |
901 |
+ |
902 |
+@@ -1244,7 +1247,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) |
903 |
+ * for lower versions. RPC_PROG_MISMATCH seems to be the closest |
904 |
+ * fit. |
905 |
+ */ |
906 |
+- if (versp->vs_need_cong_ctrl && |
907 |
++ if (versp->vs_need_cong_ctrl && rqstp->rq_xprt && |
908 |
+ !test_bit(XPT_CONG_CTRL, &rqstp->rq_xprt->xpt_flags)) |
909 |
+ goto err_bad_vers; |
910 |
+ |
911 |
+@@ -1335,7 +1338,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) |
912 |
+ return 0; |
913 |
+ |
914 |
+ close: |
915 |
+- if (test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags)) |
916 |
++ if (rqstp->rq_xprt && test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags)) |
917 |
+ svc_close_xprt(rqstp->rq_xprt); |
918 |
+ dprintk("svc: svc_process close\n"); |
919 |
+ return 0; |
920 |
+@@ -1462,10 +1465,10 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req, |
921 |
+ dprintk("svc: %s(%p)\n", __func__, req); |
922 |
+ |
923 |
+ /* Build the svc_rqst used by the common processing routine */ |
924 |
+- rqstp->rq_xprt = serv->sv_bc_xprt; |
925 |
+ rqstp->rq_xid = req->rq_xid; |
926 |
+ rqstp->rq_prot = req->rq_xprt->prot; |
927 |
+ rqstp->rq_server = serv; |
928 |
++ rqstp->rq_bc_net = req->rq_xprt->xprt_net; |
929 |
+ |
930 |
+ rqstp->rq_addrlen = sizeof(req->rq_xprt->addr); |
931 |
+ memcpy(&rqstp->rq_addr, &req->rq_xprt->addr, rqstp->rq_addrlen); |
932 |
+diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c |
933 |
+index ea7b5a3a53f0..7e5f849b44cd 100644 |
934 |
+--- a/net/sunrpc/svc_xprt.c |
935 |
++++ b/net/sunrpc/svc_xprt.c |
936 |
+@@ -510,10 +510,11 @@ out: |
937 |
+ */ |
938 |
+ void svc_reserve(struct svc_rqst *rqstp, int space) |
939 |
+ { |
940 |
++ struct svc_xprt *xprt = rqstp->rq_xprt; |
941 |
++ |
942 |
+ space += rqstp->rq_res.head[0].iov_len; |
943 |
+ |
944 |
+- if (space < rqstp->rq_reserved) { |
945 |
+- struct svc_xprt *xprt = rqstp->rq_xprt; |
946 |
++ if (xprt && space < rqstp->rq_reserved) { |
947 |
+ atomic_sub((rqstp->rq_reserved - space), &xprt->xpt_reserved); |
948 |
+ rqstp->rq_reserved = space; |
949 |
+ |
950 |
+diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c |
951 |
+index c83df30e9655..d6771f3b715b 100644 |
952 |
+--- a/net/sunrpc/svcsock.c |
953 |
++++ b/net/sunrpc/svcsock.c |
954 |
+@@ -1207,7 +1207,7 @@ static int svc_tcp_sendto(struct svc_rqst *rqstp) |
955 |
+ /* |
956 |
+ * Setup response header. TCP has a 4B record length field. |
957 |
+ */ |
958 |
+-static void svc_tcp_prep_reply_hdr(struct svc_rqst *rqstp) |
959 |
++void svc_tcp_prep_reply_hdr(struct svc_rqst *rqstp) |
960 |
+ { |
961 |
+ struct kvec *resv = &rqstp->rq_res.head[0]; |
962 |
+ |
963 |
+diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c |
964 |
+index 957f6041dd79..18bc8738e989 100644 |
965 |
+--- a/scripts/mod/modpost.c |
966 |
++++ b/scripts/mod/modpost.c |
967 |
+@@ -2168,7 +2168,7 @@ static void add_intree_flag(struct buffer *b, int is_intree) |
968 |
+ /* Cannot check for assembler */ |
969 |
+ static void add_retpoline(struct buffer *b) |
970 |
+ { |
971 |
+- buf_printf(b, "\n#ifdef RETPOLINE\n"); |
972 |
++ buf_printf(b, "\n#ifdef CONFIG_RETPOLINE\n"); |
973 |
+ buf_printf(b, "MODULE_INFO(retpoline, \"Y\");\n"); |
974 |
+ buf_printf(b, "#endif\n"); |
975 |
+ } |
976 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
977 |
+index 31c91e0a815e..1191d8925c44 100644 |
978 |
+--- a/sound/pci/hda/patch_realtek.c |
979 |
++++ b/sound/pci/hda/patch_realtek.c |
980 |
+@@ -4005,6 +4005,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) |
981 |
+ case 0x10ec0225: |
982 |
+ case 0x10ec0295: |
983 |
+ case 0x10ec0299: |
984 |
++ alc_process_coef_fw(codec, alc225_pre_hsmode); |
985 |
+ alc_process_coef_fw(codec, coef0225); |
986 |
+ break; |
987 |
+ case 0x10ec0867: |
988 |
+@@ -5252,6 +5253,13 @@ static void alc274_fixup_bind_dacs(struct hda_codec *codec, |
989 |
+ spec->gen.preferred_dacs = preferred_pairs; |
990 |
+ } |
991 |
+ |
992 |
++static void alc_fixup_disable_mic_vref(struct hda_codec *codec, |
993 |
++ const struct hda_fixup *fix, int action) |
994 |
++{ |
995 |
++ if (action == HDA_FIXUP_ACT_PRE_PROBE) |
996 |
++ snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
997 |
++} |
998 |
++ |
999 |
+ /* for hda_fixup_thinkpad_acpi() */ |
1000 |
+ #include "thinkpad_helper.c" |
1001 |
+ |
1002 |
+@@ -5361,6 +5369,7 @@ enum { |
1003 |
+ ALC293_FIXUP_LENOVO_SPK_NOISE, |
1004 |
+ ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
1005 |
+ ALC255_FIXUP_DELL_SPK_NOISE, |
1006 |
++ ALC225_FIXUP_DISABLE_MIC_VREF, |
1007 |
+ ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
1008 |
+ ALC295_FIXUP_DISABLE_DAC3, |
1009 |
+ ALC280_FIXUP_HP_HEADSET_MIC, |
1010 |
+@@ -6062,6 +6071,12 @@ static const struct hda_fixup alc269_fixups[] = { |
1011 |
+ .chained = true, |
1012 |
+ .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
1013 |
+ }, |
1014 |
++ [ALC225_FIXUP_DISABLE_MIC_VREF] = { |
1015 |
++ .type = HDA_FIXUP_FUNC, |
1016 |
++ .v.func = alc_fixup_disable_mic_vref, |
1017 |
++ .chained = true, |
1018 |
++ .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
1019 |
++ }, |
1020 |
+ [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
1021 |
+ .type = HDA_FIXUP_VERBS, |
1022 |
+ .v.verbs = (const struct hda_verb[]) { |
1023 |
+@@ -6071,7 +6086,7 @@ static const struct hda_fixup alc269_fixups[] = { |
1024 |
+ {} |
1025 |
+ }, |
1026 |
+ .chained = true, |
1027 |
+- .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
1028 |
++ .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF |
1029 |
+ }, |
1030 |
+ [ALC280_FIXUP_HP_HEADSET_MIC] = { |
1031 |
+ .type = HDA_FIXUP_FUNC, |
1032 |
+@@ -6311,6 +6326,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
1033 |
+ SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
1034 |
+ SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
1035 |
+ SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), |
1036 |
++ SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
1037 |
+ SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
1038 |
+ SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
1039 |
+ SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
1040 |
+diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c |
1041 |
+index ed42b8cf6f5b..32aa88c19b8d 100644 |
1042 |
+--- a/virt/kvm/arm/arm.c |
1043 |
++++ b/virt/kvm/arm/arm.c |
1044 |
+@@ -61,7 +61,7 @@ static DEFINE_PER_CPU(struct kvm_vcpu *, kvm_arm_running_vcpu); |
1045 |
+ static atomic64_t kvm_vmid_gen = ATOMIC64_INIT(1); |
1046 |
+ static u32 kvm_next_vmid; |
1047 |
+ static unsigned int kvm_vmid_bits __read_mostly; |
1048 |
+-static DEFINE_RWLOCK(kvm_vmid_lock); |
1049 |
++static DEFINE_SPINLOCK(kvm_vmid_lock); |
1050 |
+ |
1051 |
+ static bool vgic_present; |
1052 |
+ |
1053 |
+@@ -447,7 +447,9 @@ void force_vm_exit(const cpumask_t *mask) |
1054 |
+ */ |
1055 |
+ static bool need_new_vmid_gen(struct kvm *kvm) |
1056 |
+ { |
1057 |
+- return unlikely(kvm->arch.vmid_gen != atomic64_read(&kvm_vmid_gen)); |
1058 |
++ u64 current_vmid_gen = atomic64_read(&kvm_vmid_gen); |
1059 |
++ smp_rmb(); /* Orders read of kvm_vmid_gen and kvm->arch.vmid */ |
1060 |
++ return unlikely(READ_ONCE(kvm->arch.vmid_gen) != current_vmid_gen); |
1061 |
+ } |
1062 |
+ |
1063 |
+ /** |
1064 |
+@@ -462,16 +464,11 @@ static void update_vttbr(struct kvm *kvm) |
1065 |
+ { |
1066 |
+ phys_addr_t pgd_phys; |
1067 |
+ u64 vmid; |
1068 |
+- bool new_gen; |
1069 |
+ |
1070 |
+- read_lock(&kvm_vmid_lock); |
1071 |
+- new_gen = need_new_vmid_gen(kvm); |
1072 |
+- read_unlock(&kvm_vmid_lock); |
1073 |
+- |
1074 |
+- if (!new_gen) |
1075 |
++ if (!need_new_vmid_gen(kvm)) |
1076 |
+ return; |
1077 |
+ |
1078 |
+- write_lock(&kvm_vmid_lock); |
1079 |
++ spin_lock(&kvm_vmid_lock); |
1080 |
+ |
1081 |
+ /* |
1082 |
+ * We need to re-check the vmid_gen here to ensure that if another vcpu |
1083 |
+@@ -479,7 +476,7 @@ static void update_vttbr(struct kvm *kvm) |
1084 |
+ * use the same vmid. |
1085 |
+ */ |
1086 |
+ if (!need_new_vmid_gen(kvm)) { |
1087 |
+- write_unlock(&kvm_vmid_lock); |
1088 |
++ spin_unlock(&kvm_vmid_lock); |
1089 |
+ return; |
1090 |
+ } |
1091 |
+ |
1092 |
+@@ -502,7 +499,6 @@ static void update_vttbr(struct kvm *kvm) |
1093 |
+ kvm_call_hyp(__kvm_flush_vm_context); |
1094 |
+ } |
1095 |
+ |
1096 |
+- kvm->arch.vmid_gen = atomic64_read(&kvm_vmid_gen); |
1097 |
+ kvm->arch.vmid = kvm_next_vmid; |
1098 |
+ kvm_next_vmid++; |
1099 |
+ kvm_next_vmid &= (1 << kvm_vmid_bits) - 1; |
1100 |
+@@ -513,7 +509,10 @@ static void update_vttbr(struct kvm *kvm) |
1101 |
+ vmid = ((u64)(kvm->arch.vmid) << VTTBR_VMID_SHIFT) & VTTBR_VMID_MASK(kvm_vmid_bits); |
1102 |
+ kvm->arch.vttbr = pgd_phys | vmid; |
1103 |
+ |
1104 |
+- write_unlock(&kvm_vmid_lock); |
1105 |
++ smp_wmb(); |
1106 |
++ WRITE_ONCE(kvm->arch.vmid_gen, atomic64_read(&kvm_vmid_gen)); |
1107 |
++ |
1108 |
++ spin_unlock(&kvm_vmid_lock); |
1109 |
+ } |
1110 |
+ |
1111 |
+ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu) |