Skip to content

Commit 4d4eb38

Browse files
committed
Merge remote-tracking branch 'torvalds/master' into perf-tools-next
To pick up changes for other tools/ libraries used by perf and for header synchronization with the kernel sources originals. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2 parents 8cdf00b + a5806cd commit 4d4eb38

File tree

587 files changed

+7636
-2805
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

587 files changed

+7636
-2805
lines changed

.clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ check-private-items = true
77
disallowed-macros = [
88
# The `clippy::dbg_macro` lint only works with `std::dbg!`, thus we simulate
99
# it here, see: https://github.com/rust-lang/rust-clippy/issues/11303.
10-
{ path = "kernel::dbg", reason = "the `dbg!` macro is intended as a debugging tool" },
10+
{ path = "kernel::dbg", reason = "the `dbg!` macro is intended as a debugging tool", allow-invalid = true },
1111
]

.mailmap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Ard Biesheuvel <[email protected]> <[email protected]>
102102
Arnaud Patard <[email protected]>
103103
Arnd Bergmann <[email protected]>
104104
Arun Kumar Neelakantam <[email protected]> <[email protected]>
105+
105106
Ashok Raj Nagarajan <[email protected]> <[email protected]>
106107
107108
@@ -447,6 +448,8 @@ Luca Ceresoli <[email protected]> <[email protected]>
447448
448449
449450
451+
452+
450453
451454
452455
Maharaja Kennadyrajan <[email protected]> <[email protected]>
@@ -483,6 +486,7 @@ Matthias Fuchs <[email protected]> <[email protected]>
483486
484487
Matthieu CASTET <[email protected]>
485488
489+
Mattijs Korpershoek <[email protected]> <[email protected]>
486490
487491
488492
Matt Ranostay <[email protected]> Matthew Ranostay <[email protected]>
@@ -749,6 +753,7 @@ Tvrtko Ursulin <[email protected]> <[email protected]>
749753
750754
751755
Uwe Kleine-König <[email protected]>
756+
752757
Uwe Kleine-König <[email protected]>
753758
Uwe Kleine-König <[email protected]>
754759
Uwe Kleine-König <[email protected]>

Documentation/ABI/testing/sysfs-devices-system-cpu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ Description: information about CPUs heterogeneity.
511511

512512
What: /sys/devices/system/cpu/vulnerabilities
513513
/sys/devices/system/cpu/vulnerabilities/gather_data_sampling
514+
/sys/devices/system/cpu/vulnerabilities/indirect_target_selection
514515
/sys/devices/system/cpu/vulnerabilities/itlb_multihit
515516
/sys/devices/system/cpu/vulnerabilities/l1tf
516517
/sys/devices/system/cpu/vulnerabilities/mds

Documentation/ABI/testing/sysfs-driver-hid-appletb-kbd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
What: /sys/bus/hid/drivers/hid-appletb-kbd/<dev>/mode
2-
Date: September, 2023
3-
KernelVersion: 6.5
2+
Date: March, 2025
3+
KernelVersion: 6.15
44
55
Description:
66
The set of keys displayed on the Touch Bar.

