aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/processor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/processor.h')
-rw-r--r--include/asm-x86/processor.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index eb4bd8c0773..61c3d3005dc 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -746,6 +746,29 @@ extern unsigned long boot_option_idle_override;
746extern unsigned long idle_halt; 746extern unsigned long idle_halt;
747extern unsigned long idle_nomwait; 747extern unsigned long idle_nomwait;
748 748
749/*
750 * on systems with caches, caches must be flashed as the absolute
751 * last instruction before going into a suspended halt. Otherwise,
752 * dirty data can linger in the cache and become stale on resume,
753 * leading to strange errors.
754 *
755 * perform a variety of operations to guarantee that the compiler
756 * will not reorder instructions. wbinvd itself is serializing
757 * so the processor will not reorder.
758 *
759 * Systems without cache can just go into halt.
760 */
761static inline void wbinvd_halt(void)
762{
763 mb();
764 /* check for clflush to determine if wbinvd is legal */
765 if (cpu_has_clflush)
766 asm volatile("cli; wbinvd; 1: hlt; jmp 1b" : : : "memory");
767 else
768 while (1)
769 halt();
770}
771
749extern void enable_sep_cpu(void); 772extern void enable_sep_cpu(void);
750extern int sysenter_setup(void); 773extern int sysenter_setup(void);
751 774