1 |
commit: c53b80c8793617ab6bc636c77c557a0bbaf2c35a |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 20 09:59:59 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 20 09:59:59 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=c53b80c8 |
7 |
|
8 |
Linux patch 5.10.93 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1092_linux-5.10.93.patch | 997 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 1001 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 6d8b55d4..ababebf8 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -411,6 +411,10 @@ Patch: 1091_linux-5.10.92.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.10.92 |
23 |
|
24 |
+Patch: 1092_linux-5.10.93.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.10.93 |
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/1092_linux-5.10.93.patch b/1092_linux-5.10.93.patch |
33 |
new file mode 100644 |
34 |
index 00000000..52fb82c6 |
35 |
--- /dev/null |
36 |
+++ b/1092_linux-5.10.93.patch |
37 |
@@ -0,0 +1,997 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index a113a29545bdb..993559750df9d 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 5 |
45 |
+ PATCHLEVEL = 10 |
46 |
+-SUBLEVEL = 92 |
47 |
++SUBLEVEL = 93 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Dare mighty things |
50 |
+ |
51 |
+@@ -1073,7 +1073,7 @@ export mod_sign_cmd |
52 |
+ HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf) |
53 |
+ |
54 |
+ has_libelf = $(call try-run,\ |
55 |
+- echo "int main() {}" | $(HOSTCC) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0) |
56 |
++ echo "int main() {}" | $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0) |
57 |
+ |
58 |
+ ifdef CONFIG_STACK_VALIDATION |
59 |
+ ifeq ($(has_libelf),1) |
60 |
+diff --git a/arch/arm/kernel/perf_callchain.c b/arch/arm/kernel/perf_callchain.c |
61 |
+index 3b69a76d341e7..1626dfc6f6ce6 100644 |
62 |
+--- a/arch/arm/kernel/perf_callchain.c |
63 |
++++ b/arch/arm/kernel/perf_callchain.c |
64 |
+@@ -62,9 +62,10 @@ user_backtrace(struct frame_tail __user *tail, |
65 |
+ void |
66 |
+ perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs) |
67 |
+ { |
68 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
69 |
+ struct frame_tail __user *tail; |
70 |
+ |
71 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
72 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
73 |
+ /* We don't support guest os callchain now */ |
74 |
+ return; |
75 |
+ } |
76 |
+@@ -98,9 +99,10 @@ callchain_trace(struct stackframe *fr, |
77 |
+ void |
78 |
+ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs) |
79 |
+ { |
80 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
81 |
+ struct stackframe fr; |
82 |
+ |
83 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
84 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
85 |
+ /* We don't support guest os callchain now */ |
86 |
+ return; |
87 |
+ } |
88 |
+@@ -111,18 +113,21 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re |
89 |
+ |
90 |
+ unsigned long perf_instruction_pointer(struct pt_regs *regs) |
91 |
+ { |
92 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) |
93 |
+- return perf_guest_cbs->get_guest_ip(); |
94 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
95 |
++ |
96 |
++ if (guest_cbs && guest_cbs->is_in_guest()) |
97 |
++ return guest_cbs->get_guest_ip(); |
98 |
+ |
99 |
+ return instruction_pointer(regs); |
100 |
+ } |
101 |
+ |
102 |
+ unsigned long perf_misc_flags(struct pt_regs *regs) |
103 |
+ { |
104 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
105 |
+ int misc = 0; |
106 |
+ |
107 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
108 |
+- if (perf_guest_cbs->is_user_mode()) |
109 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
110 |
++ if (guest_cbs->is_user_mode()) |
111 |
+ misc |= PERF_RECORD_MISC_GUEST_USER; |
112 |
+ else |
113 |
+ misc |= PERF_RECORD_MISC_GUEST_KERNEL; |
114 |
+diff --git a/arch/arm64/kernel/perf_callchain.c b/arch/arm64/kernel/perf_callchain.c |
115 |
+index 88ff471b0bce5..58ae55d78a203 100644 |
116 |
+--- a/arch/arm64/kernel/perf_callchain.c |
117 |
++++ b/arch/arm64/kernel/perf_callchain.c |
118 |
+@@ -102,7 +102,9 @@ compat_user_backtrace(struct compat_frame_tail __user *tail, |
119 |
+ void perf_callchain_user(struct perf_callchain_entry_ctx *entry, |
120 |
+ struct pt_regs *regs) |
121 |
+ { |
122 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
123 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
124 |
++ |
125 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
126 |
+ /* We don't support guest os callchain now */ |
127 |
+ return; |
128 |
+ } |
129 |
+@@ -147,9 +149,10 @@ static bool callchain_trace(void *data, unsigned long pc) |
130 |
+ void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, |
131 |
+ struct pt_regs *regs) |
132 |
+ { |
133 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
134 |
+ struct stackframe frame; |
135 |
+ |
136 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
137 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
138 |
+ /* We don't support guest os callchain now */ |
139 |
+ return; |
140 |
+ } |
141 |
+@@ -160,18 +163,21 @@ void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, |
142 |
+ |
143 |
+ unsigned long perf_instruction_pointer(struct pt_regs *regs) |
144 |
+ { |
145 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) |
146 |
+- return perf_guest_cbs->get_guest_ip(); |
147 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
148 |
++ |
149 |
++ if (guest_cbs && guest_cbs->is_in_guest()) |
150 |
++ return guest_cbs->get_guest_ip(); |
151 |
+ |
152 |
+ return instruction_pointer(regs); |
153 |
+ } |
154 |
+ |
155 |
+ unsigned long perf_misc_flags(struct pt_regs *regs) |
156 |
+ { |
157 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
158 |
+ int misc = 0; |
159 |
+ |
160 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
161 |
+- if (perf_guest_cbs->is_user_mode()) |
162 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
163 |
++ if (guest_cbs->is_user_mode()) |
164 |
+ misc |= PERF_RECORD_MISC_GUEST_USER; |
165 |
+ else |
166 |
+ misc |= PERF_RECORD_MISC_GUEST_KERNEL; |
167 |
+diff --git a/arch/csky/kernel/perf_callchain.c b/arch/csky/kernel/perf_callchain.c |
168 |
+index ab55e98ee8f62..35318a635a5fa 100644 |
169 |
+--- a/arch/csky/kernel/perf_callchain.c |
170 |
++++ b/arch/csky/kernel/perf_callchain.c |
171 |
+@@ -86,10 +86,11 @@ static unsigned long user_backtrace(struct perf_callchain_entry_ctx *entry, |
172 |
+ void perf_callchain_user(struct perf_callchain_entry_ctx *entry, |
173 |
+ struct pt_regs *regs) |
174 |
+ { |
175 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
176 |
+ unsigned long fp = 0; |
177 |
+ |
178 |
+ /* C-SKY does not support virtualization. */ |
179 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) |
180 |
++ if (guest_cbs && guest_cbs->is_in_guest()) |
181 |
+ return; |
182 |
+ |
183 |
+ fp = regs->regs[4]; |
184 |
+@@ -110,10 +111,11 @@ void perf_callchain_user(struct perf_callchain_entry_ctx *entry, |
185 |
+ void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, |
186 |
+ struct pt_regs *regs) |
187 |
+ { |
188 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
189 |
+ struct stackframe fr; |
190 |
+ |
191 |
+ /* C-SKY does not support virtualization. */ |
192 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
193 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
194 |
+ pr_warn("C-SKY does not support perf in guest mode!"); |
195 |
+ return; |
196 |
+ } |
197 |
+diff --git a/arch/nds32/kernel/perf_event_cpu.c b/arch/nds32/kernel/perf_event_cpu.c |
198 |
+index 0ce6f9f307e6a..f387919607813 100644 |
199 |
+--- a/arch/nds32/kernel/perf_event_cpu.c |
200 |
++++ b/arch/nds32/kernel/perf_event_cpu.c |
201 |
+@@ -1363,6 +1363,7 @@ void |
202 |
+ perf_callchain_user(struct perf_callchain_entry_ctx *entry, |
203 |
+ struct pt_regs *regs) |
204 |
+ { |
205 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
206 |
+ unsigned long fp = 0; |
207 |
+ unsigned long gp = 0; |
208 |
+ unsigned long lp = 0; |
209 |
+@@ -1371,7 +1372,7 @@ perf_callchain_user(struct perf_callchain_entry_ctx *entry, |
210 |
+ |
211 |
+ leaf_fp = 0; |
212 |
+ |
213 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
214 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
215 |
+ /* We don't support guest os callchain now */ |
216 |
+ return; |
217 |
+ } |
218 |
+@@ -1479,9 +1480,10 @@ void |
219 |
+ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, |
220 |
+ struct pt_regs *regs) |
221 |
+ { |
222 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
223 |
+ struct stackframe fr; |
224 |
+ |
225 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
226 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
227 |
+ /* We don't support guest os callchain now */ |
228 |
+ return; |
229 |
+ } |
230 |
+@@ -1493,20 +1495,23 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, |
231 |
+ |
232 |
+ unsigned long perf_instruction_pointer(struct pt_regs *regs) |
233 |
+ { |
234 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
235 |
++ |
236 |
+ /* However, NDS32 does not support virtualization */ |
237 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) |
238 |
+- return perf_guest_cbs->get_guest_ip(); |
239 |
++ if (guest_cbs && guest_cbs->is_in_guest()) |
240 |
++ return guest_cbs->get_guest_ip(); |
241 |
+ |
242 |
+ return instruction_pointer(regs); |
243 |
+ } |
244 |
+ |
245 |
+ unsigned long perf_misc_flags(struct pt_regs *regs) |
246 |
+ { |
247 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
248 |
+ int misc = 0; |
249 |
+ |
250 |
+ /* However, NDS32 does not support virtualization */ |
251 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
252 |
+- if (perf_guest_cbs->is_user_mode()) |
253 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
254 |
++ if (guest_cbs->is_user_mode()) |
255 |
+ misc |= PERF_RECORD_MISC_GUEST_USER; |
256 |
+ else |
257 |
+ misc |= PERF_RECORD_MISC_GUEST_KERNEL; |
258 |
+diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h |
259 |
+index 3e8e19f5746c7..00c8cda1c9c31 100644 |
260 |
+--- a/arch/powerpc/include/asm/hvcall.h |
261 |
++++ b/arch/powerpc/include/asm/hvcall.h |
262 |
+@@ -382,6 +382,8 @@ |
263 |
+ #define H_CPU_BEHAV_BNDS_CHK_SPEC_BAR (1ull << 61) // IBM bit 2 |
264 |
+ #define H_CPU_BEHAV_FLUSH_COUNT_CACHE (1ull << 58) // IBM bit 5 |
265 |
+ #define H_CPU_BEHAV_FLUSH_LINK_STACK (1ull << 57) // IBM bit 6 |
266 |
++#define H_CPU_BEHAV_NO_L1D_FLUSH_ENTRY (1ull << 56) // IBM bit 7 |
267 |
++#define H_CPU_BEHAV_NO_L1D_FLUSH_UACCESS (1ull << 55) // IBM bit 8 |
268 |
+ |
269 |
+ /* Flag values used in H_REGISTER_PROC_TBL hcall */ |
270 |
+ #define PROC_TABLE_OP_MASK 0x18 |
271 |
+diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c |
272 |
+index 5f0d446a2325e..47dfada140e19 100644 |
273 |
+--- a/arch/powerpc/platforms/pseries/setup.c |
274 |
++++ b/arch/powerpc/platforms/pseries/setup.c |
275 |
+@@ -538,6 +538,12 @@ static void init_cpu_char_feature_flags(struct h_cpu_char_result *result) |
276 |
+ if (!(result->behaviour & H_CPU_BEHAV_L1D_FLUSH_PR)) |
277 |
+ security_ftr_clear(SEC_FTR_L1D_FLUSH_PR); |
278 |
+ |
279 |
++ if (result->behaviour & H_CPU_BEHAV_NO_L1D_FLUSH_ENTRY) |
280 |
++ security_ftr_clear(SEC_FTR_L1D_FLUSH_ENTRY); |
281 |
++ |
282 |
++ if (result->behaviour & H_CPU_BEHAV_NO_L1D_FLUSH_UACCESS) |
283 |
++ security_ftr_clear(SEC_FTR_L1D_FLUSH_UACCESS); |
284 |
++ |
285 |
+ if (!(result->behaviour & H_CPU_BEHAV_BNDS_CHK_SPEC_BAR)) |
286 |
+ security_ftr_clear(SEC_FTR_BNDS_CHK_SPEC_BAR); |
287 |
+ } |
288 |
+diff --git a/arch/riscv/kernel/perf_callchain.c b/arch/riscv/kernel/perf_callchain.c |
289 |
+index cf190197a22f6..ad3001cbdf618 100644 |
290 |
+--- a/arch/riscv/kernel/perf_callchain.c |
291 |
++++ b/arch/riscv/kernel/perf_callchain.c |
292 |
+@@ -60,10 +60,11 @@ static unsigned long user_backtrace(struct perf_callchain_entry_ctx *entry, |
293 |
+ void perf_callchain_user(struct perf_callchain_entry_ctx *entry, |
294 |
+ struct pt_regs *regs) |
295 |
+ { |
296 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
297 |
+ unsigned long fp = 0; |
298 |
+ |
299 |
+ /* RISC-V does not support perf in guest mode. */ |
300 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) |
301 |
++ if (guest_cbs && guest_cbs->is_in_guest()) |
302 |
+ return; |
303 |
+ |
304 |
+ fp = regs->s0; |
305 |
+@@ -84,8 +85,10 @@ void notrace walk_stackframe(struct task_struct *task, |
306 |
+ void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, |
307 |
+ struct pt_regs *regs) |
308 |
+ { |
309 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
310 |
++ |
311 |
+ /* RISC-V does not support perf in guest mode. */ |
312 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
313 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
314 |
+ pr_warn("RISC-V does not support perf in guest mode!"); |
315 |
+ return; |
316 |
+ } |
317 |
+diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c |
318 |
+index e6c4f29fc6956..b51ab19eb9721 100644 |
319 |
+--- a/arch/s390/kvm/interrupt.c |
320 |
++++ b/arch/s390/kvm/interrupt.c |
321 |
+@@ -2115,6 +2115,13 @@ int kvm_s390_is_stop_irq_pending(struct kvm_vcpu *vcpu) |
322 |
+ return test_bit(IRQ_PEND_SIGP_STOP, &li->pending_irqs); |
323 |
+ } |
324 |
+ |
325 |
++int kvm_s390_is_restart_irq_pending(struct kvm_vcpu *vcpu) |
326 |
++{ |
327 |
++ struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int; |
328 |
++ |
329 |
++ return test_bit(IRQ_PEND_RESTART, &li->pending_irqs); |
330 |
++} |
331 |
++ |
332 |
+ void kvm_s390_clear_stop_irq(struct kvm_vcpu *vcpu) |
333 |
+ { |
334 |
+ struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int; |
335 |
+diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c |
336 |
+index 00f03f363c9b0..07a04f3926009 100644 |
337 |
+--- a/arch/s390/kvm/kvm-s390.c |
338 |
++++ b/arch/s390/kvm/kvm-s390.c |
339 |
+@@ -4588,10 +4588,15 @@ int kvm_s390_vcpu_stop(struct kvm_vcpu *vcpu) |
340 |
+ } |
341 |
+ } |
342 |
+ |
343 |
+- /* SIGP STOP and SIGP STOP AND STORE STATUS has been fully processed */ |
344 |
++ /* |
345 |
++ * Set the VCPU to STOPPED and THEN clear the interrupt flag, |
346 |
++ * now that the SIGP STOP and SIGP STOP AND STORE STATUS orders |
347 |
++ * have been fully processed. This will ensure that the VCPU |
348 |
++ * is kept BUSY if another VCPU is inquiring with SIGP SENSE. |
349 |
++ */ |
350 |
++ kvm_s390_set_cpuflags(vcpu, CPUSTAT_STOPPED); |
351 |
+ kvm_s390_clear_stop_irq(vcpu); |
352 |
+ |
353 |
+- kvm_s390_set_cpuflags(vcpu, CPUSTAT_STOPPED); |
354 |
+ __disable_ibs_on_vcpu(vcpu); |
355 |
+ |
356 |
+ for (i = 0; i < online_vcpus; i++) { |
357 |
+diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h |
358 |
+index 2d134833bca69..a3e9b71d426f9 100644 |
359 |
+--- a/arch/s390/kvm/kvm-s390.h |
360 |
++++ b/arch/s390/kvm/kvm-s390.h |
361 |
+@@ -418,6 +418,7 @@ void kvm_s390_destroy_adapters(struct kvm *kvm); |
362 |
+ int kvm_s390_ext_call_pending(struct kvm_vcpu *vcpu); |
363 |
+ extern struct kvm_device_ops kvm_flic_ops; |
364 |
+ int kvm_s390_is_stop_irq_pending(struct kvm_vcpu *vcpu); |
365 |
++int kvm_s390_is_restart_irq_pending(struct kvm_vcpu *vcpu); |
366 |
+ void kvm_s390_clear_stop_irq(struct kvm_vcpu *vcpu); |
367 |
+ int kvm_s390_set_irq_state(struct kvm_vcpu *vcpu, |
368 |
+ void __user *buf, int len); |
369 |
+diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c |
370 |
+index 683036c1c92a8..3dc921e853b6e 100644 |
371 |
+--- a/arch/s390/kvm/sigp.c |
372 |
++++ b/arch/s390/kvm/sigp.c |
373 |
+@@ -288,6 +288,34 @@ static int handle_sigp_dst(struct kvm_vcpu *vcpu, u8 order_code, |
374 |
+ if (!dst_vcpu) |
375 |
+ return SIGP_CC_NOT_OPERATIONAL; |
376 |
+ |
377 |
++ /* |
378 |
++ * SIGP RESTART, SIGP STOP, and SIGP STOP AND STORE STATUS orders |
379 |
++ * are processed asynchronously. Until the affected VCPU finishes |
380 |
++ * its work and calls back into KVM to clear the (RESTART or STOP) |
381 |
++ * interrupt, we need to return any new non-reset orders "busy". |
382 |
++ * |
383 |
++ * This is important because a single VCPU could issue: |
384 |
++ * 1) SIGP STOP $DESTINATION |
385 |
++ * 2) SIGP SENSE $DESTINATION |
386 |
++ * |
387 |
++ * If the SIGP SENSE would not be rejected as "busy", it could |
388 |
++ * return an incorrect answer as to whether the VCPU is STOPPED |
389 |
++ * or OPERATING. |
390 |
++ */ |
391 |
++ if (order_code != SIGP_INITIAL_CPU_RESET && |
392 |
++ order_code != SIGP_CPU_RESET) { |
393 |
++ /* |
394 |
++ * Lockless check. Both SIGP STOP and SIGP (RE)START |
395 |
++ * properly synchronize everything while processing |
396 |
++ * their orders, while the guest cannot observe a |
397 |
++ * difference when issuing other orders from two |
398 |
++ * different VCPUs. |
399 |
++ */ |
400 |
++ if (kvm_s390_is_stop_irq_pending(dst_vcpu) || |
401 |
++ kvm_s390_is_restart_irq_pending(dst_vcpu)) |
402 |
++ return SIGP_CC_BUSY; |
403 |
++ } |
404 |
++ |
405 |
+ switch (order_code) { |
406 |
+ case SIGP_SENSE: |
407 |
+ vcpu->stat.instruction_sigp_sense++; |
408 |
+diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c |
409 |
+index 1f5d96ba4866d..b79b9f21cbb3b 100644 |
410 |
+--- a/arch/x86/events/core.c |
411 |
++++ b/arch/x86/events/core.c |
412 |
+@@ -2545,10 +2545,11 @@ static bool perf_hw_regs(struct pt_regs *regs) |
413 |
+ void |
414 |
+ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs) |
415 |
+ { |
416 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
417 |
+ struct unwind_state state; |
418 |
+ unsigned long addr; |
419 |
+ |
420 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
421 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
422 |
+ /* TODO: We don't support guest os callchain now */ |
423 |
+ return; |
424 |
+ } |
425 |
+@@ -2648,10 +2649,11 @@ perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *ent |
426 |
+ void |
427 |
+ perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs) |
428 |
+ { |
429 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
430 |
+ struct stack_frame frame; |
431 |
+ const struct stack_frame __user *fp; |
432 |
+ |
433 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
434 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
435 |
+ /* TODO: We don't support guest os callchain now */ |
436 |
+ return; |
437 |
+ } |
438 |
+@@ -2728,18 +2730,21 @@ static unsigned long code_segment_base(struct pt_regs *regs) |
439 |
+ |
440 |
+ unsigned long perf_instruction_pointer(struct pt_regs *regs) |
441 |
+ { |
442 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) |
443 |
+- return perf_guest_cbs->get_guest_ip(); |
444 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
445 |
++ |
446 |
++ if (guest_cbs && guest_cbs->is_in_guest()) |
447 |
++ return guest_cbs->get_guest_ip(); |
448 |
+ |
449 |
+ return regs->ip + code_segment_base(regs); |
450 |
+ } |
451 |
+ |
452 |
+ unsigned long perf_misc_flags(struct pt_regs *regs) |
453 |
+ { |
454 |
++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs(); |
455 |
+ int misc = 0; |
456 |
+ |
457 |
+- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
458 |
+- if (perf_guest_cbs->is_user_mode()) |
459 |
++ if (guest_cbs && guest_cbs->is_in_guest()) { |
460 |
++ if (guest_cbs->is_user_mode()) |
461 |
+ misc |= PERF_RECORD_MISC_GUEST_USER; |
462 |
+ else |
463 |
+ misc |= PERF_RECORD_MISC_GUEST_KERNEL; |
464 |
+diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c |
465 |
+index a521135247eb6..6525693e7aeaa 100644 |
466 |
+--- a/arch/x86/events/intel/core.c |
467 |
++++ b/arch/x86/events/intel/core.c |
468 |
+@@ -2586,6 +2586,7 @@ static int handle_pmi_common(struct pt_regs *regs, u64 status) |
469 |
+ { |
470 |
+ struct perf_sample_data data; |
471 |
+ struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); |
472 |
++ struct perf_guest_info_callbacks *guest_cbs; |
473 |
+ int bit; |
474 |
+ int handled = 0; |
475 |
+ |
476 |
+@@ -2651,9 +2652,11 @@ static int handle_pmi_common(struct pt_regs *regs, u64 status) |
477 |
+ */ |
478 |
+ if (__test_and_clear_bit(GLOBAL_STATUS_TRACE_TOPAPMI_BIT, (unsigned long *)&status)) { |
479 |
+ handled++; |
480 |
+- if (unlikely(perf_guest_cbs && perf_guest_cbs->is_in_guest() && |
481 |
+- perf_guest_cbs->handle_intel_pt_intr)) |
482 |
+- perf_guest_cbs->handle_intel_pt_intr(); |
483 |
++ |
484 |
++ guest_cbs = perf_get_guest_cbs(); |
485 |
++ if (unlikely(guest_cbs && guest_cbs->is_in_guest() && |
486 |
++ guest_cbs->handle_intel_pt_intr)) |
487 |
++ guest_cbs->handle_intel_pt_intr(); |
488 |
+ else |
489 |
+ intel_pt_interrupt(); |
490 |
+ } |
491 |
+diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h |
492 |
+index e8fb4b0394af2..13e10b970ac83 100644 |
493 |
+--- a/arch/x86/include/asm/kvm_host.h |
494 |
++++ b/arch/x86/include/asm/kvm_host.h |
495 |
+@@ -1306,6 +1306,7 @@ struct kvm_x86_init_ops { |
496 |
+ int (*disabled_by_bios)(void); |
497 |
+ int (*check_processor_compatibility)(void); |
498 |
+ int (*hardware_setup)(void); |
499 |
++ bool (*intel_pt_intr_in_guest)(void); |
500 |
+ |
501 |
+ struct kvm_x86_ops *runtime_ops; |
502 |
+ }; |
503 |
+diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c |
504 |
+index 38c453f28f1f0..351ef5cf1436a 100644 |
505 |
+--- a/arch/x86/kvm/vmx/vmx.c |
506 |
++++ b/arch/x86/kvm/vmx/vmx.c |
507 |
+@@ -7915,6 +7915,7 @@ static struct kvm_x86_init_ops vmx_init_ops __initdata = { |
508 |
+ .disabled_by_bios = vmx_disabled_by_bios, |
509 |
+ .check_processor_compatibility = vmx_check_processor_compat, |
510 |
+ .hardware_setup = hardware_setup, |
511 |
++ .intel_pt_intr_in_guest = vmx_pt_mode_is_host_guest, |
512 |
+ |
513 |
+ .runtime_ops = &vmx_x86_ops, |
514 |
+ }; |
515 |
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c |
516 |
+index 4f828cac0273e..271669dc8d90a 100644 |
517 |
+--- a/arch/x86/kvm/x86.c |
518 |
++++ b/arch/x86/kvm/x86.c |
519 |
+@@ -1229,7 +1229,7 @@ static const u32 msrs_to_save_all[] = { |
520 |
+ MSR_IA32_UMWAIT_CONTROL, |
521 |
+ |
522 |
+ MSR_ARCH_PERFMON_FIXED_CTR0, MSR_ARCH_PERFMON_FIXED_CTR1, |
523 |
+- MSR_ARCH_PERFMON_FIXED_CTR0 + 2, MSR_ARCH_PERFMON_FIXED_CTR0 + 3, |
524 |
++ MSR_ARCH_PERFMON_FIXED_CTR0 + 2, |
525 |
+ MSR_CORE_PERF_FIXED_CTR_CTRL, MSR_CORE_PERF_GLOBAL_STATUS, |
526 |
+ MSR_CORE_PERF_GLOBAL_CTRL, MSR_CORE_PERF_GLOBAL_OVF_CTRL, |
527 |
+ MSR_ARCH_PERFMON_PERFCTR0, MSR_ARCH_PERFMON_PERFCTR1, |
528 |
+@@ -7882,7 +7882,7 @@ static struct perf_guest_info_callbacks kvm_guest_cbs = { |
529 |
+ .is_in_guest = kvm_is_in_guest, |
530 |
+ .is_user_mode = kvm_is_user_mode, |
531 |
+ .get_guest_ip = kvm_get_guest_ip, |
532 |
+- .handle_intel_pt_intr = kvm_handle_intel_pt_intr, |
533 |
++ .handle_intel_pt_intr = NULL, |
534 |
+ }; |
535 |
+ |
536 |
+ #ifdef CONFIG_X86_64 |
537 |
+@@ -8005,6 +8005,8 @@ int kvm_arch_init(void *opaque) |
538 |
+ PT_PRESENT_MASK, 0, sme_me_mask); |
539 |
+ kvm_timer_init(); |
540 |
+ |
541 |
++ if (ops->intel_pt_intr_in_guest && ops->intel_pt_intr_in_guest()) |
542 |
++ kvm_guest_cbs.handle_intel_pt_intr = kvm_handle_intel_pt_intr; |
543 |
+ perf_register_guest_info_callbacks(&kvm_guest_cbs); |
544 |
+ |
545 |
+ if (boot_cpu_has(X86_FEATURE_XSAVE)) { |
546 |
+@@ -8042,6 +8044,7 @@ void kvm_arch_exit(void) |
547 |
+ #endif |
548 |
+ kvm_lapic_exit(); |
549 |
+ perf_unregister_guest_info_callbacks(&kvm_guest_cbs); |
550 |
++ kvm_guest_cbs.handle_intel_pt_intr = NULL; |
551 |
+ |
552 |
+ if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) |
553 |
+ cpufreq_unregister_notifier(&kvmclock_cpufreq_notifier_block, |
554 |
+diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c |
555 |
+index a71d141179439..b5cbaa61cbea7 100644 |
556 |
+--- a/drivers/base/devtmpfs.c |
557 |
++++ b/drivers/base/devtmpfs.c |
558 |
+@@ -59,8 +59,15 @@ static struct dentry *public_dev_mount(struct file_system_type *fs_type, int fla |
559 |
+ const char *dev_name, void *data) |
560 |
+ { |
561 |
+ struct super_block *s = mnt->mnt_sb; |
562 |
++ int err; |
563 |
++ |
564 |
+ atomic_inc(&s->s_active); |
565 |
+ down_write(&s->s_umount); |
566 |
++ err = reconfigure_single(s, flags, data); |
567 |
++ if (err < 0) { |
568 |
++ deactivate_locked_super(s); |
569 |
++ return ERR_PTR(err); |
570 |
++ } |
571 |
+ return dget(s->s_root); |
572 |
+ } |
573 |
+ |
574 |
+diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c |
575 |
+index 172c751a4f6c2..f08e056ed0ae4 100644 |
576 |
+--- a/drivers/firmware/qemu_fw_cfg.c |
577 |
++++ b/drivers/firmware/qemu_fw_cfg.c |
578 |
+@@ -388,9 +388,7 @@ static void fw_cfg_sysfs_cache_cleanup(void) |
579 |
+ struct fw_cfg_sysfs_entry *entry, *next; |
580 |
+ |
581 |
+ list_for_each_entry_safe(entry, next, &fw_cfg_entry_cache, list) { |
582 |
+- /* will end up invoking fw_cfg_sysfs_cache_delist() |
583 |
+- * via each object's release() method (i.e. destructor) |
584 |
+- */ |
585 |
++ fw_cfg_sysfs_cache_delist(entry); |
586 |
+ kobject_put(&entry->kobj); |
587 |
+ } |
588 |
+ } |
589 |
+@@ -448,7 +446,6 @@ static void fw_cfg_sysfs_release_entry(struct kobject *kobj) |
590 |
+ { |
591 |
+ struct fw_cfg_sysfs_entry *entry = to_entry(kobj); |
592 |
+ |
593 |
+- fw_cfg_sysfs_cache_delist(entry); |
594 |
+ kfree(entry); |
595 |
+ } |
596 |
+ |
597 |
+@@ -601,20 +598,18 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f) |
598 |
+ /* set file entry information */ |
599 |
+ entry->size = be32_to_cpu(f->size); |
600 |
+ entry->select = be16_to_cpu(f->select); |
601 |
+- memcpy(entry->name, f->name, FW_CFG_MAX_FILE_PATH); |
602 |
++ strscpy(entry->name, f->name, FW_CFG_MAX_FILE_PATH); |
603 |
+ |
604 |
+ /* register entry under "/sys/firmware/qemu_fw_cfg/by_key/" */ |
605 |
+ err = kobject_init_and_add(&entry->kobj, &fw_cfg_sysfs_entry_ktype, |
606 |
+ fw_cfg_sel_ko, "%d", entry->select); |
607 |
+- if (err) { |
608 |
+- kobject_put(&entry->kobj); |
609 |
+- return err; |
610 |
+- } |
611 |
++ if (err) |
612 |
++ goto err_put_entry; |
613 |
+ |
614 |
+ /* add raw binary content access */ |
615 |
+ err = sysfs_create_bin_file(&entry->kobj, &fw_cfg_sysfs_attr_raw); |
616 |
+ if (err) |
617 |
+- goto err_add_raw; |
618 |
++ goto err_del_entry; |
619 |
+ |
620 |
+ /* try adding "/sys/firmware/qemu_fw_cfg/by_name/" symlink */ |
621 |
+ fw_cfg_build_symlink(fw_cfg_fname_kset, &entry->kobj, entry->name); |
622 |
+@@ -623,9 +618,10 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f) |
623 |
+ fw_cfg_sysfs_cache_enlist(entry); |
624 |
+ return 0; |
625 |
+ |
626 |
+-err_add_raw: |
627 |
++err_del_entry: |
628 |
+ kobject_del(&entry->kobj); |
629 |
+- kfree(entry); |
630 |
++err_put_entry: |
631 |
++ kobject_put(&entry->kobj); |
632 |
+ return err; |
633 |
+ } |
634 |
+ |
635 |
+diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c |
636 |
+index b8477fa93b7d7..f6373d678d256 100644 |
637 |
+--- a/drivers/media/usb/uvc/uvc_video.c |
638 |
++++ b/drivers/media/usb/uvc/uvc_video.c |
639 |
+@@ -1915,6 +1915,10 @@ static int uvc_video_start_transfer(struct uvc_streaming *stream, |
640 |
+ if (ep == NULL) |
641 |
+ return -EIO; |
642 |
+ |
643 |
++ /* Reject broken descriptors. */ |
644 |
++ if (usb_endpoint_maxp(&ep->desc) == 0) |
645 |
++ return -EIO; |
646 |
++ |
647 |
+ ret = uvc_init_video_bulk(stream, ep, gfp_flags); |
648 |
+ } |
649 |
+ |
650 |
+diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig |
651 |
+index aef14990e5f7c..19726ebd973d0 100644 |
652 |
+--- a/drivers/mtd/chips/Kconfig |
653 |
++++ b/drivers/mtd/chips/Kconfig |
654 |
+@@ -55,12 +55,14 @@ choice |
655 |
+ LITTLE_ENDIAN_BYTE, if the bytes are reversed. |
656 |
+ |
657 |
+ config MTD_CFI_NOSWAP |
658 |
++ depends on !ARCH_IXP4XX || CPU_BIG_ENDIAN |
659 |
+ bool "NO" |
660 |
+ |
661 |
+ config MTD_CFI_BE_BYTE_SWAP |
662 |
+ bool "BIG_ENDIAN_BYTE" |
663 |
+ |
664 |
+ config MTD_CFI_LE_BYTE_SWAP |
665 |
++ depends on !ARCH_IXP4XX |
666 |
+ bool "LITTLE_ENDIAN_BYTE" |
667 |
+ |
668 |
+ endchoice |
669 |
+diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig |
670 |
+index 6650acbc961e9..fc0aaa03c5242 100644 |
671 |
+--- a/drivers/mtd/maps/Kconfig |
672 |
++++ b/drivers/mtd/maps/Kconfig |
673 |
+@@ -325,7 +325,7 @@ config MTD_DC21285 |
674 |
+ |
675 |
+ config MTD_IXP4XX |
676 |
+ tristate "CFI Flash device mapped on Intel IXP4xx based systems" |
677 |
+- depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX |
678 |
++ depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX && MTD_CFI_ADV_OPTIONS |
679 |
+ help |
680 |
+ This enables MTD access to flash devices on platforms based |
681 |
+ on Intel's IXP4xx family of network processors such as the |
682 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c |
683 |
+index 6312fddd9c00a..eaba661133280 100644 |
684 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c |
685 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c |
686 |
+@@ -1000,6 +1000,7 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw) |
687 |
+ _initpabias(hw); |
688 |
+ rtl92c_dm_init(hw); |
689 |
+ exit: |
690 |
++ local_irq_disable(); |
691 |
+ local_irq_restore(flags); |
692 |
+ return err; |
693 |
+ } |
694 |
+diff --git a/drivers/remoteproc/qcom_pil_info.c b/drivers/remoteproc/qcom_pil_info.c |
695 |
+index 7c007dd7b2000..aca21560e20b8 100644 |
696 |
+--- a/drivers/remoteproc/qcom_pil_info.c |
697 |
++++ b/drivers/remoteproc/qcom_pil_info.c |
698 |
+@@ -104,7 +104,7 @@ int qcom_pil_info_store(const char *image, phys_addr_t base, size_t size) |
699 |
+ return -ENOMEM; |
700 |
+ |
701 |
+ found_unused: |
702 |
+- memcpy_toio(entry, image, PIL_RELOC_NAME_LEN); |
703 |
++ memcpy_toio(entry, image, strnlen(image, PIL_RELOC_NAME_LEN)); |
704 |
+ found_existing: |
705 |
+ /* Use two writel() as base is only aligned to 4 bytes on odd entries */ |
706 |
+ writel(base, entry + PIL_RELOC_NAME_LEN); |
707 |
+diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c |
708 |
+index 1e8a38a7967d8..5c6e9dc88060b 100644 |
709 |
+--- a/drivers/video/fbdev/vga16fb.c |
710 |
++++ b/drivers/video/fbdev/vga16fb.c |
711 |
+@@ -184,6 +184,25 @@ static inline void setindex(int index) |
712 |
+ vga_io_w(VGA_GFX_I, index); |
713 |
+ } |
714 |
+ |
715 |
++/* Check if the video mode is supported by the driver */ |
716 |
++static inline int check_mode_supported(void) |
717 |
++{ |
718 |
++ /* non-x86 architectures treat orig_video_isVGA as a boolean flag */ |
719 |
++#if defined(CONFIG_X86) |
720 |
++ /* only EGA and VGA in 16 color graphic mode are supported */ |
721 |
++ if (screen_info.orig_video_isVGA != VIDEO_TYPE_EGAC && |
722 |
++ screen_info.orig_video_isVGA != VIDEO_TYPE_VGAC) |
723 |
++ return -ENODEV; |
724 |
++ |
725 |
++ if (screen_info.orig_video_mode != 0x0D && /* 320x200/4 (EGA) */ |
726 |
++ screen_info.orig_video_mode != 0x0E && /* 640x200/4 (EGA) */ |
727 |
++ screen_info.orig_video_mode != 0x10 && /* 640x350/4 (EGA) */ |
728 |
++ screen_info.orig_video_mode != 0x12) /* 640x480/4 (VGA) */ |
729 |
++ return -ENODEV; |
730 |
++#endif |
731 |
++ return 0; |
732 |
++} |
733 |
++ |
734 |
+ static void vga16fb_pan_var(struct fb_info *info, |
735 |
+ struct fb_var_screeninfo *var) |
736 |
+ { |
737 |
+@@ -1422,6 +1441,11 @@ static int __init vga16fb_init(void) |
738 |
+ |
739 |
+ vga16fb_setup(option); |
740 |
+ #endif |
741 |
++ |
742 |
++ ret = check_mode_supported(); |
743 |
++ if (ret) |
744 |
++ return ret; |
745 |
++ |
746 |
+ ret = platform_driver_register(&vga16fb_driver); |
747 |
+ |
748 |
+ if (!ret) { |
749 |
+diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c |
750 |
+index 72b67d810b8c2..a13ef836fe4e1 100644 |
751 |
+--- a/fs/9p/vfs_inode_dotl.c |
752 |
++++ b/fs/9p/vfs_inode_dotl.c |
753 |
+@@ -541,7 +541,10 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr) |
754 |
+ { |
755 |
+ int retval; |
756 |
+ struct p9_fid *fid = NULL; |
757 |
+- struct p9_iattr_dotl p9attr; |
758 |
++ struct p9_iattr_dotl p9attr = { |
759 |
++ .uid = INVALID_UID, |
760 |
++ .gid = INVALID_GID, |
761 |
++ }; |
762 |
+ struct inode *inode = d_inode(dentry); |
763 |
+ |
764 |
+ p9_debug(P9_DEBUG_VFS, "\n"); |
765 |
+@@ -551,14 +554,22 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr) |
766 |
+ return retval; |
767 |
+ |
768 |
+ p9attr.valid = v9fs_mapped_iattr_valid(iattr->ia_valid); |
769 |
+- p9attr.mode = iattr->ia_mode; |
770 |
+- p9attr.uid = iattr->ia_uid; |
771 |
+- p9attr.gid = iattr->ia_gid; |
772 |
+- p9attr.size = iattr->ia_size; |
773 |
+- p9attr.atime_sec = iattr->ia_atime.tv_sec; |
774 |
+- p9attr.atime_nsec = iattr->ia_atime.tv_nsec; |
775 |
+- p9attr.mtime_sec = iattr->ia_mtime.tv_sec; |
776 |
+- p9attr.mtime_nsec = iattr->ia_mtime.tv_nsec; |
777 |
++ if (iattr->ia_valid & ATTR_MODE) |
778 |
++ p9attr.mode = iattr->ia_mode; |
779 |
++ if (iattr->ia_valid & ATTR_UID) |
780 |
++ p9attr.uid = iattr->ia_uid; |
781 |
++ if (iattr->ia_valid & ATTR_GID) |
782 |
++ p9attr.gid = iattr->ia_gid; |
783 |
++ if (iattr->ia_valid & ATTR_SIZE) |
784 |
++ p9attr.size = iattr->ia_size; |
785 |
++ if (iattr->ia_valid & ATTR_ATIME_SET) { |
786 |
++ p9attr.atime_sec = iattr->ia_atime.tv_sec; |
787 |
++ p9attr.atime_nsec = iattr->ia_atime.tv_nsec; |
788 |
++ } |
789 |
++ if (iattr->ia_valid & ATTR_MTIME_SET) { |
790 |
++ p9attr.mtime_sec = iattr->ia_mtime.tv_sec; |
791 |
++ p9attr.mtime_nsec = iattr->ia_mtime.tv_nsec; |
792 |
++ } |
793 |
+ |
794 |
+ if (iattr->ia_valid & ATTR_FILE) { |
795 |
+ fid = iattr->ia_file->private_data; |
796 |
+diff --git a/fs/fs_context.c b/fs/fs_context.c |
797 |
+index 2834d1afa6e80..b11677802ee13 100644 |
798 |
+--- a/fs/fs_context.c |
799 |
++++ b/fs/fs_context.c |
800 |
+@@ -530,7 +530,7 @@ static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param) |
801 |
+ param->key); |
802 |
+ } |
803 |
+ |
804 |
+- if (len > PAGE_SIZE - 2 - size) |
805 |
++ if (size + len + 2 > PAGE_SIZE) |
806 |
+ return invalf(fc, "VFS: Legacy: Cumulative options too large"); |
807 |
+ if (strchr(param->key, ',') || |
808 |
+ (param->type == fs_value_is_string && |
809 |
+diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c |
810 |
+index 538e839590ef5..b501dc07f9222 100644 |
811 |
+--- a/fs/orangefs/orangefs-bufmap.c |
812 |
++++ b/fs/orangefs/orangefs-bufmap.c |
813 |
+@@ -176,7 +176,7 @@ orangefs_bufmap_free(struct orangefs_bufmap *bufmap) |
814 |
+ { |
815 |
+ kfree(bufmap->page_array); |
816 |
+ kfree(bufmap->desc_array); |
817 |
+- kfree(bufmap->buffer_index_array); |
818 |
++ bitmap_free(bufmap->buffer_index_array); |
819 |
+ kfree(bufmap); |
820 |
+ } |
821 |
+ |
822 |
+@@ -226,8 +226,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc) |
823 |
+ bufmap->desc_size = user_desc->size; |
824 |
+ bufmap->desc_shift = ilog2(bufmap->desc_size); |
825 |
+ |
826 |
+- bufmap->buffer_index_array = |
827 |
+- kzalloc(DIV_ROUND_UP(bufmap->desc_count, BITS_PER_LONG), GFP_KERNEL); |
828 |
++ bufmap->buffer_index_array = bitmap_zalloc(bufmap->desc_count, GFP_KERNEL); |
829 |
+ if (!bufmap->buffer_index_array) |
830 |
+ goto out_free_bufmap; |
831 |
+ |
832 |
+@@ -250,7 +249,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc) |
833 |
+ out_free_desc_array: |
834 |
+ kfree(bufmap->desc_array); |
835 |
+ out_free_index_array: |
836 |
+- kfree(bufmap->buffer_index_array); |
837 |
++ bitmap_free(bufmap->buffer_index_array); |
838 |
+ out_free_bufmap: |
839 |
+ kfree(bufmap); |
840 |
+ out: |
841 |
+diff --git a/fs/super.c b/fs/super.c |
842 |
+index 98bb0629ee108..20f1707807bbd 100644 |
843 |
+--- a/fs/super.c |
844 |
++++ b/fs/super.c |
845 |
+@@ -1472,8 +1472,8 @@ struct dentry *mount_nodev(struct file_system_type *fs_type, |
846 |
+ } |
847 |
+ EXPORT_SYMBOL(mount_nodev); |
848 |
+ |
849 |
+-static int reconfigure_single(struct super_block *s, |
850 |
+- int flags, void *data) |
851 |
++int reconfigure_single(struct super_block *s, |
852 |
++ int flags, void *data) |
853 |
+ { |
854 |
+ struct fs_context *fc; |
855 |
+ int ret; |
856 |
+diff --git a/include/linux/fs_context.h b/include/linux/fs_context.h |
857 |
+index 5b44b0195a28a..e869ce3ae6600 100644 |
858 |
+--- a/include/linux/fs_context.h |
859 |
++++ b/include/linux/fs_context.h |
860 |
+@@ -140,6 +140,8 @@ extern int generic_parse_monolithic(struct fs_context *fc, void *data); |
861 |
+ extern int vfs_get_tree(struct fs_context *fc); |
862 |
+ extern void put_fs_context(struct fs_context *fc); |
863 |
+ extern void fc_drop_locked(struct fs_context *fc); |
864 |
++int reconfigure_single(struct super_block *s, |
865 |
++ int flags, void *data); |
866 |
+ |
867 |
+ /* |
868 |
+ * sget() wrappers to be called from the ->get_tree() op. |
869 |
+diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h |
870 |
+index ce14fb2772b5b..c94551091dad3 100644 |
871 |
+--- a/include/linux/perf_event.h |
872 |
++++ b/include/linux/perf_event.h |
873 |
+@@ -1235,7 +1235,18 @@ extern void perf_event_bpf_event(struct bpf_prog *prog, |
874 |
+ enum perf_bpf_event_type type, |
875 |
+ u16 flags); |
876 |
+ |
877 |
+-extern struct perf_guest_info_callbacks *perf_guest_cbs; |
878 |
++extern struct perf_guest_info_callbacks __rcu *perf_guest_cbs; |
879 |
++static inline struct perf_guest_info_callbacks *perf_get_guest_cbs(void) |
880 |
++{ |
881 |
++ /* |
882 |
++ * Callbacks are RCU-protected and must be READ_ONCE to avoid reloading |
883 |
++ * the callbacks between a !NULL check and dereferences, to ensure |
884 |
++ * pending stores/changes to the callback pointers are visible before a |
885 |
++ * non-NULL perf_guest_cbs is visible to readers, and to prevent a |
886 |
++ * module from unloading callbacks while readers are active. |
887 |
++ */ |
888 |
++ return rcu_dereference(perf_guest_cbs); |
889 |
++} |
890 |
+ extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |
891 |
+ extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |
892 |
+ |
893 |
+diff --git a/kernel/events/core.c b/kernel/events/core.c |
894 |
+index 639b99a318db1..e2d774cc470ee 100644 |
895 |
+--- a/kernel/events/core.c |
896 |
++++ b/kernel/events/core.c |
897 |
+@@ -6395,18 +6395,25 @@ static void perf_pending_event(struct irq_work *entry) |
898 |
+ * Later on, we might change it to a list if there is |
899 |
+ * another virtualization implementation supporting the callbacks. |
900 |
+ */ |
901 |
+-struct perf_guest_info_callbacks *perf_guest_cbs; |
902 |
++struct perf_guest_info_callbacks __rcu *perf_guest_cbs; |
903 |
+ |
904 |
+ int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *cbs) |
905 |
+ { |
906 |
+- perf_guest_cbs = cbs; |
907 |
++ if (WARN_ON_ONCE(rcu_access_pointer(perf_guest_cbs))) |
908 |
++ return -EBUSY; |
909 |
++ |
910 |
++ rcu_assign_pointer(perf_guest_cbs, cbs); |
911 |
+ return 0; |
912 |
+ } |
913 |
+ EXPORT_SYMBOL_GPL(perf_register_guest_info_callbacks); |
914 |
+ |
915 |
+ int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs) |
916 |
+ { |
917 |
+- perf_guest_cbs = NULL; |
918 |
++ if (WARN_ON_ONCE(rcu_access_pointer(perf_guest_cbs) != cbs)) |
919 |
++ return -EINVAL; |
920 |
++ |
921 |
++ rcu_assign_pointer(perf_guest_cbs, NULL); |
922 |
++ synchronize_rcu(); |
923 |
+ return 0; |
924 |
+ } |
925 |
+ EXPORT_SYMBOL_GPL(perf_unregister_guest_info_callbacks); |
926 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
927 |
+index 14ce48f1a8e47..a858bb9e99270 100644 |
928 |
+--- a/sound/pci/hda/patch_realtek.c |
929 |
++++ b/sound/pci/hda/patch_realtek.c |
930 |
+@@ -1936,6 +1936,7 @@ enum { |
931 |
+ ALC887_FIXUP_ASUS_BASS, |
932 |
+ ALC887_FIXUP_BASS_CHMAP, |
933 |
+ ALC1220_FIXUP_GB_DUAL_CODECS, |
934 |
++ ALC1220_FIXUP_GB_X570, |
935 |
+ ALC1220_FIXUP_CLEVO_P950, |
936 |
+ ALC1220_FIXUP_CLEVO_PB51ED, |
937 |
+ ALC1220_FIXUP_CLEVO_PB51ED_PINS, |
938 |
+@@ -2125,6 +2126,29 @@ static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, |
939 |
+ } |
940 |
+ } |
941 |
+ |
942 |
++static void alc1220_fixup_gb_x570(struct hda_codec *codec, |
943 |
++ const struct hda_fixup *fix, |
944 |
++ int action) |
945 |
++{ |
946 |
++ static const hda_nid_t conn1[] = { 0x0c }; |
947 |
++ static const struct coef_fw gb_x570_coefs[] = { |
948 |
++ WRITE_COEF(0x1a, 0x01c1), |
949 |
++ WRITE_COEF(0x1b, 0x0202), |
950 |
++ WRITE_COEF(0x43, 0x3005), |
951 |
++ {} |
952 |
++ }; |
953 |
++ |
954 |
++ switch (action) { |
955 |
++ case HDA_FIXUP_ACT_PRE_PROBE: |
956 |
++ snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
957 |
++ snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); |
958 |
++ break; |
959 |
++ case HDA_FIXUP_ACT_INIT: |
960 |
++ alc_process_coef_fw(codec, gb_x570_coefs); |
961 |
++ break; |
962 |
++ } |
963 |
++} |
964 |
++ |
965 |
+ static void alc1220_fixup_clevo_p950(struct hda_codec *codec, |
966 |
+ const struct hda_fixup *fix, |
967 |
+ int action) |
968 |
+@@ -2427,6 +2451,10 @@ static const struct hda_fixup alc882_fixups[] = { |
969 |
+ .type = HDA_FIXUP_FUNC, |
970 |
+ .v.func = alc1220_fixup_gb_dual_codecs, |
971 |
+ }, |
972 |
++ [ALC1220_FIXUP_GB_X570] = { |
973 |
++ .type = HDA_FIXUP_FUNC, |
974 |
++ .v.func = alc1220_fixup_gb_x570, |
975 |
++ }, |
976 |
+ [ALC1220_FIXUP_CLEVO_P950] = { |
977 |
+ .type = HDA_FIXUP_FUNC, |
978 |
+ .v.func = alc1220_fixup_clevo_p950, |
979 |
+@@ -2529,7 +2557,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
980 |
+ SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD), |
981 |
+ SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), |
982 |
+ SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
983 |
+- SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950), |
984 |
++ SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570), |
985 |
+ SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950), |
986 |
+ SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), |
987 |
+ SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), |
988 |
+@@ -6729,6 +6757,8 @@ enum { |
989 |
+ ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
990 |
+ ALC233_FIXUP_NO_AUDIO_JACK, |
991 |
+ ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME, |
992 |
++ ALC285_FIXUP_LEGION_Y9000X_SPEAKERS, |
993 |
++ ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, |
994 |
+ }; |
995 |
+ |
996 |
+ static const struct hda_fixup alc269_fixups[] = { |
997 |
+@@ -8319,6 +8349,18 @@ static const struct hda_fixup alc269_fixups[] = { |
998 |
+ .chained = true, |
999 |
+ .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, |
1000 |
+ }, |
1001 |
++ [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = { |
1002 |
++ .type = HDA_FIXUP_FUNC, |
1003 |
++ .v.func = alc285_fixup_ideapad_s740_coef, |
1004 |
++ .chained = true, |
1005 |
++ .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, |
1006 |
++ }, |
1007 |
++ [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = { |
1008 |
++ .type = HDA_FIXUP_FUNC, |
1009 |
++ .v.func = alc287_fixup_legion_15imhg05_speakers, |
1010 |
++ .chained = true, |
1011 |
++ .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
1012 |
++ }, |
1013 |
+ [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = { |
1014 |
+ .type = HDA_FIXUP_VERBS, |
1015 |
+ //.v.verbs = legion_15imhg05_coefs, |
1016 |
+@@ -8857,13 +8899,16 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
1017 |
+ SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
1018 |
+ SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
1019 |
+ SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), |
1020 |
++ SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), |
1021 |
+ SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME), |
1022 |
++ SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS), |
1023 |
++ SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), |
1024 |
+ SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), |
1025 |
++ SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), |
1026 |
+ SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP), |
1027 |
+- SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), |
1028 |
++ SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), |
1029 |
+ SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), |
1030 |
+ SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), |
1031 |
+- SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS), |
1032 |
+ SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
1033 |
+ SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
1034 |
+ SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |