Skip to content

Commit c22ef56

Browse files
wtarreaubp3tk0v
authored andcommitted
x86/alternatives: Do not use integer constant suffixes in inline asm
The usage of the BIT() macro in inline asm code was introduced in 6.3 by the commit in the Fixes tag. However, this macro uses "1UL" for integer constant suffixes in its shift operation, while gas before 2.28 does not support the "L" suffix after a number, and gas before 2.27 does not support the "U" suffix, resulting in build errors such as the following with such versions: ./arch/x86/include/asm/uaccess_64.h:124: Error: found 'L', expected: ')' ./arch/x86/include/asm/uaccess_64.h:124: Error: junk at end of line, first unrecognized character is `L' However, the currently minimal binutils version the kernel supports is 2.25. There's a single use of this macro here, revert to (1 << 0) that works with such older binutils. As an additional info, the binutils PRs which add support for those suffixes are: https://sourceware.org/bugzilla/show_bug.cgi?id=19910 https://sourceware.org/bugzilla/show_bug.cgi?id=20732 [ bp: Massage and extend commit message. ] Fixes: 5d1dd96 ("x86/alternatives: Add alt_instr.flags") Signed-off-by: Willy Tarreau <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Tested-by: Jingbo Xu <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/
1 parent 6a8f57a commit c22ef56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/include/asm/alternative.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#define ALT_FLAGS_SHIFT 16
1010

11-
#define ALT_FLAG_NOT BIT(0)
11+
#define ALT_FLAG_NOT (1 << 0)
1212
#define ALT_NOT(feature) ((ALT_FLAG_NOT << ALT_FLAGS_SHIFT) | (feature))
1313

1414
#ifndef __ASSEMBLY__

0 commit comments

Comments
 (0)