]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
objtool, x86/hweight: Remove ANNOTATE_IGNORE_ALTERNATIVE
authorJosh Poimboeuf <jpoimboe@kernel.org>
Thu, 10 Apr 2025 20:58:35 +0000 (13:58 -0700)
committerIngo Molnar <mingo@kernel.org>
Sun, 13 Apr 2025 07:52:42 +0000 (09:52 +0200)
commit7b3169dfa4ba1b1898d4bdfad6ddabbc9e8a57ed
tree18ec40e50422cfc31e8434e64c05d0fff0109520
parentd51faee4bd63b3b02fa6f56210ec0d84c5ccb680
objtool, x86/hweight: Remove ANNOTATE_IGNORE_ALTERNATIVE

Since objtool's inception, frame pointer warnings have been manually
silenced for __arch_hweight*() to allow those functions' inline asm to
avoid using ASM_CALL_CONSTRAINT.

The potentially dubious reasoning for that decision over nine years ago
was that since !X86_FEATURE_POPCNT is exceedingly rare, it's not worth
hurting the code layout for a function call that will never happen on
the vast majority of systems.

However, those functions actually started using ASM_CALL_CONSTRAINT with
the following commit:

  194a613088a8 ("x86/hweight: Use ASM_CALL_CONSTRAINT in inline asm()")

And rightfully so, as it makes the code correct.  ASM_CALL_CONSTRAINT
will soon have no effect for non-FP configs anyway.

With ASM_CALL_CONSTRAINT in place, ANNOTATE_IGNORE_ALTERNATIVE no longer
has a purpose for the hweight functions.  Remove it.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/e7070dba3278c90f1a836b16157dcd34ccd21e21.1744318586.git.jpoimboe@kernel.org
arch/x86/include/asm/arch_hweight.h