0051-x86-asm-Remove-unnecessary-n-t-in-front-of-CC_SET-fr.patch 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. From 7d7ea8398b5f0cf22b8faec46c95543031c5fe94 Mon Sep 17 00:00:00 2001
  2. From: Uros Bizjak <[email protected]>
  3. Date: Wed, 6 Sep 2017 17:18:08 +0200
  4. Subject: [PATCH 051/242] x86/asm: Remove unnecessary \n\t in front of CC_SET()
  5. from asm templates
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. CVE-2017-5754
  10. There is no need for \n\t in front of CC_SET(), as the macro already includes these two.
  11. Signed-off-by: Uros Bizjak <[email protected]>
  12. Cc: Linus Torvalds <[email protected]>
  13. Cc: Peter Zijlstra <[email protected]>
  14. Cc: Thomas Gleixner <[email protected]>
  15. Link: http://lkml.kernel.org/r/[email protected]
  16. Signed-off-by: Ingo Molnar <[email protected]>
  17. (backported from commit 3c52b5c64326d9dcfee4e10611c53ec1b1b20675)
  18. Signed-off-by: Andy Whitcroft <[email protected]>
  19. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  20. (cherry picked from commit 1c3f29ec5586e3aecfde2c6f83b8786e1aecd9ac)
  21. Signed-off-by: Fabian Grünbichler <[email protected]>
  22. ---
  23. arch/x86/include/asm/archrandom.h | 8 ++++----
  24. arch/x86/include/asm/bitops.h | 10 +++++-----
  25. arch/x86/include/asm/percpu.h | 2 +-
  26. arch/x86/include/asm/rmwcc.h | 2 +-
  27. 4 files changed, 11 insertions(+), 11 deletions(-)
  28. diff --git a/arch/x86/include/asm/archrandom.h b/arch/x86/include/asm/archrandom.h
  29. index 5b0579abb398..3ac991d81e74 100644
  30. --- a/arch/x86/include/asm/archrandom.h
  31. +++ b/arch/x86/include/asm/archrandom.h
  32. @@ -45,7 +45,7 @@ static inline bool rdrand_long(unsigned long *v)
  33. bool ok;
  34. unsigned int retry = RDRAND_RETRY_LOOPS;
  35. do {
  36. - asm volatile(RDRAND_LONG "\n\t"
  37. + asm volatile(RDRAND_LONG
  38. CC_SET(c)
  39. : CC_OUT(c) (ok), "=a" (*v));
  40. if (ok)
  41. @@ -59,7 +59,7 @@ static inline bool rdrand_int(unsigned int *v)
  42. bool ok;
  43. unsigned int retry = RDRAND_RETRY_LOOPS;
  44. do {
  45. - asm volatile(RDRAND_INT "\n\t"
  46. + asm volatile(RDRAND_INT
  47. CC_SET(c)
  48. : CC_OUT(c) (ok), "=a" (*v));
  49. if (ok)
  50. @@ -71,7 +71,7 @@ static inline bool rdrand_int(unsigned int *v)
  51. static inline bool rdseed_long(unsigned long *v)
  52. {
  53. bool ok;
  54. - asm volatile(RDSEED_LONG "\n\t"
  55. + asm volatile(RDSEED_LONG
  56. CC_SET(c)
  57. : CC_OUT(c) (ok), "=a" (*v));
  58. return ok;
  59. @@ -80,7 +80,7 @@ static inline bool rdseed_long(unsigned long *v)
  60. static inline bool rdseed_int(unsigned int *v)
  61. {
  62. bool ok;
  63. - asm volatile(RDSEED_INT "\n\t"
  64. + asm volatile(RDSEED_INT
  65. CC_SET(c)
  66. : CC_OUT(c) (ok), "=a" (*v));
  67. return ok;
  68. diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
  69. index 854022772c5b..8cee8db6dffb 100644
  70. --- a/arch/x86/include/asm/bitops.h
  71. +++ b/arch/x86/include/asm/bitops.h
  72. @@ -142,7 +142,7 @@ static __always_inline void __clear_bit(long nr, volatile unsigned long *addr)
  73. static __always_inline bool clear_bit_unlock_is_negative_byte(long nr, volatile unsigned long *addr)
  74. {
  75. bool negative;
  76. - asm volatile(LOCK_PREFIX "andb %2,%1\n\t"
  77. + asm volatile(LOCK_PREFIX "andb %2,%1"
  78. CC_SET(s)
  79. : CC_OUT(s) (negative), ADDR
  80. : "ir" ((char) ~(1 << nr)) : "memory");
  81. @@ -245,7 +245,7 @@ static __always_inline bool __test_and_set_bit(long nr, volatile unsigned long *
  82. {
  83. bool oldbit;
  84. - asm("bts %2,%1\n\t"
  85. + asm("bts %2,%1"
  86. CC_SET(c)
  87. : CC_OUT(c) (oldbit), ADDR
  88. : "Ir" (nr));
  89. @@ -285,7 +285,7 @@ static __always_inline bool __test_and_clear_bit(long nr, volatile unsigned long
  90. {
  91. bool oldbit;
  92. - asm volatile("btr %2,%1\n\t"
  93. + asm volatile("btr %2,%1"
  94. CC_SET(c)
  95. : CC_OUT(c) (oldbit), ADDR
  96. : "Ir" (nr));
  97. @@ -297,7 +297,7 @@ static __always_inline bool __test_and_change_bit(long nr, volatile unsigned lon
  98. {
  99. bool oldbit;
  100. - asm volatile("btc %2,%1\n\t"
  101. + asm volatile("btc %2,%1"
  102. CC_SET(c)
  103. : CC_OUT(c) (oldbit), ADDR
  104. : "Ir" (nr) : "memory");
  105. @@ -328,7 +328,7 @@ static __always_inline bool variable_test_bit(long nr, volatile const unsigned l
  106. {
  107. bool oldbit;
  108. - asm volatile("bt %2,%1\n\t"
  109. + asm volatile("bt %2,%1"
  110. CC_SET(c)
  111. : CC_OUT(c) (oldbit)
  112. : "m" (*(unsigned long *)addr), "Ir" (nr));
  113. diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
  114. index 9fa03604b2b3..b21a475fd7ed 100644
  115. --- a/arch/x86/include/asm/percpu.h
  116. +++ b/arch/x86/include/asm/percpu.h
  117. @@ -525,7 +525,7 @@ static inline bool x86_this_cpu_variable_test_bit(int nr,
  118. {
  119. bool oldbit;
  120. - asm volatile("bt "__percpu_arg(2)",%1\n\t"
  121. + asm volatile("bt "__percpu_arg(2)",%1"
  122. CC_SET(c)
  123. : CC_OUT(c) (oldbit)
  124. : "m" (*(unsigned long __percpu *)addr), "Ir" (nr));
  125. diff --git a/arch/x86/include/asm/rmwcc.h b/arch/x86/include/asm/rmwcc.h
  126. index 661dd305694a..dd7ba5aa8dca 100644
  127. --- a/arch/x86/include/asm/rmwcc.h
  128. +++ b/arch/x86/include/asm/rmwcc.h
  129. @@ -28,7 +28,7 @@ cc_label: \
  130. #define __GEN_RMWcc(fullop, var, cc, ...) \
  131. do { \
  132. bool c; \
  133. - asm volatile (fullop ";" CC_SET(cc) \
  134. + asm volatile (fullop CC_SET(cc) \
  135. : "+m" (var), CC_OUT(cc) (c) \
  136. : __VA_ARGS__ : "memory"); \
  137. return c; \
  138. --
  139. 2.14.2