]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/bugs: Restructure ITS mitigation
authorDavid Kaplan <david.kaplan@amd.com>
Fri, 16 May 2025 19:32:11 +0000 (14:32 -0500)
committerIngo Molnar <mingo@kernel.org>
Wed, 21 May 2025 06:45:27 +0000 (08:45 +0200)
commit61ab72c2c6bf24f28b3dbfd3126e984d5afa8424
treef113f5db71beaa83c05a98563652edb7ab7ba9c6
parent412751aa6991501d7defeadecfede59043d1b5e8
x86/bugs: Restructure ITS mitigation

Restructure the ITS mitigation to use select/update/apply functions like
the other mitigations.

There is a particularly complex interaction between ITS and Retbleed as CDT
(Call Depth Tracking) is a mitigation for both, and either its=stuff or
retbleed=stuff will attempt to enable CDT.

retbleed_update_mitigation() runs first and will check the necessary
pre-conditions for CDT if either ITS or Retbleed stuffing is selected.  If
checks pass and ITS stuffing is selected, it will select stuffing for
Retbleed as well.

its_update_mitigation() runs after and will either select stuffing if
retbleed stuffing was enabled, or fall back to the default (aligned thunks)
if stuffing could not be enabled.

Enablement of CDT is done exclusively in retbleed_apply_mitigation().
its_apply_mitigation() is only used to enable aligned thunks.

Signed-off-by: David Kaplan <david.kaplan@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/20250516193212.128782-1-david.kaplan@amd.com
arch/x86/kernel/cpu/bugs.c