summaryrefslogtreecommitdiff
path: root/include/asm-x86/tlbflush.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-16 11:17:19 +0200
committerIngo Molnar <mingo@elte.hu>2008-06-16 11:17:19 +0200
commited9e4996d9a123b7550e63713d563f524fa9d9f0 (patch)
treea9be05d357b407aac80118b86f25d21a5dbdfc88 /include/asm-x86/tlbflush.h
parent4d2df795f0c3eb91f97a666f47716121a2f166ed (diff)
parent066519068ad2fbe98c7f45552b1f592903a9c8c8 (diff)
Merge branch 'linus' into tracing/sysproftip-tracing-sysprof-2008-06-16_09.17_Mon
Diffstat (limited to 'include/asm-x86/tlbflush.h')
-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)
static inline void __native_flush_tlb_global(void)
{
- unsigned long cr4 = read_cr4();
+ unsigned long flags;
+ unsigned long cr4;
+ /*
+ * Read-modify-write to CR4 - protect it from preemption and
+ * from interrupts. (Use the raw variant because this code can
+ * be called from deep inside debugging code.)
+ */
+ raw_local_irq_save(flags);
+
+ cr4 = read_cr4();
/* clear PGE */
write_cr4(cr4 & ~X86_CR4_PGE);
/* write old PGE again and flush TLBs */
write_cr4(cr4);
+
+ raw_local_irq_restore(flags);
}
static inline void __native_flush_tlb_single(unsigned long addr)