mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-30 03:57:32 +00:00

sched_smt_active() can be called from noinstr code, so it should always
be inlined. The CONFIG_SCHED_SMT version already has __always_inline.
Do the same for its !CONFIG_SCHED_SMT counterpart.
Fixes the following warning:
vmlinux.o: error: objtool: intel_idle_ibrs+0x13: call to sched_smt_active() leaves .noinstr.text section
Fixes: 321a874a7e
("sched/smt: Expose sched_smt_present static key")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/1d03907b0a247cf7fb5c1d518de378864f603060.1743481539.git.jpoimboe@kernel.org
Closes: https://lore.kernel.org/r/202503311434.lyw2Tveh-lkp@intel.com/
21 lines
449 B
C
21 lines
449 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_SCHED_SMT_H
|
|
#define _LINUX_SCHED_SMT_H
|
|
|
|
#include <linux/static_key.h>
|
|
|
|
#ifdef CONFIG_SCHED_SMT
|
|
extern struct static_key_false sched_smt_present;
|
|
|
|
static __always_inline bool sched_smt_active(void)
|
|
{
|
|
return static_branch_likely(&sched_smt_present);
|
|
}
|
|
#else
|
|
static __always_inline bool sched_smt_active(void) { return false; }
|
|
#endif
|
|
|
|
void arch_smt_update(void);
|
|
|
|
#endif /* _LINUX_SCHED_SMT_H */
|