Skip to content

Commit a7ef9ba

Browse files
committed
x86/speculation/mds: Mark mds_user_clear_cpu_buffers() __always_inline
Prevent the compiler from uninlining and creating traceable/probable functions as this is invoked _after_ context tracking switched to CONTEXT_USER and rcu idle. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Alexandre Chartre <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 4983e5d commit a7ef9ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/include/asm/nospec-branch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ DECLARE_STATIC_KEY_FALSE(mds_idle_clear);
262262
* combination with microcode which triggers a CPU buffer flush when the
263263
* instruction is executed.
264264
*/
265-
static inline void mds_clear_cpu_buffers(void)
265+
static __always_inline void mds_clear_cpu_buffers(void)
266266
{
267267
static const u16 ds = __KERNEL_DS;
268268

@@ -283,7 +283,7 @@ static inline void mds_clear_cpu_buffers(void)
283283
*
284284
* Clear CPU buffers if the corresponding static key is enabled
285285
*/
286-
static inline void mds_user_clear_cpu_buffers(void)
286+
static __always_inline void mds_user_clear_cpu_buffers(void)
287287
{
288288
if (static_branch_likely(&mds_user_clear))
289289
mds_clear_cpu_buffers();

0 commit comments

Comments
 (0)