summaryrefslogtreecommitdiff
path: root/include/asm-x86/tlbflush.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-16 11:15:58 +0200
committerIngo Molnar <mingo@elte.hu>2008-06-16 11:15:58 +0200
commite765ee90da62535ac7d7a97f2464f9646539d683 (patch)
tree7a9cecce5aab958938e9a3bf46c2302d6af1958c /include/asm-x86/tlbflush.h
parenta4500b84c51645bbc86be3ca84f2252b7ada060f (diff)
parent066519068ad2fbe98c7f45552b1f592903a9c8c8 (diff)
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)