aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-24 13:20:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-24 13:20:00 -0400
commiteb90d81d03c0917b0fd629f6342554a3b58ea52c (patch)
tree4e12232420fa4111937ccd079675ea495d248538 /include
parentd3c5f8b93febadf62da9a4b39a2dca8e66a4da40 (diff)
parentb1979a5fda7869a790f4fd83fb06c78498d26ba1 (diff)
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-tip: x86: prevent PGE flush from interruption/preemption x86: use explicit copy in vdso_gettimeofday() namespacecheck: automated fixes x86/xen: fix arbitrary_virt_to_machine() x86: don't read maxlvt before checking if APIC is mapped x86: disable TSC for sched_clock() when calibration failed x86: distangle user disabled TSC from unstable x86: fix setup of cyc2ns in tsc_64.c
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/tlbflush.h13
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
23static inline void __native_flush_tlb_global(void) 23static 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
33static inline void __native_flush_tlb_single(unsigned long addr) 44static inline void __native_flush_tlb_single(unsigned long addr)