Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

objtool: Silence more KCOV warnings

In the past there were issues with KCOV triggering unreachable
instruction warnings, which is why unreachable warnings are now disabled
with CONFIG_KCOV.

Now some new KCOV warnings are showing up with GCC 14:

vmlinux.o: warning: objtool: cpuset_write_resmask() falls through to next function cpuset_update_active_cpus.cold()
drivers/usb/core/driver.o: error: objtool: usb_deregister() falls through to next function usb_match_device()
sound/soc/codecs/snd-soc-wcd934x.o: warning: objtool: .text.wcd934x_slim_irq_handler: unexpected end of section

All are caused by GCC KCOV not finishing an optimization, leaving behind
a never-taken conditional branch to a basic block which falls through to
the next function (or end of section).

At a high level this is similar to the unreachable warnings mentioned
above, in that KCOV isn't fully removing dead code. Treat it the same
way by adding these to the list of warnings to ignore with CONFIG_KCOV.

Reported-by: Ingo Molnar <mingo@kernel.org>
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/66a61a0b65d74e072d3dc02384e395edb2adc3c5.1742852846.git.jpoimboe@kernel.org
Closes: https://lore.kernel.org/Z9iTsI09AEBlxlHC@gmail.com
Closes: https://lore.kernel.org/oe-kbuild-all/202503180044.oH9gyPeg-lkp@intel.com/

authored by

Josh Poimboeuf and committed by
Ingo Molnar
6b023c78 4fab2d76

+6
+6
tools/objtool/check.c
··· 3485 3485 !strncmp(func->name, "__pfx_", 6)) 3486 3486 return 0; 3487 3487 3488 + if (file->ignore_unreachables) 3489 + return 0; 3490 + 3488 3491 WARN("%s() falls through to next function %s()", 3489 3492 func->name, insn_func(insn)->name); 3490 3493 return 1; ··· 3697 3694 if (!next_insn) { 3698 3695 if (state.cfi.cfa.base == CFI_UNDEFINED) 3699 3696 return 0; 3697 + if (file->ignore_unreachables) 3698 + return 0; 3699 + 3700 3700 WARN("%s: unexpected end of section", sec->name); 3701 3701 return 1; 3702 3702 }