diff options
Diffstat (limited to 'include/asm-i386/tlbflush.h')
-rw-r--r-- | include/asm-i386/tlbflush.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/include/asm-i386/tlbflush.h b/include/asm-i386/tlbflush.h index 360648b0f2b3..4dd82840d53b 100644 --- a/include/asm-i386/tlbflush.h +++ b/include/asm-i386/tlbflush.h | |||
@@ -4,7 +4,15 @@ | |||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | #include <asm/processor.h> | 5 | #include <asm/processor.h> |
6 | 6 | ||
7 | #define __flush_tlb() \ | 7 | #ifdef CONFIG_PARAVIRT |
8 | #include <asm/paravirt.h> | ||
9 | #else | ||
10 | #define __flush_tlb() __native_flush_tlb() | ||
11 | #define __flush_tlb_global() __native_flush_tlb_global() | ||
12 | #define __flush_tlb_single(addr) __native_flush_tlb_single(addr) | ||
13 | #endif | ||
14 | |||
15 | #define __native_flush_tlb() \ | ||
8 | do { \ | 16 | do { \ |
9 | unsigned int tmpreg; \ | 17 | unsigned int tmpreg; \ |
10 | \ | 18 | \ |
@@ -19,7 +27,7 @@ | |||
19 | * Global pages have to be flushed a bit differently. Not a real | 27 | * Global pages have to be flushed a bit differently. Not a real |
20 | * performance problem because this does not happen often. | 28 | * performance problem because this does not happen often. |
21 | */ | 29 | */ |
22 | #define __flush_tlb_global() \ | 30 | #define __native_flush_tlb_global() \ |
23 | do { \ | 31 | do { \ |
24 | unsigned int tmpreg, cr4, cr4_orig; \ | 32 | unsigned int tmpreg, cr4, cr4_orig; \ |
25 | \ | 33 | \ |
@@ -36,6 +44,9 @@ | |||
36 | : "memory"); \ | 44 | : "memory"); \ |
37 | } while (0) | 45 | } while (0) |
38 | 46 | ||
47 | #define __native_flush_tlb_single(addr) \ | ||
48 | __asm__ __volatile__("invlpg (%0)" ::"r" (addr) : "memory") | ||
49 | |||
39 | # define __flush_tlb_all() \ | 50 | # define __flush_tlb_all() \ |
40 | do { \ | 51 | do { \ |
41 | if (cpu_has_pge) \ | 52 | if (cpu_has_pge) \ |
@@ -46,9 +57,6 @@ | |||
46 | 57 | ||
47 | #define cpu_has_invlpg (boot_cpu_data.x86 > 3) | 58 | #define cpu_has_invlpg (boot_cpu_data.x86 > 3) |
48 | 59 | ||
49 | #define __flush_tlb_single(addr) \ | ||
50 | __asm__ __volatile__("invlpg (%0)" ::"r" (addr) : "memory") | ||
51 | |||
52 | #ifdef CONFIG_X86_INVLPG | 60 | #ifdef CONFIG_X86_INVLPG |
53 | # define __flush_tlb_one(addr) __flush_tlb_single(addr) | 61 | # define __flush_tlb_one(addr) __flush_tlb_single(addr) |
54 | #else | 62 | #else |