Skip to content

Commit b9e705e

Browse files
dwmw2KAGA-KOKO
authored andcommitted
x86/alternatives: Add missing '\n' at end of ALTERNATIVE inline asm
Where an ALTERNATIVE is used in the middle of an inline asm block, this would otherwise lead to the following instruction being appended directly to the trailing ".popsection", and a failed compile. Fixes: 9cebed4 ("x86, alternative: Use .pushsection/.popsection") Signed-off-by: David Woodhouse <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: Rik van Riel <[email protected]> Cc: [email protected] Cc: Tim Chen <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Paul Turner <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Kees Cook <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 1e54768 commit b9e705e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/include/asm/alternative.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static inline int alternatives_text_reserved(void *start, void *end)
140140
".popsection\n" \
141141
".pushsection .altinstr_replacement, \"ax\"\n" \
142142
ALTINSTR_REPLACEMENT(newinstr, feature, 1) \
143-
".popsection"
143+
".popsection\n"
144144

145145
#define ALTERNATIVE_2(oldinstr, newinstr1, feature1, newinstr2, feature2)\
146146
OLDINSTR_2(oldinstr, 1, 2) \
@@ -151,7 +151,7 @@ static inline int alternatives_text_reserved(void *start, void *end)
151151
".pushsection .altinstr_replacement, \"ax\"\n" \
152152
ALTINSTR_REPLACEMENT(newinstr1, feature1, 1) \
153153
ALTINSTR_REPLACEMENT(newinstr2, feature2, 2) \
154-
".popsection"
154+
".popsection\n"
155155

156156
/*
157157
* Alternative instructions for different CPU types or capabilities.

0 commit comments

Comments
 (0)