Skip to content

Commit

Permalink
x86/tlbflush.h: Define __native_flush_tlb_global_irq_disabled()
Browse files Browse the repository at this point in the history
This function is called in __native_flush_tlb_global() and after
apply_microcode_early().

Signed-off-by: Fenghua Yu <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: H. Peter Anvin <[email protected]>
  • Loading branch information
fyu1 authored and H. Peter Anvin committed Jan 31, 2013
1 parent e666dfa commit 086fc8f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions arch/x86/include/asm/tlbflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,20 @@ static inline void __native_flush_tlb(void)
native_write_cr3(native_read_cr3());
}

static inline void __native_flush_tlb_global_irq_disabled(void)
{
unsigned long cr4;

cr4 = native_read_cr4();
/* clear PGE */
native_write_cr4(cr4 & ~X86_CR4_PGE);
/* write old PGE again and flush TLBs */
native_write_cr4(cr4);
}

static inline void __native_flush_tlb_global(void)
{
unsigned long flags;
unsigned long cr4;

/*
* Read-modify-write to CR4 - protect it from preemption and
Expand All @@ -32,11 +42,7 @@ static inline void __native_flush_tlb_global(void)
*/
raw_local_irq_save(flags);

cr4 = native_read_cr4();
/* clear PGE */
native_write_cr4(cr4 & ~X86_CR4_PGE);
/* write old PGE again and flush TLBs */
native_write_cr4(cr4);
__native_flush_tlb_global_irq_disabled();

raw_local_irq_restore(flags);
}
Expand Down

0 comments on commit 086fc8f

Please sign in to comment.