diff options
Diffstat (limited to 'include/asm-x86/processor.h')
-rw-r--r-- | include/asm-x86/processor.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h index 79338fe965d2..d2bf5fe8f4ff 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h | |||
@@ -729,6 +729,29 @@ extern unsigned long boot_option_idle_override; | |||
729 | extern unsigned long idle_halt; | 729 | extern unsigned long idle_halt; |
730 | extern unsigned long idle_nomwait; | 730 | extern unsigned long idle_nomwait; |
731 | 731 | ||
732 | /* | ||
733 | * on systems with caches, caches must be flashed as the absolute | ||
734 | * last instruction before going into a suspended halt. Otherwise, | ||
735 | * dirty data can linger in the cache and become stale on resume, | ||
736 | * leading to strange errors. | ||
737 | * | ||
738 | * perform a variety of operations to guarantee that the compiler | ||
739 | * will not reorder instructions. wbinvd itself is serializing | ||
740 | * so the processor will not reorder. | ||
741 | * | ||
742 | * Systems without cache can just go into halt. | ||
743 | */ | ||
744 | static inline void wbinvd_halt(void) | ||
745 | { | ||
746 | mb(); | ||
747 | /* check for clflush to determine if wbinvd is legal */ | ||
748 | if (cpu_has_clflush) | ||
749 | asm volatile("cli; wbinvd; 1: hlt; jmp 1b" : : : "memory"); | ||
750 | else | ||
751 | while (1) | ||
752 | halt(); | ||
753 | } | ||
754 | |||
732 | extern void enable_sep_cpu(void); | 755 | extern void enable_sep_cpu(void); |
733 | extern int sysenter_setup(void); | 756 | extern int sysenter_setup(void); |
734 | 757 | ||