[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <174065112425.10177.5617289587754238222.tip-bot2@tip-bot2>
Date: Thu, 27 Feb 2025 10:12:04 -0000
From: "tip-bot2 for Yosry Ahmed" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Yosry Ahmed <yosry.ahmed@...ux.dev>, Ingo Molnar <mingo@...nel.org>,
Josh Poimboeuf <jpoimboe@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/bugs] x86/mm: Remove X86_FEATURE_USE_IBPB checks in
cond_mitigation()
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: a48dc42614cad39fac1ef55d690847fd07f0e3c6
Gitweb: https://git.kernel.org/tip/a48dc42614cad39fac1ef55d690847fd07f0e3c6
Author: Yosry Ahmed <yosry.ahmed@...ux.dev>
AuthorDate: Thu, 27 Feb 2025 01:27:08
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Thu, 27 Feb 2025 10:57:20 +01:00
x86/mm: Remove X86_FEATURE_USE_IBPB checks in cond_mitigation()
The check is performed when either switch_mm_cond_ibpb or
switch_mm_always_ibpb is set. In both cases, X86_FEATURE_USE_IBPB is
always set. Remove the redundant check.
Signed-off-by: Yosry Ahmed <yosry.ahmed@...ux.dev>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Acked-by: Josh Poimboeuf <jpoimboe@...nel.org>
Link: https://lore.kernel.org/r/20250227012712.3193063-3-yosry.ahmed@linux.dev
---
arch/x86/mm/tlb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 4f61d11..3070807 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -437,8 +437,7 @@ static void cond_mitigation(struct task_struct *next)
* both have the IBPB bit set.
*/
if (next_mm != prev_mm &&
- (next_mm | prev_mm) & LAST_USER_MM_IBPB &&
- cpu_feature_enabled(X86_FEATURE_USE_IBPB))
+ (next_mm | prev_mm) & LAST_USER_MM_IBPB)
indirect_branch_prediction_barrier();
}
@@ -448,8 +447,7 @@ static void cond_mitigation(struct task_struct *next)
* different context than the user space task which ran
* last on this CPU.
*/
- if ((prev_mm & ~LAST_USER_MM_SPEC_MASK) != (unsigned long)next->mm &&
- cpu_feature_enabled(X86_FEATURE_USE_IBPB))
+ if ((prev_mm & ~LAST_USER_MM_SPEC_MASK) != (unsigned long)next->mm)
indirect_branch_prediction_barrier();
}
Powered by blists - more mailing lists