diff options
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/tlbflush.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/asm-x86/tlbflush.h b/include/asm-x86/tlbflush.h index 0c0674d94255..35c76ceb9f40 100644 --- a/include/asm-x86/tlbflush.h +++ b/include/asm-x86/tlbflush.h | |||
@@ -22,12 +22,23 @@ static inline void __native_flush_tlb(void) | |||
22 | 22 | ||
23 | static inline void __native_flush_tlb_global(void) | 23 | static inline void __native_flush_tlb_global(void) |
24 | { | 24 | { |
25 | unsigned long cr4 = read_cr4(); | 25 | unsigned long flags; |
26 | unsigned long cr4; | ||
26 | 27 | ||
28 | /* | ||
29 | * Read-modify-write to CR4 - protect it from preemption and | ||
30 | * from interrupts. (Use the raw variant because this code can | ||
31 | * be called from deep inside debugging code.) | ||
32 | */ | ||
33 | raw_local_irq_save(flags); | ||
34 | |||
35 | cr4 = read_cr4(); | ||
27 | /* clear PGE */ | 36 | /* clear PGE */ |
28 | write_cr4(cr4 & ~X86_CR4_PGE); | 37 | write_cr4(cr4 & ~X86_CR4_PGE); |
29 | /* write old PGE again and flush TLBs */ | 38 | /* write old PGE again and flush TLBs */ |
30 | write_cr4(cr4); | 39 | write_cr4(cr4); |
40 | |||
41 | raw_local_irq_restore(flags); | ||
31 | } | 42 | } |
32 | 43 | ||
33 | static inline void __native_flush_tlb_single(unsigned long addr) | 44 | static inline void __native_flush_tlb_single(unsigned long addr) |