diff options
| author | Fenghua Yu <fenghua.yu@intel.com> | 2012-12-21 02:44:27 -0500 |
|---|---|---|
| committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-01-31 16:19:16 -0500 |
| commit | 086fc8f8037bf16f55f82c66b26a8b834f7349ec (patch) | |
| tree | 5c47967e99e712eb8c4e5c0d88a455c3823e1763 | |
| parent | e666dfa273db1b12711eaec91facac5fec2ec851 (diff) | |
x86/tlbflush.h: Define __native_flush_tlb_global_irq_disabled()
This function is called in __native_flush_tlb_global() and after
apply_microcode_early().
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Link: http://lkml.kernel.org/r/1356075872-3054-8-git-send-email-fenghua.yu@intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| -rw-r--r-- | arch/x86/include/asm/tlbflush.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h index 0fee48e279cc..50a7fc0f824a 100644 --- a/arch/x86/include/asm/tlbflush.h +++ b/arch/x86/include/asm/tlbflush.h | |||
| @@ -20,10 +20,20 @@ static inline void __native_flush_tlb(void) | |||
| 20 | native_write_cr3(native_read_cr3()); | 20 | native_write_cr3(native_read_cr3()); |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | static inline void __native_flush_tlb_global_irq_disabled(void) | ||
| 24 | { | ||
| 25 | unsigned long cr4; | ||
| 26 | |||
| 27 | cr4 = native_read_cr4(); | ||
| 28 | /* clear PGE */ | ||
| 29 | native_write_cr4(cr4 & ~X86_CR4_PGE); | ||
| 30 | /* write old PGE again and flush TLBs */ | ||
| 31 | native_write_cr4(cr4); | ||
| 32 | } | ||
| 33 | |||
| 23 | static inline void __native_flush_tlb_global(void) | 34 | static inline void __native_flush_tlb_global(void) |
| 24 | { | 35 | { |
| 25 | unsigned long flags; | 36 | unsigned long flags; |
| 26 | unsigned long cr4; | ||
| 27 | 37 | ||
| 28 | /* | 38 | /* |
| 29 | * Read-modify-write to CR4 - protect it from preemption and | 39 | * Read-modify-write to CR4 - protect it from preemption and |
| @@ -32,11 +42,7 @@ static inline void __native_flush_tlb_global(void) | |||
| 32 | */ | 42 | */ |
| 33 | raw_local_irq_save(flags); | 43 | raw_local_irq_save(flags); |
| 34 | 44 | ||
| 35 | cr4 = native_read_cr4(); | 45 | __native_flush_tlb_global_irq_disabled(); |
| 36 | /* clear PGE */ | ||
| 37 | native_write_cr4(cr4 & ~X86_CR4_PGE); | ||
| 38 | /* write old PGE again and flush TLBs */ | ||
| 39 | native_write_cr4(cr4); | ||
| 40 | 46 | ||
| 41 | raw_local_irq_restore(flags); | 47 | raw_local_irq_restore(flags); |
| 42 | } | 48 | } |
