0239-x86-alternatives-Add-missing-n-at-end-of-ALTERNATIVE.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. From fe5fdc3484283039f5f7477874eeef1a26f2b6be Mon Sep 17 00:00:00 2001
  2. From: David Woodhouse <[email protected]>
  3. Date: Thu, 4 Jan 2018 14:37:05 +0000
  4. Subject: [PATCH 239/242] x86/alternatives: Add missing '\n' at end of
  5. ALTERNATIVE inline asm
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. commit b9e705ef7cfaf22db0daab91ad3cd33b0fa32eb9 upstream.
  10. Where an ALTERNATIVE is used in the middle of an inline asm block, this
  11. would otherwise lead to the following instruction being appended directly
  12. to the trailing ".popsection", and a failed compile.
  13. Fixes: 9cebed423c84 ("x86, alternative: Use .pushsection/.popsection")
  14. Signed-off-by: David Woodhouse <[email protected]>
  15. Signed-off-by: Thomas Gleixner <[email protected]>
  16. Cc: [email protected]
  17. Cc: Rik van Riel <[email protected]>
  18. Cc: [email protected]
  19. Cc: Tim Chen <[email protected]>
  20. Cc: Peter Zijlstra <[email protected]>
  21. Cc: Paul Turner <[email protected]>
  22. Cc: Jiri Kosina <[email protected]>
  23. Cc: Andy Lutomirski <[email protected]>
  24. Cc: Dave Hansen <[email protected]>
  25. Cc: Kees Cook <[email protected]>
  26. Cc: Linus Torvalds <[email protected]>
  27. Cc: Greg Kroah-Hartman <[email protected]>
  28. Link: https://lkml.kernel.org/r/[email protected]
  29. Signed-off-by: Greg Kroah-Hartman <[email protected]>
  30. Signed-off-by: Fabian Grünbichler <[email protected]>
  31. ---
  32. arch/x86/include/asm/alternative.h | 4 ++--
  33. 1 file changed, 2 insertions(+), 2 deletions(-)
  34. diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
  35. index d4aea31eec03..deca9b9c7923 100644
  36. --- a/arch/x86/include/asm/alternative.h
  37. +++ b/arch/x86/include/asm/alternative.h
  38. @@ -139,7 +139,7 @@ static inline int alternatives_text_reserved(void *start, void *end)
  39. ".popsection\n" \
  40. ".pushsection .altinstr_replacement, \"ax\"\n" \
  41. ALTINSTR_REPLACEMENT(newinstr, feature, 1) \
  42. - ".popsection"
  43. + ".popsection\n"
  44. #define ALTERNATIVE_2(oldinstr, newinstr1, feature1, newinstr2, feature2)\
  45. OLDINSTR_2(oldinstr, 1, 2) \
  46. @@ -150,7 +150,7 @@ static inline int alternatives_text_reserved(void *start, void *end)
  47. ".pushsection .altinstr_replacement, \"ax\"\n" \
  48. ALTINSTR_REPLACEMENT(newinstr1, feature1, 1) \
  49. ALTINSTR_REPLACEMENT(newinstr2, feature2, 2) \
  50. - ".popsection"
  51. + ".popsection\n"
  52. /*
  53. * Alternative instructions for different CPU types or capabilities.
  54. --
  55. 2.14.2