0177-x86-mm-Remove-superfluous-barriers.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From bf670c55337b76ab2449abe15d3fd3c11b14c013 Mon Sep 17 00:00:00 2001
  2. From: Peter Zijlstra <[email protected]>
  3. Date: Tue, 5 Dec 2017 13:34:46 +0100
  4. Subject: [PATCH 177/242] x86/mm: Remove superfluous barriers
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. CVE-2017-5754
  9. atomic64_inc_return() already implies smp_mb() before and after.
  10. Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
  11. Signed-off-by: Thomas Gleixner <[email protected]>
  12. Cc: Andy Lutomirski <[email protected]>
  13. Cc: Boris Ostrovsky <[email protected]>
  14. Cc: Borislav Petkov <[email protected]>
  15. Cc: Brian Gerst <[email protected]>
  16. Cc: Dave Hansen <[email protected]>
  17. Cc: David Laight <[email protected]>
  18. Cc: Denys Vlasenko <[email protected]>
  19. Cc: Eduardo Valentin <[email protected]>
  20. Cc: Greg KH <[email protected]>
  21. Cc: H. Peter Anvin <[email protected]>
  22. Cc: Josh Poimboeuf <[email protected]>
  23. Cc: Juergen Gross <[email protected]>
  24. Cc: Linus Torvalds <[email protected]>
  25. Cc: Peter Zijlstra <[email protected]>
  26. Cc: Will Deacon <[email protected]>
  27. Cc: [email protected]
  28. Cc: [email protected]
  29. Cc: [email protected]
  30. Cc: [email protected]
  31. Cc: [email protected]
  32. Signed-off-by: Ingo Molnar <[email protected]>
  33. (cherry picked from commit b5fc6d943808b570bdfbec80f40c6b3855f1c48b)
  34. Signed-off-by: Andy Whitcroft <[email protected]>
  35. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  36. (cherry picked from commit 31a37930df33315a7006b46706f6babdb57db1f4)
  37. Signed-off-by: Fabian Grünbichler <[email protected]>
  38. ---
  39. arch/x86/include/asm/tlbflush.h | 8 +-------
  40. 1 file changed, 1 insertion(+), 7 deletions(-)
  41. diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
  42. index 6d2688a6fda0..bc1460b4737b 100644
  43. --- a/arch/x86/include/asm/tlbflush.h
  44. +++ b/arch/x86/include/asm/tlbflush.h
  45. @@ -59,19 +59,13 @@ static inline void invpcid_flush_all_nonglobals(void)
  46. static inline u64 inc_mm_tlb_gen(struct mm_struct *mm)
  47. {
  48. - u64 new_tlb_gen;
  49. -
  50. /*
  51. * Bump the generation count. This also serves as a full barrier
  52. * that synchronizes with switch_mm(): callers are required to order
  53. * their read of mm_cpumask after their writes to the paging
  54. * structures.
  55. */
  56. - smp_mb__before_atomic();
  57. - new_tlb_gen = atomic64_inc_return(&mm->context.tlb_gen);
  58. - smp_mb__after_atomic();
  59. -
  60. - return new_tlb_gen;
  61. + return atomic64_inc_return(&mm->context.tlb_gen);
  62. }
  63. #ifdef CONFIG_PARAVIRT
  64. --
  65. 2.14.2