1 #ifndef _ASM_X86_TLBFLUSH_H
2 #define _ASM_X86_TLBFLUSH_H
5 #include <linux/sched.h>
7 #include <asm/processor.h>
8 #include <asm/special_insns.h>
10 #ifdef CONFIG_PARAVIRT
11 #include <asm/paravirt.h>
13 #define __flush_tlb() __native_flush_tlb()
14 #define __flush_tlb_global() __native_flush_tlb_global()
15 #define __flush_tlb_single(addr) __native_flush_tlb_single(addr)
18 static inline void __native_flush_tlb(
void)
20 native_write_cr3(native_read_cr3());
23 static inline void __native_flush_tlb_global(
void)
35 cr4 = native_read_cr4();
39 native_write_cr4(cr4);
44 static inline void __native_flush_tlb_single(
unsigned long addr)
46 asm volatile(
"invlpg (%0)" ::
"r" (
addr) :
"memory");
65 #define TLB_FLUSH_ALL -1UL
84 #define flush_tlb() __flush_tlb()
85 #define flush_tlb_all() __flush_tlb_all()
86 #define local_flush_tlb() __flush_tlb()
102 unsigned long start,
unsigned long end)
109 unsigned long start,
unsigned long end,
unsigned long vmflag)
122 static inline void reset_lazy_tlbstate(
void)
136 #define local_flush_tlb() __flush_tlb()
138 #define flush_tlb_mm(mm) flush_tlb_mm_range(mm, 0UL, TLB_FLUSH_ALL, 0UL)
140 #define flush_tlb_range(vma, start, end) \
141 flush_tlb_mm_range(vma->vm_mm, start, end, vma->vm_flags)
147 unsigned long end,
unsigned long vmflag);
150 #define flush_tlb() flush_tlb_current_task()
154 unsigned long start,
unsigned long end);
156 #define TLBSTATE_OK 1
157 #define TLBSTATE_LAZY 2
165 static inline void reset_lazy_tlbstate(
void)
173 #ifndef CONFIG_PARAVIRT
174 #define flush_tlb_others(mask, mm, start, end) \
175 native_flush_tlb_others(mask, mm, start, end)