Documentation/admin-guide/hw-vuln/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ are configurable at compile, boot or run time.
2323
gather_data_sampling
2424
reg-file-data-sampling
2525
rsb
26+
indirect-target-selection
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
Indirect Target Selection (ITS)
4+
===============================
5+
6+
ITS is a vulnerability in some Intel CPUs that support Enhanced IBRS and were
7+
released before Alder Lake. ITS may allow an attacker to control the prediction
8+
of indirect branches and RETs located in the lower half of a cacheline.
9+
10+
ITS is assigned CVE-2024-28956 with a CVSS score of 4.7 (Medium).
11+
12+
Scope of Impact
13+
---------------
14+
- **eIBRS Guest/Host Isolation**: Indirect branches in KVM/kernel may still be
15+
predicted with unintended target corresponding to a branch in the guest.
16+
17+
- **Intra-Mode BTI**: In-kernel training such as through cBPF or other native
18+
gadgets.
19+
20+
- **Indirect Branch Prediction Barrier (IBPB)**: After an IBPB, indirect
21+
branches may still be predicted with targets corresponding to direct branches
22+
executed prior to the IBPB. This is fixed by the IPU 2025.1 microcode, which
23+
should be available via distro updates. Alternatively microcode can be
24+
obtained from Intel's github repository [#f1]_.
25+
26+
Affected CPUs
27+
-------------
28+
Below is the list of ITS affected CPUs [#f2]_ [#f3]_:
29+
30+
======================== ============ ==================== ===============
31+
Common name Family_Model eIBRS Intra-mode BTI
32+
Guest/Host Isolation
33+
======================== ============ ==================== ===============
34+
SKYLAKE_X (step >= 6) 06_55H Affected Affected
35+
ICELAKE_X 06_6AH Not affected Affected
36+
ICELAKE_D 06_6CH Not affected Affected
37+
ICELAKE_L 06_7EH Not affected Affected
38+
TIGERLAKE_L 06_8CH Not affected Affected
39+
TIGERLAKE 06_8DH Not affected Affected
40+
KABYLAKE_L (step >= 12) 06_8EH Affected Affected
41+
KABYLAKE (step >= 13) 06_9EH Affected Affected
42+
COMETLAKE 06_A5H Affected Affected
43+
COMETLAKE_L 06_A6H Affected Affected
44+
ROCKETLAKE 06_A7H Not affected Affected
45+
======================== ============ ==================== ===============
46+
47+
- All affected CPUs enumerate Enhanced IBRS feature.
48+
- IBPB isolation is affected on all ITS affected CPUs, and need a microcode
49+
update for mitigation.
50+
- None of the affected CPUs enumerate BHI_CTRL which was introduced in Golden
51+
Cove (Alder Lake and Sapphire Rapids). This can help guests to determine the
52+
host's affected status.
53+
- Intel Atom CPUs are not affected by ITS.
54+
55+
Mitigation
56+
----------
57+
As only the indirect branches and RETs that have their last byte of instruction
58+
in the lower half of the cacheline are vulnerable to ITS, the basic idea behind
59+
the mitigation is to not allow indirect branches in the lower half.
60+
61+
This is achieved by relying on existing retpoline support in the kernel, and in
62+
compilers. ITS-vulnerable retpoline sites are runtime patched to point to newly
63+
added ITS-safe thunks. These safe thunks consists of indirect branch in the
64+
second half of the cacheline. Not all retpoline sites are patched to thunks, if
65+
a retpoline site is evaluated to be ITS-safe, it is replaced with an inline
66+
indirect branch.
67+
68+
Dynamic thunks
69+
~~~~~~~~~~~~~~
70+
From a dynamically allocated pool of safe-thunks, each vulnerable site is
71+
replaced with a new thunk, such that they get a unique address. This could
72+
improve the branch prediction accuracy. Also, it is a defense-in-depth measure
73+
against aliasing.
74+
75+
Note, for simplicity, indirect branches in eBPF programs are always replaced
76+
with a jump to a static thunk in __x86_indirect_its_thunk_array. If required,
77+
in future this can be changed to use dynamic thunks.
78+
79+
All vulnerable RETs are replaced with a static thunk, they do not use dynamic
80+
thunks. This is because RETs get their prediction from RSB mostly that does not
81+
depend on source address. RETs that underflow RSB may benefit from dynamic
82+
thunks. But, RETs significantly outnumber indirect branches, and any benefit
83+
from a unique source address could be outweighed by the increased icache
84+
footprint and iTLB pressure.
85+
86+
Retpoline
87+
~~~~~~~~~
88+
Retpoline sequence also mitigates ITS-unsafe indirect branches. For this
89+
reason, when retpoline is enabled, ITS mitigation only relocates the RETs to
90+
safe thunks. Unless user requested the RSB-stuffing mitigation.
91+
92+
RSB Stuffing
93+
~~~~~~~~~~~~
94+
RSB-stuffing via Call Depth Tracking is a mitigation for Retbleed RSB-underflow
95+
attacks. And it also mitigates RETs that are vulnerable to ITS.
96+
97+
Mitigation in guests
98+
^^^^^^^^^^^^^^^^^^^^
99+
All guests deploy ITS mitigation by default, irrespective of eIBRS enumeration
100+
and Family/Model of the guest. This is because eIBRS feature could be hidden
101+
from a guest. One exception to this is when a guest enumerates BHI_DIS_S, which
102+
indicates that the guest is running on an unaffected host.
103+
104+
To prevent guests from unnecessarily deploying the mitigation on unaffected
105+
platforms, Intel has defined ITS_NO bit(62) in MSR IA32_ARCH_CAPABILITIES. When
106+
a guest sees this bit set, it should not enumerate the ITS bug. Note, this bit
107+
is not set by any hardware, but is **intended for VMMs to synthesize** it for
108+
guests as per the host's affected status.
109+
110+
Mitigation options
111+
^^^^^^^^^^^^^^^^^^
112+
The ITS mitigation can be controlled using the "indirect_target_selection"
113+
kernel parameter. The available options are:
114+
115+
======== ===================================================================
116+
on (default) Deploy the "Aligned branch/return thunks" mitigation.
117+
If spectre_v2 mitigation enables retpoline, aligned-thunks are only
118+
deployed for the affected RET instructions. Retpoline mitigates
119+
indirect branches.
120+
121+
off Disable ITS mitigation.
122+
123+
vmexit Equivalent to "=on" if the CPU is affected by guest/host isolation
124+
part of ITS. Otherwise, mitigation is not deployed. This option is
125+
useful when host userspace is not in the threat model, and only
126+
attacks from guest to host are considered.
127+
128+
stuff Deploy RSB-fill mitigation when retpoline is also deployed.
129+
Otherwise, deploy the default mitigation. When retpoline mitigation
130+
is enabled, RSB-stuffing via Call-Depth-Tracking also mitigates
131+
ITS.
132+
133+
force Force the ITS bug and deploy the default mitigation.
134+
======== ===================================================================
135+
136+
Sysfs reporting
137+
---------------
138+
139+
The sysfs file showing ITS mitigation status is:
140+
141+
/sys/devices/system/cpu/vulnerabilities/indirect_target_selection
142+
143+
Note, microcode mitigation status is not reported in this file.
144+
145+
The possible values in this file are:
146+
147+
.. list-table::
148+
149+
* - Not affected
150+
- The processor is not vulnerable.
151+
* - Vulnerable
152+
- System is vulnerable and no mitigation has been applied.
153+
* - Vulnerable, KVM: Not affected
154+
- System is vulnerable to intra-mode BTI, but not affected by eIBRS
155+
guest/host isolation.
156+
* - Mitigation: Aligned branch/return thunks
157+
- The mitigation is enabled, affected indirect branches and RETs are
158+
relocated to safe thunks.
159+
* - Mitigation: Retpolines, Stuffing RSB
160+
- The mitigation is enabled using retpoline and RSB stuffing.
161+
162+
References
163+
----------
164+
.. [#f1] Microcode repository - https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files
165+
166+
.. [#f2] Affected Processors list - https://www.intel.com/content/www/us/en/developer/topic-technology/software-security-guidance/processors-affected-consolidated-product-cpu-model.html
167+
168+
.. [#f3] Affected Processors list (machine readable) - https://github.com/intel/Intel-affected-processor-list

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,6 +2202,23 @@
22022202
different crypto accelerators. This option can be used
22032203
to achieve best performance for particular HW.
22042204

2205+
indirect_target_selection= [X86,Intel] Mitigation control for Indirect
2206+
Target Selection(ITS) bug in Intel CPUs. Updated
2207+
microcode is also required for a fix in IBPB.
2208+
2209+
on: Enable mitigation (default).
2210+
off: Disable mitigation.
2211+
force: Force the ITS bug and deploy default
2212+
mitigation.
2213+
vmexit: Only deploy mitigation if CPU is affected by
2214+
guest/host isolation part of ITS.
2215+
stuff: Deploy RSB-fill mitigation when retpoline is
2216+
also deployed. Otherwise, deploy the default
2217+
mitigation.
2218+
2219+
For details see:
2220+
Documentation/admin-guide/hw-vuln/indirect-target-selection.rst
2221+
22052222
init= [KNL]
22062223
Format: <full_path>
22072224
Run specified binary instead of /sbin/init as init
@@ -3693,6 +3710,7 @@
36933710
expose users to several CPU vulnerabilities.
36943711
Equivalent to: if nokaslr then kpti=0 [ARM64]
36953712
gather_data_sampling=off [X86]
3713+
indirect_target_selection=off [X86]
36963714
kvm.nx_huge_pages=off [X86]
36973715
l1tf=off [X86]
36983716
mds=off [X86]

Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
77
title: Mediatek's Keypad Controller
88

99
maintainers:
10-
- Mattijs Korpershoek <mkorpershoek@baylibre.com>
10+
- Mattijs Korpershoek <mkorpershoek@kernel.org>
1111

1212
allOf:
1313
- $ref: /schemas/input/matrix-keymap.yaml#

Documentation/devicetree/bindings/net/ethernet-controller.yaml

Lines changed: 90 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,17 @@ properties:
7474
- rev-rmii
7575
- moca
7676

77-
# RX and TX delays are added by the MAC when required
77+
# RX and TX delays are provided by the PCB. See below
7878
- rgmii
7979

80-
# RGMII with internal RX and TX delays provided by the PHY,
81-
# the MAC should not add the RX or TX delays in this case
80+
# RX and TX delays are not provided by the PCB. This is the most
81+
# frequent case. See below
8282
- rgmii-id
8383

84-
# RGMII with internal RX delay provided by the PHY, the MAC
85-
# should not add an RX delay in this case
84+
# TX delay is provided by the PCB. See below
8685
- rgmii-rxid
8786

88-
# RGMII with internal TX delay provided by the PHY, the MAC
89-
# should not add an TX delay in this case
87+
# RX delay is provided by the PCB. See below
9088
- rgmii-txid
9189
- rtbi
9290
- smii
@@ -286,4 +284,89 @@ allOf:
286284

287285
additionalProperties: true
288286

287+
# Informative
288+
# ===========
289+
#
290+
# 'phy-modes' & 'phy-connection-type' properties 'rgmii', 'rgmii-id',
291+
# 'rgmii-rxid', and 'rgmii-txid' are frequently used wrongly by
292+
# developers. This informative section clarifies their usage.
293+
#
294+
# The RGMII specification requires a 2ns delay between the data and
295+
# clock signals on the RGMII bus. How this delay is implemented is not
296+
# specified.
297+
#
298+
# One option is to make the clock traces on the PCB longer than the
299+
# data traces. A sufficiently difference in length can provide the 2ns
300+
# delay. If both the RX and TX delays are implemented in this manner,
301+
# 'rgmii' should be used, so indicating the PCB adds the delays.
302+
#
303+
# If the PCB does not add these delays via extra long traces,
304+
# 'rgmii-id' should be used. Here, 'id' refers to 'internal delay',
305+
# where either the MAC or PHY adds the delay.
306+
#
307+
# If only one of the two delays are implemented via extra long clock
308+
# lines, either 'rgmii-rxid' or 'rgmii-txid' should be used,
309+
# indicating the MAC or PHY should implement one of the delays
310+
# internally, while the PCB implements the other delay.
311+
#
312+
# Device Tree describes hardware, and in this case, it describes the
313+
# PCB between the MAC and the PHY, if the PCB implements delays or
314+
# not.
315+
#
316+
# In practice, very few PCBs make use of extra long clock lines. Hence
317+
# any RGMII phy mode other than 'rgmii-id' is probably wrong, and is
318+
# unlikely to be accepted during review without details provided in
319+
# the commit description and comments in the .dts file.
320+
#
321+
# When the PCB does not implement the delays, the MAC or PHY must. As
322+
# such, this is software configuration, and so not described in Device
323+
# Tree.
324+
#
325+
# The following describes how Linux implements the configuration of
326+
# the MAC and PHY to add these delays when the PCB does not. As stated
327+
# above, developers often get this wrong, and the aim of this section
328+
# is reduce the frequency of these errors by Linux developers. Other
329+
# users of the Device Tree may implement it differently, and still be
330+
# consistent with both the normative and informative description
331+
# above.
332+
#
333+
# By default in Linux, when using phylib/phylink, the MAC is expected
334+
# to read the 'phy-mode' from Device Tree, not implement any delays,
335+
# and pass the value to the PHY. The PHY will then implement delays as
336+
# specified by the 'phy-mode'. The PHY should always be reconfigured
337+
# to implement the needed delays, replacing any setting performed by
338+
# strapping or the bootloader, etc.
339+
#
340+
# Experience to date is that all PHYs which implement RGMII also
341+
# implement the ability to add or not add the needed delays. Hence
342+
# this default is expected to work in all cases. Ignoring this default
343+
# is likely to be questioned by Reviews, and require a strong argument
344+
# to be accepted.
345+
#
346+
# There are a small number of cases where the MAC has hard coded
347+
# delays which cannot be disabled. The 'phy-mode' only describes the
348+
# PCB. The inability to disable the delays in the MAC does not change
349+
# the meaning of 'phy-mode'. It does however mean that a 'phy-mode' of
350+
# 'rgmii' is now invalid, it cannot be supported, since both the PCB
351+
# and the MAC and PHY adding delays cannot result in a functional
352+
# link. Thus the MAC should report a fatal error for any modes which
353+
# cannot be supported. When the MAC implements the delay, it must
354+
# ensure that the PHY does not also implement the same delay. So it
355+
# must modify the phy-mode it passes to the PHY, removing the delay it
356+
# has added. Failure to remove the delay will result in a
357+
# non-functioning link.
358+
#
359+
# Sometimes there is a need to fine tune the delays. Often the MAC or
360+
# PHY can perform this fine tuning. In the MAC node, the Device Tree
361+
# properties 'rx-internal-delay-ps' and 'tx-internal-delay-ps' should
362+
# be used to indicate fine tuning performed by the MAC. The values
363+
# expected here are small. A value of 2000ps, i.e 2ns, and a phy-mode
364+
# of 'rgmii' will not be accepted by Reviewers.
365+
#
366+
# If the PHY is to perform fine tuning, the properties
367+
# 'rx-internal-delay-ps' and 'tx-internal-delay-ps' in the PHY node
368+
# should be used. When the PHY is implementing delays, e.g. 'rgmii-id'
369+
# these properties should have a value near to 2000ps. If the PCB is
370+
# implementing delays, e.g. 'rgmii', a small value can be used to fine
371+
# tune the delay added by the PCB.
289372
...

0 commit comments

Comments
 (0)