]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/x86/lib/tsc_timer.c
x86: Add a 'pause' instruction in __udelay() for QEMU target
[karo-tx-uboot.git] / arch / x86 / lib / tsc_timer.c
index 7f5ba2ca6f1dd69f2d461723fec4536fc92a4523..0df1af238c1d654e59d9b09c555c363cb2196943 100644 (file)
@@ -355,7 +355,15 @@ void __udelay(unsigned long usec)
        stop = now + usec * get_tbclk_mhz();
 
        while ((int64_t)(stop - get_ticks()) > 0)
+#if defined(CONFIG_QEMU) && defined(CONFIG_SMP)
+               /*
+                * Add a 'pause' instruction on qemu target,
+                * to give other VCPUs a chance to run.
+                */
+               asm volatile("pause");
+#else
                ;
+#endif
 }
 
 int timer_init(void)