Skip to contentSkip to conversation

x86, idle: add barriers to CLFLUSH workaround

PATCH New Jan Beulich 1 participant 1 message Sep 8, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86, idle: add barriers to CLFLUSH workaround

... since the documentation is explicit that CLFLUSH is only ordered with respect to MFENCE.

xen/arch/x86/acpi/cpu_idle.c +4 -0
@@ -346,7 +346,11 @@ void mwait_idle_with_hints(unsigned int 
     s_time_t expires = per_cpu(timer_deadline, cpu);
 
     if ( boot_cpu_has(X86_FEATURE_CLFLUSH_MONITOR) )
+    {
+        mb();
         clflush((void *)&mwait_wakeup(cpu));
+        mb();
+    }
 
     __monitor((void *)&mwait_wakeup(cpu), 0, 0);
     smp_mb();

x86, idle: add barriers to CLFLUSH workaround

... since the documentation is explicit that CLFLUSH is only ordered with respect to MFENCE.

xen/arch/x86/acpi/cpu_idle.c +4 -0
@@ -346,7 +346,11 @@ void mwait_idle_with_hints(unsigned int 
     s_time_t expires = per_cpu(timer_deadline, cpu);
 
     if ( boot_cpu_has(X86_FEATURE_CLFLUSH_MONITOR) )
+    {
+        mb();
         clflush((void *)&mwait_wakeup(cpu));
+        mb();
+    }
 
     __monitor((void *)&mwait_wakeup(cpu), 0, 0);
     smp_mb();

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel