mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

CONFIG_TRACE_BRANCH_PROFILING inserts a call to ftrace_likely_update() for each use of likely() or unlikely(). That breaks noinstr rules if the affected function is annotated as noinstr. Disable branch profiling for files with noinstr functions. In addition to some individual files, this also includes the entire arch/x86 subtree, as well as the kernel/entry, drivers/cpuidle, and drivers/idle directories, all of which are noinstr-heavy. Due to the nature of how sched binaries are built by combining multiple .c files into one, branch profiling is disabled more broadly across the sched code than would otherwise be needed. This fixes many warnings like the following: vmlinux.o: warning: objtool: do_syscall_64+0x40: call to ftrace_likely_update() leaves .noinstr.text section vmlinux.o: warning: objtool: __rdgsbase_inactive+0x33: call to ftrace_likely_update() leaves .noinstr.text section vmlinux.o: warning: objtool: handle_bug.isra.0+0x198: call to ftrace_likely_update() leaves .noinstr.text section ... Reported-by: Ingo Molnar <mingo@kernel.org> Suggested-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/fb94fc9303d48a5ed370498f54500cc4c338eb6d.1742586676.git.jpoimboe@kernel.org
38 lines
721 B
Makefile
38 lines
721 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
# Branch profiling isn't noinstr-safe. Disable it for arch/x86/*
|
|
subdir-ccflags-$(CONFIG_TRACE_BRANCH_PROFILING) += -DDISABLE_BRANCH_PROFILING
|
|
|
|
obj-$(CONFIG_ARCH_HAS_CC_PLATFORM) += coco/
|
|
|
|
obj-y += entry/
|
|
|
|
obj-$(CONFIG_PERF_EVENTS) += events/
|
|
|
|
obj-$(CONFIG_KVM) += kvm/
|
|
|
|
# Xen paravirtualization support
|
|
obj-$(CONFIG_XEN) += xen/
|
|
|
|
obj-$(CONFIG_PVH) += platform/pvh/
|
|
|
|
# Hyper-V paravirtualization support
|
|
obj-$(subst m,y,$(CONFIG_HYPERV)) += hyperv/
|
|
|
|
obj-y += realmode/
|
|
obj-y += kernel/
|
|
obj-y += mm/
|
|
|
|
obj-y += crypto/
|
|
|
|
obj-$(CONFIG_IA32_EMULATION) += ia32/
|
|
|
|
obj-y += platform/
|
|
obj-y += net/
|
|
|
|
obj-$(CONFIG_KEXEC_FILE) += purgatory/
|
|
|
|
obj-y += virt/
|
|
|
|
# for cleaning
|
|
subdir- += boot tools
|