Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.8 commit in: /
Date: Sat, 05 Sep 2020 10:48:42
Message-Id: 1599302906.1dd46bf348e30b3b618337b4d4cdc91feebf1b9a.mpagano@gentoo
1 commit: 1dd46bf348e30b3b618337b4d4cdc91feebf1b9a
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 5 10:48:26 2020 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 5 10:48:26 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=1dd46bf3
7
8 Linux patch 5.8.7
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1006_linux-5.8.7.patch | 939 +++++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 943 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index ba2f389..62e43d7 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -67,6 +67,10 @@ Patch: 1005_linux-5.8.6.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.8.6
23
24 +Patch: 1006_linux-5.8.7.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.8.7
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/1006_linux-5.8.7.patch b/1006_linux-5.8.7.patch
33 new file mode 100644
34 index 0000000..d773b7c
35 --- /dev/null
36 +++ b/1006_linux-5.8.7.patch
37 @@ -0,0 +1,939 @@
38 +diff --git a/Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt b/Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt
39 +index 2cf3affa1be70..96c0b1440c9c5 100644
40 +--- a/Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt
41 ++++ b/Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt
42 +@@ -15,8 +15,15 @@ Required properties:
43 + - "nvidia,tegra210-sdhci": for Tegra210
44 + - "nvidia,tegra186-sdhci": for Tegra186
45 + - "nvidia,tegra194-sdhci": for Tegra194
46 +-- clocks : Must contain one entry, for the module clock.
47 +- See ../clocks/clock-bindings.txt for details.
48 ++- clocks: For Tegra210, Tegra186 and Tegra194 must contain two entries.
49 ++ One for the module clock and one for the timeout clock.
50 ++ For all other Tegra devices, must contain a single entry for
51 ++ the module clock. See ../clocks/clock-bindings.txt for details.
52 ++- clock-names: For Tegra210, Tegra186 and Tegra194 must contain the
53 ++ strings 'sdhci' and 'tmclk' to represent the module and
54 ++ the timeout clocks, respectively.
55 ++ For all other Tegra devices must contain the string 'sdhci'
56 ++ to represent the module clock.
57 + - resets : Must contain an entry for each entry in reset-names.
58 + See ../reset/reset.txt for details.
59 + - reset-names : Must include the following entries:
60 +@@ -99,7 +106,7 @@ Optional properties for Tegra210, Tegra186 and Tegra194:
61 +
62 + Example:
63 + sdhci@700b0000 {
64 +- compatible = "nvidia,tegra210-sdhci", "nvidia,tegra124-sdhci";
65 ++ compatible = "nvidia,tegra124-sdhci";
66 + reg = <0x0 0x700b0000 0x0 0x200>;
67 + interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
68 + clocks = <&tegra_car TEGRA210_CLK_SDMMC1>;
69 +@@ -115,3 +122,22 @@ sdhci@700b0000 {
70 + nvidia,pad-autocal-pull-down-offset-1v8 = <0x7b>;
71 + status = "disabled";
72 + };
73 ++
74 ++sdhci@700b0000 {
75 ++ compatible = "nvidia,tegra210-sdhci";
76 ++ reg = <0x0 0x700b0000 0x0 0x200>;
77 ++ interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
78 ++ clocks = <&tegra_car TEGRA210_CLK_SDMMC1>,
79 ++ <&tegra_car TEGRA210_CLK_SDMMC_LEGACY>;
80 ++ clock-names = "sdhci", "tmclk";
81 ++ resets = <&tegra_car 14>;
82 ++ reset-names = "sdhci";
83 ++ pinctrl-names = "sdmmc-3v3", "sdmmc-1v8";
84 ++ pinctrl-0 = <&sdmmc1_3v3>;
85 ++ pinctrl-1 = <&sdmmc1_1v8>;
86 ++ nvidia,pad-autocal-pull-up-offset-3v3 = <0x00>;
87 ++ nvidia,pad-autocal-pull-down-offset-3v3 = <0x7d>;
88 ++ nvidia,pad-autocal-pull-up-offset-1v8 = <0x7b>;
89 ++ nvidia,pad-autocal-pull-down-offset-1v8 = <0x7b>;
90 ++ status = "disabled";
91 ++};
92 +diff --git a/Makefile b/Makefile
93 +index 5cf35650373b1..5081bd85af29f 100644
94 +--- a/Makefile
95 ++++ b/Makefile
96 +@@ -1,7 +1,7 @@
97 + # SPDX-License-Identifier: GPL-2.0
98 + VERSION = 5
99 + PATCHLEVEL = 8
100 +-SUBLEVEL = 6
101 ++SUBLEVEL = 7
102 + EXTRAVERSION =
103 + NAME = Kleptomaniac Octopus
104 +
105 +diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
106 +index 58100fb9cd8b5..93236febd327f 100644
107 +--- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi
108 ++++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
109 +@@ -331,8 +331,9 @@
110 + compatible = "nvidia,tegra186-sdhci";
111 + reg = <0x0 0x03400000 0x0 0x10000>;
112 + interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
113 +- clocks = <&bpmp TEGRA186_CLK_SDMMC1>;
114 +- clock-names = "sdhci";
115 ++ clocks = <&bpmp TEGRA186_CLK_SDMMC1>,
116 ++ <&bpmp TEGRA186_CLK_SDMMC_LEGACY_TM>;
117 ++ clock-names = "sdhci", "tmclk";
118 + resets = <&bpmp TEGRA186_RESET_SDMMC1>;
119 + reset-names = "sdhci";
120 + iommus = <&smmu TEGRA186_SID_SDMMC1>;
121 +@@ -357,8 +358,9 @@
122 + compatible = "nvidia,tegra186-sdhci";
123 + reg = <0x0 0x03420000 0x0 0x10000>;
124 + interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
125 +- clocks = <&bpmp TEGRA186_CLK_SDMMC2>;
126 +- clock-names = "sdhci";
127 ++ clocks = <&bpmp TEGRA186_CLK_SDMMC2>,
128 ++ <&bpmp TEGRA186_CLK_SDMMC_LEGACY_TM>;
129 ++ clock-names = "sdhci", "tmclk";
130 + resets = <&bpmp TEGRA186_RESET_SDMMC2>;
131 + reset-names = "sdhci";
132 + iommus = <&smmu TEGRA186_SID_SDMMC2>;
133 +@@ -378,8 +380,9 @@
134 + compatible = "nvidia,tegra186-sdhci";
135 + reg = <0x0 0x03440000 0x0 0x10000>;
136 + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
137 +- clocks = <&bpmp TEGRA186_CLK_SDMMC3>;
138 +- clock-names = "sdhci";
139 ++ clocks = <&bpmp TEGRA186_CLK_SDMMC3>,
140 ++ <&bpmp TEGRA186_CLK_SDMMC_LEGACY_TM>;
141 ++ clock-names = "sdhci", "tmclk";
142 + resets = <&bpmp TEGRA186_RESET_SDMMC3>;
143 + reset-names = "sdhci";
144 + iommus = <&smmu TEGRA186_SID_SDMMC3>;
145 +@@ -401,8 +404,9 @@
146 + compatible = "nvidia,tegra186-sdhci";
147 + reg = <0x0 0x03460000 0x0 0x10000>;
148 + interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
149 +- clocks = <&bpmp TEGRA186_CLK_SDMMC4>;
150 +- clock-names = "sdhci";
151 ++ clocks = <&bpmp TEGRA186_CLK_SDMMC4>,
152 ++ <&bpmp TEGRA186_CLK_SDMMC_LEGACY_TM>;
153 ++ clock-names = "sdhci", "tmclk";
154 + assigned-clocks = <&bpmp TEGRA186_CLK_SDMMC4>,
155 + <&bpmp TEGRA186_CLK_PLLC4_VCO>;
156 + assigned-clock-parents = <&bpmp TEGRA186_CLK_PLLC4_VCO>;
157 +diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
158 +index 4bc187a4eacdb..980a8500b4b27 100644
159 +--- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi
160 ++++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
161 +@@ -453,8 +453,9 @@
162 + compatible = "nvidia,tegra194-sdhci", "nvidia,tegra186-sdhci";
163 + reg = <0x03400000 0x10000>;
164 + interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
165 +- clocks = <&bpmp TEGRA194_CLK_SDMMC1>;
166 +- clock-names = "sdhci";
167 ++ clocks = <&bpmp TEGRA194_CLK_SDMMC1>,
168 ++ <&bpmp TEGRA194_CLK_SDMMC_LEGACY_TM>;
169 ++ clock-names = "sdhci", "tmclk";
170 + resets = <&bpmp TEGRA194_RESET_SDMMC1>;
171 + reset-names = "sdhci";
172 + nvidia,pad-autocal-pull-up-offset-3v3-timeout =
173 +@@ -475,8 +476,9 @@
174 + compatible = "nvidia,tegra194-sdhci", "nvidia,tegra186-sdhci";
175 + reg = <0x03440000 0x10000>;
176 + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
177 +- clocks = <&bpmp TEGRA194_CLK_SDMMC3>;
178 +- clock-names = "sdhci";
179 ++ clocks = <&bpmp TEGRA194_CLK_SDMMC3>,
180 ++ <&bpmp TEGRA194_CLK_SDMMC_LEGACY_TM>;
181 ++ clock-names = "sdhci", "tmclk";
182 + resets = <&bpmp TEGRA194_RESET_SDMMC3>;
183 + reset-names = "sdhci";
184 + nvidia,pad-autocal-pull-up-offset-1v8 = <0x00>;
185 +@@ -498,8 +500,9 @@
186 + compatible = "nvidia,tegra194-sdhci", "nvidia,tegra186-sdhci";
187 + reg = <0x03460000 0x10000>;
188 + interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
189 +- clocks = <&bpmp TEGRA194_CLK_SDMMC4>;
190 +- clock-names = "sdhci";
191 ++ clocks = <&bpmp TEGRA194_CLK_SDMMC4>,
192 ++ <&bpmp TEGRA194_CLK_SDMMC_LEGACY_TM>;
193 ++ clock-names = "sdhci", "tmclk";
194 + assigned-clocks = <&bpmp TEGRA194_CLK_SDMMC4>,
195 + <&bpmp TEGRA194_CLK_PLLC4>;
196 + assigned-clock-parents =
197 +diff --git a/arch/arm64/boot/dts/nvidia/tegra210.dtsi b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
198 +index 08655081f72d1..04f3a2d4990de 100644
199 +--- a/arch/arm64/boot/dts/nvidia/tegra210.dtsi
200 ++++ b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
201 +@@ -1180,8 +1180,9 @@
202 + compatible = "nvidia,tegra210-sdhci", "nvidia,tegra124-sdhci";
203 + reg = <0x0 0x700b0000 0x0 0x200>;
204 + interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
205 +- clocks = <&tegra_car TEGRA210_CLK_SDMMC1>;
206 +- clock-names = "sdhci";
207 ++ clocks = <&tegra_car TEGRA210_CLK_SDMMC1>,
208 ++ <&tegra_car TEGRA210_CLK_SDMMC_LEGACY>;
209 ++ clock-names = "sdhci", "tmclk";
210 + resets = <&tegra_car 14>;
211 + reset-names = "sdhci";
212 + pinctrl-names = "sdmmc-3v3", "sdmmc-1v8",
213 +@@ -1208,8 +1209,9 @@
214 + compatible = "nvidia,tegra210-sdhci", "nvidia,tegra124-sdhci";
215 + reg = <0x0 0x700b0200 0x0 0x200>;
216 + interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
217 +- clocks = <&tegra_car TEGRA210_CLK_SDMMC2>;
218 +- clock-names = "sdhci";
219 ++ clocks = <&tegra_car TEGRA210_CLK_SDMMC2>,
220 ++ <&tegra_car TEGRA210_CLK_SDMMC_LEGACY>;
221 ++ clock-names = "sdhci", "tmclk";
222 + resets = <&tegra_car 9>;
223 + reset-names = "sdhci";
224 + pinctrl-names = "sdmmc-1v8-drv";
225 +@@ -1225,8 +1227,9 @@
226 + compatible = "nvidia,tegra210-sdhci", "nvidia,tegra124-sdhci";
227 + reg = <0x0 0x700b0400 0x0 0x200>;
228 + interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
229 +- clocks = <&tegra_car TEGRA210_CLK_SDMMC3>;
230 +- clock-names = "sdhci";
231 ++ clocks = <&tegra_car TEGRA210_CLK_SDMMC3>,
232 ++ <&tegra_car TEGRA210_CLK_SDMMC_LEGACY>;
233 ++ clock-names = "sdhci", "tmclk";
234 + resets = <&tegra_car 69>;
235 + reset-names = "sdhci";
236 + pinctrl-names = "sdmmc-3v3", "sdmmc-1v8",
237 +@@ -1248,8 +1251,9 @@
238 + compatible = "nvidia,tegra210-sdhci", "nvidia,tegra124-sdhci";
239 + reg = <0x0 0x700b0600 0x0 0x200>;
240 + interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
241 +- clocks = <&tegra_car TEGRA210_CLK_SDMMC4>;
242 +- clock-names = "sdhci";
243 ++ clocks = <&tegra_car TEGRA210_CLK_SDMMC4>,
244 ++ <&tegra_car TEGRA210_CLK_SDMMC_LEGACY>;
245 ++ clock-names = "sdhci", "tmclk";
246 + resets = <&tegra_car 15>;
247 + reset-names = "sdhci";
248 + pinctrl-names = "sdmmc-3v3-drv", "sdmmc-1v8-drv";
249 +diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h
250 +index 352aaebf41980..2eff49d81be2d 100644
251 +--- a/arch/arm64/include/asm/kvm_asm.h
252 ++++ b/arch/arm64/include/asm/kvm_asm.h
253 +@@ -121,6 +121,34 @@ extern char __smccc_workaround_1_smc[__SMCCC_WORKAROUND_1_SMC_SZ];
254 + *__hyp_this_cpu_ptr(sym); \
255 + })
256 +
257 ++#define __KVM_EXTABLE(from, to) \
258 ++ " .pushsection __kvm_ex_table, \"a\"\n" \
259 ++ " .align 3\n" \
260 ++ " .long (" #from " - .), (" #to " - .)\n" \
261 ++ " .popsection\n"
262 ++
263 ++
264 ++#define __kvm_at(at_op, addr) \
265 ++( { \
266 ++ int __kvm_at_err = 0; \
267 ++ u64 spsr, elr; \
268 ++ asm volatile( \
269 ++ " mrs %1, spsr_el2\n" \
270 ++ " mrs %2, elr_el2\n" \
271 ++ "1: at "at_op", %3\n" \
272 ++ " isb\n" \
273 ++ " b 9f\n" \
274 ++ "2: msr spsr_el2, %1\n" \
275 ++ " msr elr_el2, %2\n" \
276 ++ " mov %w0, %4\n" \
277 ++ "9:\n" \
278 ++ __KVM_EXTABLE(1b, 2b) \
279 ++ : "+r" (__kvm_at_err), "=&r" (spsr), "=&r" (elr) \
280 ++ : "r" (addr), "i" (-EFAULT)); \
281 ++ __kvm_at_err; \
282 ++} )
283 ++
284 ++
285 + #else /* __ASSEMBLY__ */
286 +
287 + .macro hyp_adr_this_cpu reg, sym, tmp
288 +@@ -146,6 +174,21 @@ extern char __smccc_workaround_1_smc[__SMCCC_WORKAROUND_1_SMC_SZ];
289 + kern_hyp_va \vcpu
290 + .endm
291 +
292 ++/*
293 ++ * KVM extable for unexpected exceptions.
294 ++ * In the same format _asm_extable, but output to a different section so that
295 ++ * it can be mapped to EL2. The KVM version is not sorted. The caller must
296 ++ * ensure:
297 ++ * x18 has the hypervisor value to allow any Shadow-Call-Stack instrumented
298 ++ * code to write to it, and that SPSR_EL2 and ELR_EL2 are restored by the fixup.
299 ++ */
300 ++.macro _kvm_extable, from, to
301 ++ .pushsection __kvm_ex_table, "a"
302 ++ .align 3
303 ++ .long (\from - .), (\to - .)
304 ++ .popsection
305 ++.endm
306 ++
307 + #endif
308 +
309 + #endif /* __ARM_KVM_ASM_H__ */
310 +diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
311 +index 5423ffe0a9876..1417a9042d135 100644
312 +--- a/arch/arm64/kernel/vmlinux.lds.S
313 ++++ b/arch/arm64/kernel/vmlinux.lds.S
314 +@@ -21,6 +21,13 @@ ENTRY(_text)
315 +
316 + jiffies = jiffies_64;
317 +
318 ++
319 ++#define HYPERVISOR_EXTABLE \
320 ++ . = ALIGN(SZ_8); \
321 ++ __start___kvm_ex_table = .; \
322 ++ *(__kvm_ex_table) \
323 ++ __stop___kvm_ex_table = .;
324 ++
325 + #define HYPERVISOR_TEXT \
326 + /* \
327 + * Align to 4 KB so that \
328 +@@ -36,6 +43,7 @@ jiffies = jiffies_64;
329 + __hyp_idmap_text_end = .; \
330 + __hyp_text_start = .; \
331 + *(.hyp.text) \
332 ++ HYPERVISOR_EXTABLE \
333 + __hyp_text_end = .;
334 +
335 + #define IDMAP_TEXT \
336 +diff --git a/arch/arm64/kvm/hyp/entry.S b/arch/arm64/kvm/hyp/entry.S
337 +index 90186cf6473e0..c2e6da3564082 100644
338 +--- a/arch/arm64/kvm/hyp/entry.S
339 ++++ b/arch/arm64/kvm/hyp/entry.S
340 +@@ -198,20 +198,23 @@ alternative_endif
341 + // This is our single instruction exception window. A pending
342 + // SError is guaranteed to occur at the earliest when we unmask
343 + // it, and at the latest just after the ISB.
344 +- .global abort_guest_exit_start
345 + abort_guest_exit_start:
346 +
347 + isb
348 +
349 +- .global abort_guest_exit_end
350 + abort_guest_exit_end:
351 +
352 + msr daifset, #4 // Mask aborts
353 ++ ret
354 ++
355 ++ _kvm_extable abort_guest_exit_start, 9997f
356 ++ _kvm_extable abort_guest_exit_end, 9997f
357 ++9997:
358 ++ msr daifset, #4 // Mask aborts
359 ++ mov x0, #(1 << ARM_EXIT_WITH_SERROR_BIT)
360 +
361 +- // If the exception took place, restore the EL1 exception
362 +- // context so that we can report some information.
363 +- // Merge the exception code with the SError pending bit.
364 +- tbz x0, #ARM_EXIT_WITH_SERROR_BIT, 1f
365 ++ // restore the EL1 exception context so that we can report some
366 ++ // information. Merge the exception code with the SError pending bit.
367 + msr elr_el2, x2
368 + msr esr_el2, x3
369 + msr spsr_el2, x4
370 +diff --git a/arch/arm64/kvm/hyp/hyp-entry.S b/arch/arm64/kvm/hyp/hyp-entry.S
371 +index 9c5cfb04170ee..741f7cbaeb799 100644
372 +--- a/arch/arm64/kvm/hyp/hyp-entry.S
373 ++++ b/arch/arm64/kvm/hyp/hyp-entry.S
374 +@@ -15,6 +15,30 @@
375 + #include <asm/kvm_mmu.h>
376 + #include <asm/mmu.h>
377 +
378 ++.macro save_caller_saved_regs_vect
379 ++ /* x0 and x1 were saved in the vector entry */
380 ++ stp x2, x3, [sp, #-16]!
381 ++ stp x4, x5, [sp, #-16]!
382 ++ stp x6, x7, [sp, #-16]!
383 ++ stp x8, x9, [sp, #-16]!
384 ++ stp x10, x11, [sp, #-16]!
385 ++ stp x12, x13, [sp, #-16]!
386 ++ stp x14, x15, [sp, #-16]!
387 ++ stp x16, x17, [sp, #-16]!
388 ++.endm
389 ++
390 ++.macro restore_caller_saved_regs_vect
391 ++ ldp x16, x17, [sp], #16
392 ++ ldp x14, x15, [sp], #16
393 ++ ldp x12, x13, [sp], #16
394 ++ ldp x10, x11, [sp], #16
395 ++ ldp x8, x9, [sp], #16
396 ++ ldp x6, x7, [sp], #16
397 ++ ldp x4, x5, [sp], #16
398 ++ ldp x2, x3, [sp], #16
399 ++ ldp x0, x1, [sp], #16
400 ++.endm
401 ++
402 + .text
403 + .pushsection .hyp.text, "ax"
404 +
405 +@@ -142,13 +166,19 @@ el1_error:
406 + b __guest_exit
407 +
408 + el2_sync:
409 +- /* Check for illegal exception return, otherwise panic */
410 ++ /* Check for illegal exception return */
411 + mrs x0, spsr_el2
412 ++ tbnz x0, #20, 1f
413 +
414 +- /* if this was something else, then panic! */
415 +- tst x0, #PSR_IL_BIT
416 +- b.eq __hyp_panic
417 ++ save_caller_saved_regs_vect
418 ++ stp x29, x30, [sp, #-16]!
419 ++ bl kvm_unexpected_el2_exception
420 ++ ldp x29, x30, [sp], #16
421 ++ restore_caller_saved_regs_vect
422 +
423 ++ eret
424 ++
425 ++1:
426 + /* Let's attempt a recovery from the illegal exception return */
427 + get_vcpu_ptr x1, x0
428 + mov x0, #ARM_EXCEPTION_IL
429 +@@ -156,27 +186,14 @@ el2_sync:
430 +
431 +
432 + el2_error:
433 +- ldp x0, x1, [sp], #16
434 ++ save_caller_saved_regs_vect
435 ++ stp x29, x30, [sp, #-16]!
436 ++
437 ++ bl kvm_unexpected_el2_exception
438 ++
439 ++ ldp x29, x30, [sp], #16
440 ++ restore_caller_saved_regs_vect
441 +
442 +- /*
443 +- * Only two possibilities:
444 +- * 1) Either we come from the exit path, having just unmasked
445 +- * PSTATE.A: change the return code to an EL2 fault, and
446 +- * carry on, as we're already in a sane state to handle it.
447 +- * 2) Or we come from anywhere else, and that's a bug: we panic.
448 +- *
449 +- * For (1), x0 contains the original return code and x1 doesn't
450 +- * contain anything meaningful at that stage. We can reuse them
451 +- * as temp registers.
452 +- * For (2), who cares?
453 +- */
454 +- mrs x0, elr_el2
455 +- adr x1, abort_guest_exit_start
456 +- cmp x0, x1
457 +- adr x1, abort_guest_exit_end
458 +- ccmp x0, x1, #4, ne
459 +- b.ne __hyp_panic
460 +- mov x0, #(1 << ARM_EXIT_WITH_SERROR_BIT)
461 + eret
462 + sb
463 +
464 +diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c
465 +index 9270b14157b55..ba225e09aaf15 100644
466 +--- a/arch/arm64/kvm/hyp/switch.c
467 ++++ b/arch/arm64/kvm/hyp/switch.c
468 +@@ -14,6 +14,7 @@
469 +
470 + #include <asm/barrier.h>
471 + #include <asm/cpufeature.h>
472 ++#include <asm/extable.h>
473 + #include <asm/kprobes.h>
474 + #include <asm/kvm_asm.h>
475 + #include <asm/kvm_emulate.h>
476 +@@ -24,6 +25,9 @@
477 + #include <asm/processor.h>
478 + #include <asm/thread_info.h>
479 +
480 ++extern struct exception_table_entry __start___kvm_ex_table;
481 ++extern struct exception_table_entry __stop___kvm_ex_table;
482 ++
483 + /* Check whether the FP regs were dirtied while in the host-side run loop: */
484 + static bool __hyp_text update_fp_enabled(struct kvm_vcpu *vcpu)
485 + {
486 +@@ -299,10 +303,10 @@ static bool __hyp_text __translate_far_to_hpfar(u64 far, u64 *hpfar)
487 + * saved the guest context yet, and we may return early...
488 + */
489 + par = read_sysreg(par_el1);
490 +- asm volatile("at s1e1r, %0" : : "r" (far));
491 +- isb();
492 +-
493 +- tmp = read_sysreg(par_el1);
494 ++ if (!__kvm_at("s1e1r", far))
495 ++ tmp = read_sysreg(par_el1);
496 ++ else
497 ++ tmp = SYS_PAR_EL1_F; /* back to the guest */
498 + write_sysreg(par, par_el1);
499 +
500 + if (unlikely(tmp & SYS_PAR_EL1_F))
501 +@@ -934,3 +938,30 @@ void __hyp_text __noreturn hyp_panic(struct kvm_cpu_context *host_ctxt)
502 +
503 + unreachable();
504 + }
505 ++
506 ++asmlinkage void __hyp_text kvm_unexpected_el2_exception(void)
507 ++{
508 ++ unsigned long addr, fixup;
509 ++ struct kvm_cpu_context *host_ctxt;
510 ++ struct exception_table_entry *entry, *end;
511 ++ unsigned long elr_el2 = read_sysreg(elr_el2);
512 ++
513 ++ entry = hyp_symbol_addr(__start___kvm_ex_table);
514 ++ end = hyp_symbol_addr(__stop___kvm_ex_table);
515 ++ host_ctxt = &__hyp_this_cpu_ptr(kvm_host_data)->host_ctxt;
516 ++
517 ++ while (entry < end) {
518 ++ addr = (unsigned long)&entry->insn + entry->insn;
519 ++ fixup = (unsigned long)&entry->fixup + entry->fixup;
520 ++
521 ++ if (addr != elr_el2) {
522 ++ entry++;
523 ++ continue;
524 ++ }
525 ++
526 ++ write_sysreg(fixup, elr_el2);
527 ++ return;
528 ++ }
529 ++
530 ++ hyp_panic(host_ctxt);
531 ++}
532 +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
533 +index 359616e3efbbb..d2ecc9c452554 100644
534 +--- a/drivers/hid/hid-core.c
535 ++++ b/drivers/hid/hid-core.c
536 +@@ -1597,6 +1597,17 @@ static void hid_output_field(const struct hid_device *hid,
537 + }
538 + }
539 +
540 ++/*
541 ++ * Compute the size of a report.
542 ++ */
543 ++static size_t hid_compute_report_size(struct hid_report *report)
544 ++{
545 ++ if (report->size)
546 ++ return ((report->size - 1) >> 3) + 1;
547 ++
548 ++ return 0;
549 ++}
550 ++
551 + /*
552 + * Create a report. 'data' has to be allocated using
553 + * hid_alloc_report_buf() so that it has proper size.
554 +@@ -1609,7 +1620,7 @@ void hid_output_report(struct hid_report *report, __u8 *data)
555 + if (report->id > 0)
556 + *data++ = report->id;
557 +
558 +- memset(data, 0, ((report->size - 1) >> 3) + 1);
559 ++ memset(data, 0, hid_compute_report_size(report));
560 + for (n = 0; n < report->maxfield; n++)
561 + hid_output_field(report->device, report->field[n], data);
562 + }
563 +@@ -1739,7 +1750,7 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
564 + csize--;
565 + }
566 +
567 +- rsize = ((report->size - 1) >> 3) + 1;
568 ++ rsize = hid_compute_report_size(report);
569 +
570 + if (report_enum->numbered && rsize >= HID_MAX_BUFFER_SIZE)
571 + rsize = HID_MAX_BUFFER_SIZE - 1;
572 +diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
573 +index e8641ce677e47..e3d475f4baf66 100644
574 +--- a/drivers/hid/hid-input.c
575 ++++ b/drivers/hid/hid-input.c
576 +@@ -1132,6 +1132,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
577 + }
578 +
579 + mapped:
580 ++ /* Mapping failed, bail out */
581 ++ if (!bit)
582 ++ return;
583 ++
584 + if (device->driver->input_mapped &&
585 + device->driver->input_mapped(device, hidinput, field, usage,
586 + &bit, &max) < 0) {
587 +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
588 +index 3f94b4954225b..e3152155c4b85 100644
589 +--- a/drivers/hid/hid-multitouch.c
590 ++++ b/drivers/hid/hid-multitouch.c
591 +@@ -856,6 +856,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
592 + code = BTN_0 + ((usage->hid - 1) & HID_USAGE);
593 +
594 + hid_map_usage(hi, usage, bit, max, EV_KEY, code);
595 ++ if (!*bit)
596 ++ return -1;
597 + input_set_capability(hi->input, EV_KEY, code);
598 + return 1;
599 +
600 +diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
601 +index 2322f08a98be6..5e057f798a15b 100644
602 +--- a/drivers/media/v4l2-core/v4l2-ioctl.c
603 ++++ b/drivers/media/v4l2-core/v4l2-ioctl.c
604 +@@ -3186,14 +3186,16 @@ static int video_put_user(void __user *arg, void *parg, unsigned int cmd)
605 + #ifdef CONFIG_COMPAT_32BIT_TIME
606 + case VIDIOC_DQEVENT_TIME32: {
607 + struct v4l2_event *ev = parg;
608 +- struct v4l2_event_time32 ev32 = {
609 +- .type = ev->type,
610 +- .pending = ev->pending,
611 +- .sequence = ev->sequence,
612 +- .timestamp.tv_sec = ev->timestamp.tv_sec,
613 +- .timestamp.tv_nsec = ev->timestamp.tv_nsec,
614 +- .id = ev->id,
615 +- };
616 ++ struct v4l2_event_time32 ev32;
617 ++
618 ++ memset(&ev32, 0, sizeof(ev32));
619 ++
620 ++ ev32.type = ev->type;
621 ++ ev32.pending = ev->pending;
622 ++ ev32.sequence = ev->sequence;
623 ++ ev32.timestamp.tv_sec = ev->timestamp.tv_sec;
624 ++ ev32.timestamp.tv_nsec = ev->timestamp.tv_nsec;
625 ++ ev32.id = ev->id;
626 +
627 + memcpy(&ev32.u, &ev->u, sizeof(ev->u));
628 + memcpy(&ev32.reserved, &ev->reserved, sizeof(ev->reserved));
629 +@@ -3207,21 +3209,23 @@ static int video_put_user(void __user *arg, void *parg, unsigned int cmd)
630 + case VIDIOC_DQBUF_TIME32:
631 + case VIDIOC_PREPARE_BUF_TIME32: {
632 + struct v4l2_buffer *vb = parg;
633 +- struct v4l2_buffer_time32 vb32 = {
634 +- .index = vb->index,
635 +- .type = vb->type,
636 +- .bytesused = vb->bytesused,
637 +- .flags = vb->flags,
638 +- .field = vb->field,
639 +- .timestamp.tv_sec = vb->timestamp.tv_sec,
640 +- .timestamp.tv_usec = vb->timestamp.tv_usec,
641 +- .timecode = vb->timecode,
642 +- .sequence = vb->sequence,
643 +- .memory = vb->memory,
644 +- .m.userptr = vb->m.userptr,
645 +- .length = vb->length,
646 +- .request_fd = vb->request_fd,
647 +- };
648 ++ struct v4l2_buffer_time32 vb32;
649 ++
650 ++ memset(&vb32, 0, sizeof(vb32));
651 ++
652 ++ vb32.index = vb->index;
653 ++ vb32.type = vb->type;
654 ++ vb32.bytesused = vb->bytesused;
655 ++ vb32.flags = vb->flags;
656 ++ vb32.field = vb->field;
657 ++ vb32.timestamp.tv_sec = vb->timestamp.tv_sec;
658 ++ vb32.timestamp.tv_usec = vb->timestamp.tv_usec;
659 ++ vb32.timecode = vb->timecode;
660 ++ vb32.sequence = vb->sequence;
661 ++ vb32.memory = vb->memory;
662 ++ vb32.m.userptr = vb->m.userptr;
663 ++ vb32.length = vb->length;
664 ++ vb32.request_fd = vb->request_fd;
665 +
666 + if (copy_to_user(arg, &vb32, sizeof(vb32)))
667 + return -EFAULT;
668 +diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
669 +index 3a372ab3d12e8..db1a8d1c96b36 100644
670 +--- a/drivers/mmc/host/sdhci-tegra.c
671 ++++ b/drivers/mmc/host/sdhci-tegra.c
672 +@@ -1409,7 +1409,6 @@ static const struct sdhci_ops tegra210_sdhci_ops = {
673 +
674 + static const struct sdhci_pltfm_data sdhci_tegra210_pdata = {
675 + .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
676 +- SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
677 + SDHCI_QUIRK_SINGLE_POWER_WRITE |
678 + SDHCI_QUIRK_NO_HISPD_BIT |
679 + SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
680 +@@ -1447,7 +1446,6 @@ static const struct sdhci_ops tegra186_sdhci_ops = {
681 +
682 + static const struct sdhci_pltfm_data sdhci_tegra186_pdata = {
683 + .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
684 +- SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
685 + SDHCI_QUIRK_SINGLE_POWER_WRITE |
686 + SDHCI_QUIRK_NO_HISPD_BIT |
687 + SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
688 +diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
689 +index 9ab960cc39b6f..0209bc23e631e 100644
690 +--- a/drivers/target/target_core_user.c
691 ++++ b/drivers/target/target_core_user.c
692 +@@ -676,8 +676,10 @@ static void scatter_data_area(struct tcmu_dev *udev,
693 + from = kmap_atomic(sg_page(sg)) + sg->offset;
694 + while (sg_remaining > 0) {
695 + if (block_remaining == 0) {
696 +- if (to)
697 ++ if (to) {
698 ++ flush_dcache_page(page);
699 + kunmap_atomic(to);
700 ++ }
701 +
702 + block_remaining = DATA_BLOCK_SIZE;
703 + dbi = tcmu_cmd_get_dbi(tcmu_cmd);
704 +@@ -722,7 +724,6 @@ static void scatter_data_area(struct tcmu_dev *udev,
705 + memcpy(to + offset,
706 + from + sg->length - sg_remaining,
707 + copy_bytes);
708 +- tcmu_flush_dcache_range(to, copy_bytes);
709 + }
710 +
711 + sg_remaining -= copy_bytes;
712 +@@ -731,8 +732,10 @@ static void scatter_data_area(struct tcmu_dev *udev,
713 + kunmap_atomic(from - sg->offset);
714 + }
715 +
716 +- if (to)
717 ++ if (to) {
718 ++ flush_dcache_page(page);
719 + kunmap_atomic(to);
720 ++ }
721 + }
722 +
723 + static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd,
724 +@@ -778,13 +781,13 @@ static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd,
725 + dbi = tcmu_cmd_get_dbi(cmd);
726 + page = tcmu_get_block_page(udev, dbi);
727 + from = kmap_atomic(page);
728 ++ flush_dcache_page(page);
729 + }
730 + copy_bytes = min_t(size_t, sg_remaining,
731 + block_remaining);
732 + if (read_len < copy_bytes)
733 + copy_bytes = read_len;
734 + offset = DATA_BLOCK_SIZE - block_remaining;
735 +- tcmu_flush_dcache_range(from, copy_bytes);
736 + memcpy(to + sg->length - sg_remaining, from + offset,
737 + copy_bytes);
738 +
739 +diff --git a/include/linux/hid.h b/include/linux/hid.h
740 +index 875f71132b142..c7044a14200ea 100644
741 +--- a/include/linux/hid.h
742 ++++ b/include/linux/hid.h
743 +@@ -959,34 +959,49 @@ static inline void hid_device_io_stop(struct hid_device *hid) {
744 + * @max: maximal valid usage->code to consider later (out parameter)
745 + * @type: input event type (EV_KEY, EV_REL, ...)
746 + * @c: code which corresponds to this usage and type
747 ++ *
748 ++ * The value pointed to by @bit will be set to NULL if either @type is
749 ++ * an unhandled event type, or if @c is out of range for @type. This
750 ++ * can be used as an error condition.
751 + */
752 + static inline void hid_map_usage(struct hid_input *hidinput,
753 + struct hid_usage *usage, unsigned long **bit, int *max,
754 +- __u8 type, __u16 c)
755 ++ __u8 type, unsigned int c)
756 + {
757 + struct input_dev *input = hidinput->input;
758 +-
759 +- usage->type = type;
760 +- usage->code = c;
761 ++ unsigned long *bmap = NULL;
762 ++ unsigned int limit = 0;
763 +
764 + switch (type) {
765 + case EV_ABS:
766 +- *bit = input->absbit;
767 +- *max = ABS_MAX;
768 ++ bmap = input->absbit;
769 ++ limit = ABS_MAX;
770 + break;
771 + case EV_REL:
772 +- *bit = input->relbit;
773 +- *max = REL_MAX;
774 ++ bmap = input->relbit;
775 ++ limit = REL_MAX;
776 + break;
777 + case EV_KEY:
778 +- *bit = input->keybit;
779 +- *max = KEY_MAX;
780 ++ bmap = input->keybit;
781 ++ limit = KEY_MAX;
782 + break;
783 + case EV_LED:
784 +- *bit = input->ledbit;
785 +- *max = LED_MAX;
786 ++ bmap = input->ledbit;
787 ++ limit = LED_MAX;
788 + break;
789 + }
790 ++
791 ++ if (unlikely(c > limit || !bmap)) {
792 ++ pr_warn_ratelimited("%s: Invalid code %d type %d\n",
793 ++ input->name, c, type);
794 ++ *bit = NULL;
795 ++ return;
796 ++ }
797 ++
798 ++ usage->type = type;
799 ++ usage->code = c;
800 ++ *max = limit;
801 ++ *bit = bmap;
802 + }
803 +
804 + /**
805 +@@ -1000,7 +1015,8 @@ static inline void hid_map_usage_clear(struct hid_input *hidinput,
806 + __u8 type, __u16 c)
807 + {
808 + hid_map_usage(hidinput, usage, bit, max, type, c);
809 +- clear_bit(c, *bit);
810 ++ if (*bit)
811 ++ clear_bit(usage->code, *bit);
812 + }
813 +
814 + /**
815 +diff --git a/mm/gup.c b/mm/gup.c
816 +index 6f47697f8fb0b..0d8d76f10ac61 100644
817 +--- a/mm/gup.c
818 ++++ b/mm/gup.c
819 +@@ -843,7 +843,7 @@ static int get_gate_page(struct mm_struct *mm, unsigned long address,
820 + goto unmap;
821 + *page = pte_page(*pte);
822 + }
823 +- if (unlikely(!try_get_page(*page))) {
824 ++ if (unlikely(!try_grab_page(*page, gup_flags))) {
825 + ret = -ENOMEM;
826 + goto unmap;
827 + }
828 +diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
829 +index b6aad3fc46c35..b85ce6f0c0a6f 100644
830 +--- a/net/netfilter/nft_set_rbtree.c
831 ++++ b/net/netfilter/nft_set_rbtree.c
832 +@@ -238,21 +238,27 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set,
833 + *
834 + * b1. _ _ __>| !_ _ __| (insert end before existing start)
835 + * b2. _ _ ___| !_ _ _>| (insert end after existing start)
836 +- * b3. _ _ ___! >|_ _ __| (insert start after existing end)
837 ++ * b3. _ _ ___! >|_ _ __| (insert start after existing end, as a leaf)
838 ++ * '--' no nodes falling in this range
839 ++ * b4. >|_ _ ! (insert start before existing start)
840 + *
841 + * Case a3. resolves to b3.:
842 + * - if the inserted start element is the leftmost, because the '0'
843 + * element in the tree serves as end element
844 +- * - otherwise, if an existing end is found. Note that end elements are
845 +- * always inserted after corresponding start elements.
846 ++ * - otherwise, if an existing end is found immediately to the left. If
847 ++ * there are existing nodes in between, we need to further descend the
848 ++ * tree before we can conclude the new start isn't causing an overlap
849 ++ *
850 ++ * or to b4., which, preceded by a3., means we already traversed one or
851 ++ * more existing intervals entirely, from the right.
852 + *
853 + * For a new, rightmost pair of elements, we'll hit cases b3. and b2.,
854 + * in that order.
855 + *
856 + * The flag is also cleared in two special cases:
857 + *
858 +- * b4. |__ _ _!|<_ _ _ (insert start right before existing end)
859 +- * b5. |__ _ >|!__ _ _ (insert end right after existing start)
860 ++ * b5. |__ _ _!|<_ _ _ (insert start right before existing end)
861 ++ * b6. |__ _ >|!__ _ _ (insert end right after existing start)
862 + *
863 + * which always happen as last step and imply that no further
864 + * overlapping is possible.
865 +@@ -272,7 +278,7 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set,
866 + if (nft_rbtree_interval_start(new)) {
867 + if (nft_rbtree_interval_end(rbe) &&
868 + nft_set_elem_active(&rbe->ext, genmask) &&
869 +- !nft_set_elem_expired(&rbe->ext))
870 ++ !nft_set_elem_expired(&rbe->ext) && !*p)
871 + overlap = false;
872 + } else {
873 + overlap = nft_rbtree_interval_end(rbe) &&
874 +@@ -288,10 +294,9 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set,
875 + nft_set_elem_active(&rbe->ext,
876 + genmask) &&
877 + !nft_set_elem_expired(&rbe->ext);
878 +- } else if (nft_rbtree_interval_end(rbe) &&
879 +- nft_set_elem_active(&rbe->ext, genmask) &&
880 ++ } else if (nft_set_elem_active(&rbe->ext, genmask) &&
881 + !nft_set_elem_expired(&rbe->ext)) {
882 +- overlap = true;
883 ++ overlap = nft_rbtree_interval_end(rbe);
884 + }
885 + } else {
886 + if (nft_rbtree_interval_end(rbe) &&
887 +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
888 +index 7fbca0854265a..279c87a2a523b 100644
889 +--- a/net/wireless/nl80211.c
890 ++++ b/net/wireless/nl80211.c
891 +@@ -6010,7 +6010,7 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
892 +
893 + if (info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY])
894 + params.he_6ghz_capa =
895 +- nla_data(info->attrs[NL80211_ATTR_HE_CAPABILITY]);
896 ++ nla_data(info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]);
897 +
898 + if (info->attrs[NL80211_ATTR_AIRTIME_WEIGHT])
899 + params.airtime_weight =
900 +diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
901 +index fa8a5fcd27aba..950e4ad213747 100644
902 +--- a/tools/perf/Documentation/perf-record.txt
903 ++++ b/tools/perf/Documentation/perf-record.txt
904 +@@ -33,6 +33,10 @@ OPTIONS
905 + - a raw PMU event (eventsel+umask) in the form of rNNN where NNN is a
906 + hexadecimal event descriptor.
907 +
908 ++ - a symbolic or raw PMU event followed by an optional colon
909 ++ and a list of event modifiers, e.g., cpu-cycles:p. See the
910 ++ linkperf:perf-list[1] man page for details on event modifiers.
911 ++
912 + - a symbolically formed PMU event like 'pmu/param1=0x3,param2/' where
913 + 'param1', 'param2', etc are defined as formats for the PMU in
914 + /sys/bus/event_source/devices/<pmu>/format/*.
915 +diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt
916 +index b029ee728a0bc..c8209467076b1 100644
917 +--- a/tools/perf/Documentation/perf-stat.txt
918 ++++ b/tools/perf/Documentation/perf-stat.txt
919 +@@ -39,6 +39,10 @@ report::
920 + - a raw PMU event (eventsel+umask) in the form of rNNN where NNN is a
921 + hexadecimal event descriptor.
922 +
923 ++ - a symbolic or raw PMU event followed by an optional colon
924 ++ and a list of event modifiers, e.g., cpu-cycles:p. See the
925 ++ linkperf:perf-list[1] man page for details on event modifiers.
926 ++
927 + - a symbolically formed event like 'pmu/param1=0x3,param2/' where
928 + param1 and param2 are defined as formats for the PMU in
929 + /sys/bus/event_source/devices/<pmu>/format/*
930 +diff --git a/tools/testing/selftests/x86/test_vsyscall.c b/tools/testing/selftests/x86/test_vsyscall.c
931 +index c41f24b517f40..65c141ebfbbde 100644
932 +--- a/tools/testing/selftests/x86/test_vsyscall.c
933 ++++ b/tools/testing/selftests/x86/test_vsyscall.c
934 +@@ -462,6 +462,17 @@ static int test_vsys_x(void)
935 + return 0;
936 + }
937 +
938 ++/*
939 ++ * Debuggers expect ptrace() to be able to peek at the vsyscall page.
940 ++ * Use process_vm_readv() as a proxy for ptrace() to test this. We
941 ++ * want it to work in the vsyscall=emulate case and to fail in the
942 ++ * vsyscall=xonly case.
943 ++ *
944 ++ * It's worth noting that this ABI is a bit nutty. write(2) can't
945 ++ * read from the vsyscall page on any kernel version or mode. The
946 ++ * fact that ptrace() ever worked was a nice courtesy of old kernels,
947 ++ * but the code to support it is fairly gross.
948 ++ */
949 + static int test_process_vm_readv(void)
950 + {
951 + #ifdef __x86_64__
952 +@@ -477,8 +488,12 @@ static int test_process_vm_readv(void)
953 + remote.iov_len = 4096;
954 + ret = process_vm_readv(getpid(), &local, 1, &remote, 1, 0);
955 + if (ret != 4096) {
956 +- printf("[OK]\tprocess_vm_readv() failed (ret = %d, errno = %d)\n", ret, errno);
957 +- return 0;
958 ++ /*
959 ++ * We expect process_vm_readv() to work if and only if the
960 ++ * vsyscall page is readable.
961 ++ */
962 ++ printf("[%s]\tprocess_vm_readv() failed (ret = %d, errno = %d)\n", vsyscall_map_r ? "FAIL" : "OK", ret, errno);
963 ++ return vsyscall_map_r ? 1 : 0;
964 + }
965 +
966 + if (vsyscall_map_r) {
967 +@@ -488,6 +503,9 @@ static int test_process_vm_readv(void)
968 + printf("[FAIL]\tIt worked but returned incorrect data\n");
969 + return 1;
970 + }
971 ++ } else {
972 ++ printf("[FAIL]\tprocess_rm_readv() succeeded, but it should have failed in this configuration\n");
973 ++ return 1;
974 + }
975 + #endif
976 +