linux-yocto/drivers/base
Pawan Gupta 68d59e9ba3 x86/its: Enable Indirect Target Selection mitigation
commit f4818881c47fd91fcb6d62373c57c7844e3de1c0 upstream.

Indirect Target Selection (ITS) is a bug in some pre-ADL Intel CPUs with
eIBRS. It affects prediction of indirect branch and RETs in the
lower half of cacheline. Due to ITS such branches may get wrongly predicted
to a target of (direct or indirect) branch that is located in the upper
half of the cacheline.

Scope of impact
===============

Guest/host isolation
--------------------
When eIBRS is used for guest/host isolation, the indirect branches in the
VMM may still be predicted with targets corresponding to branches in the
guest.

Intra-mode
----------
cBPF or other native gadgets can be used for intra-mode training and
disclosure using ITS.

User/kernel isolation
---------------------
When eIBRS is enabled user/kernel isolation is not impacted.

Indirect Branch Prediction Barrier (IBPB)
-----------------------------------------
After an IBPB, indirect branches may be predicted with targets
corresponding to direct branches which were executed prior to IBPB. This is
mitigated by a microcode update.

Add cmdline parameter indirect_target_selection=off|on|force to control the
mitigation to relocate the affected branches to an ITS-safe thunk i.e.
located in the upper half of cacheline. Also add the sysfs reporting.

When retpoline mitigation is deployed, ITS safe-thunks are not needed,
because retpoline sequence is already ITS-safe. Similarly, when call depth
tracking (CDT) mitigation is deployed (retbleed=stuff), ITS safe return
thunk is not used, as CDT prevents RSB-underflow.

To not overcomplicate things, ITS mitigation is not supported with
spectre-v2 lfence;jmp mitigation. Moreover, it is less practical to deploy
lfence;jmp mitigation on ITS affected parts anyways.

Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-05-18 08:24:59 +02:00
..
firmware_loader firmware_loader: Fix possible resource leak in fw_log_firmware_info() 2024-12-05 14:02:38 +01:00
power PM: sleep: Fix handling devices with direct_complete set on errors 2025-04-10 14:39:11 +02:00
regmap regmap-irq: Add missing kfree() 2025-02-21 14:01:37 +01:00
test drivers: base: test: Make property entry API test modular 2023-10-05 13:11:44 +02:00
arch_numa.c arch_numa: Restore nid checks before registering a memblock with a node 2024-12-14 20:03:31 +01:00
arch_topology.c ACPI: processor: Move arch_init_invariance_cppc() call later 2024-11-06 21:31:36 +01:00
attribute_container.c driver core: attribute_container: Remove unused functions 2024-09-13 15:41:42 +02:00
auxiliary_sysfs.c driver core: auxiliary bus: show auxiliary device IRQs 2024-07-11 14:17:03 -07:00
auxiliary.c drivers/base: Introduce device_match_t for device finding APIs 2024-09-03 12:48:51 +02:00
base.h driver core: fix potential NULL pointer dereference in dev_uevent() 2025-05-02 07:59:29 +02:00
bus.c driver core: fix potential NULL pointer dereference in dev_uevent() 2025-05-02 07:59:29 +02:00
cacheinfo.c cacheinfo: Allocate memory during CPU hotplug if not done from the primary CPU 2024-12-14 20:03:27 +01:00
class.c driver core: class: Fix wild pointer dereferences in API class_dev_iter_next() 2025-02-08 09:57:58 +01:00
component.c driver core: component: fix spellos 2024-01-30 15:58:06 -08:00
container.c driver core: container: make container_subsys const 2023-12-21 13:56:10 +01:00
core.c driver core: fix potential NULL pointer dereference in dev_uevent() 2025-05-02 07:59:29 +02:00
cpu.c x86/its: Enable Indirect Target Selection mitigation 2025-05-18 08:24:59 +02:00
dd.c driver core: introduce device_set_driver() helper 2025-05-02 07:59:28 +02:00
devcoredump.c devcoredump: Add dev_coredumpm_timeout() 2024-06-12 11:29:36 -04:00
devres.c drivers: base: devres: Allow to release group on device release 2025-04-20 10:15:24 +02:00
devtmpfs.c driver core: clean up the logic to determine which /sys/dev/ directory to use 2023-03-31 17:45:07 +02:00
driver.c drivers/base: Introduce device_match_t for device finding APIs 2024-09-03 12:48:51 +02:00
firmware.c
hypervisor.c
init.c drivers: base: Move cpu_dev_init() after node_dev_init() 2023-12-06 12:41:49 +09:00
isa.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
Kconfig arch_numa: switch over to numa_memblks 2024-09-03 21:15:32 -07:00
Makefile driver core: auxiliary bus: show auxiliary device IRQs 2024-07-11 14:17:03 -07:00
map.c
memory.c crash: add a new kexec flag for hotplug support 2024-04-23 14:59:01 +10:00
module.c drivers: base: handle module_kobject creation 2025-05-09 09:50:52 +02:00
node.c cxl/region: Deal with numa nodes not enumerated by SRAT 2024-03-12 14:54:03 -07:00
physical_location.c
physical_location.h driver core: physical_location.h remove extern from function prototypes 2023-03-24 15:35:48 +01:00
pinctrl.c
platform-msi.c genirq/msi: Remove platform MSI leftovers 2024-07-18 20:31:21 +02:00
platform.c platform: Make platform_bus_type constant 2024-09-03 13:00:50 +02:00
property.c Char/Misc and other driver subsystem changes for 6.10-rc1 2024-05-22 12:26:46 -07:00
soc.c driver core: mark remaining local bus_type variables as const 2023-12-21 13:56:30 +01:00
swnode.c device property: Don't use "proxy" headers 2024-03-07 22:07:26 +00:00
syscore.c
topology.c topology: Keep the cpumask unchanged when printing cpumap 2025-01-17 13:40:53 +01:00
trace.c
trace.h devres: Fix page faults when tracing devres from unloaded modules 2024-12-05 14:02:36 +01:00
transport_class.c