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 58a76f69ee31..c63a47651890 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h | |||
@@ -693,6 +693,29 @@ extern unsigned long boot_option_idle_override; | |||
693 | extern unsigned long idle_halt; | 693 | extern unsigned long idle_halt; |
694 | extern unsigned long idle_nomwait; | 694 | extern unsigned long idle_nomwait; |
695 | 695 | ||
696 | /* | ||
697 | * on systems with caches, caches must be flashed as the absolute | ||
698 | * last instruction before going into a suspended halt. Otherwise, | ||
699 | * dirty data can linger in the cache and become stale on resume, | ||
700 | * leading to strange errors. | ||
701 | * | ||
702 | * perform a variety of operations to guarantee that the compiler | ||
703 | * will not reorder instructions. wbinvd itself is serializing | ||
704 | * so the processor will not reorder. | ||
705 | * | ||
706 | * Systems without cache can just go into halt. | ||
707 | */ | ||
708 | static inline void wbinvd_halt(void) | ||
709 | { | ||
710 | mb(); | ||
711 | /* check for clflush to determine if wbinvd is legal */ | ||
712 | if (cpu_has_clflush) | ||
713 | asm volatile("cli; wbinvd; 1: hlt; jmp 1b" : : : "memory"); | ||
714 | else | ||
715 | while (1) | ||
716 | halt(); | ||
717 | } | ||
718 | |||
696 | extern void enable_sep_cpu(void); | 719 | extern void enable_sep_cpu(void); |
697 | extern int sysenter_setup(void); | 720 | extern int sysenter_setup(void); |
698 | 721 | ||