x86/cpu: Add workaround for MONITOR instruction erratum on Goldmont based CPUs
[linux-block.git] / arch / x86 / include / asm / mwait.h
index 0deeb2d26df7cd7510e831d04d4f80ed297acaf0..f37f2d8a2989d08d37304ffd4689a381cc0ddb37 100644 (file)
@@ -97,7 +97,7 @@ static inline void __sti_mwait(unsigned long eax, unsigned long ecx)
  */
 static inline void mwait_idle_with_hints(unsigned long eax, unsigned long ecx)
 {
-       if (!current_set_polling_and_test()) {
+       if (static_cpu_has_bug(X86_BUG_MONITOR) || !current_set_polling_and_test()) {
                if (static_cpu_has_bug(X86_BUG_CLFLUSH_MONITOR)) {
                        mb();
                        clflush((void *)&current_thread_info()->flags);