mirror-linux/arch/x86/mm
Josh Poimboeuf 2cbb20b008 tracing: Disable branch profiling in noinstr code
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
2025-03-22 09:49:26 +01:00
..
pat hyperv: Clean up unnecessary #includes 2025-01-08 08:18:27 +00:00
Makefile mm: introduce numa_emulation 2024-09-03 21:15:31 -07:00
amdtopology.c mm: introduce numa_memblks 2024-09-03 21:15:30 -07:00
cpu_entry_area.c x86/cpu_entry_area: Annotate percpu_setup_exception_stacks() as __init 2024-08-25 14:29:38 +02:00
debug_pagetables.c x86/bugs: Rename CONFIG_PAGE_TABLE_ISOLATION => CONFIG_MITIGATION_PAGE_TABLE_ISOLATION 2024-01-10 10:52:28 +01:00
dump_pagetables.c - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
extable.c x86/extable: Remove unused fixup type EX_TYPE_COPY 2024-04-04 17:01:40 +02:00
fault.c x86/mm changes for v6.14: 2025-01-31 10:39:07 -08:00
highmem_32.c x86/mm: Include asm/numa.h for set_highmem_pages_init() 2023-05-18 11:56:18 -07:00
hugetlbpage.c mm: drop hugetlb_get_unmapped_area{_*} functions 2024-11-06 20:11:10 -08:00
ident_map.c x86/mm: Add _PAGE_NOPTISHADOW bit to avoid updating userspace page tables 2024-12-05 13:04:00 +01:00
init.c x86/execmem: fix ROX cache usage in Xen PV guests 2025-01-12 19:03:35 -08:00
init_32.c mm/treewide: replace pmd_large() with pmd_leaf() 2024-03-06 13:04:19 -08:00
init_64.c bootmem: stop using page->index 2024-11-07 14:38:07 -08:00
iomap_32.c
ioremap.c x86/ioremap: Remove unused size parameter in remapping functions 2024-12-07 17:23:23 +01:00
kasan_init_64.c tracing: Disable branch profiling in noinstr code 2025-03-22 09:49:26 +01:00
kaslr.c - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
kmmio.c x86/mm/kmmio: Remove redundant preempt_disable() 2022-12-12 10:54:48 -05:00
kmsan_shadow.c x86: kmsan: handle CPU entry area 2022-10-03 14:03:26 -07:00
maccess.c x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 2024-02-15 19:21:39 -08:00
mem_encrypt.c x86/sev: Add Secure TSC support for SNP guests 2025-01-07 20:27:23 +01:00
mem_encrypt_amd.c tracing: Disable branch profiling in noinstr code 2025-03-22 09:49:26 +01:00
mem_encrypt_boot.S x86/mm: Remove P*D_PAGE_MASK and P*D_PAGE_SIZE macros 2022-12-15 10:37:27 -08:00
mem_encrypt_identity.c tracing: Disable branch profiling in noinstr code 2025-03-22 09:49:26 +01:00
mm_internal.h
mmap.c x86/mm/mmap: Remove arch_vma_name() 2024-11-02 12:37:33 +01:00
mmio-mod.c
numa.c mm: make range-to-target_node lookup facility a part of numa_memblks 2024-09-03 21:15:32 -07:00
numa_32.c fix missing vmalloc.h includes 2024-04-25 20:55:49 -07:00
numa_64.c
numa_internal.h mm: introduce numa_emulation 2024-09-03 21:15:31 -07:00
pf_in.c
pf_in.h
pgprot.c
pgtable.c asm-generic: pgalloc: provide generic __pgd_{alloc,free} 2025-01-25 20:22:24 -08:00
pgtable_32.c
physaddr.c
physaddr.h
pkeys.c
pti.c x86/mm: Add _PAGE_NOPTISHADOW bit to avoid updating userspace page tables 2024-12-05 13:04:00 +01:00
srat.c x86/mm: Don't print out SRAT table information 2024-08-08 17:23:40 +02:00
testmmiotrace.c x86/mm: add testmmiotrace MODULE_DESCRIPTION() 2024-09-01 20:43:31 -07:00
tlb.c Merge branch 'linus' into x86/mm, to pick up fixes 2024-12-20 10:25:44 +01:00