diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2006-12-06 20:14:08 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-12-06 20:14:08 -0500 |
commit | da181a8b3916aa7f2e3c5775d2bd2fe3454cf82d (patch) | |
tree | c5be6c957d57563b9854732df1210aad97027b03 /include/asm-i386/tlbflush.h | |
parent | 13623d79309dd82e1964458fa017979d16f33fa8 (diff) |
[PATCH] paravirt: Add MMU virtualization to paravirt_ops
Add the three bare TLB accessor functions to paravirt-ops. Most amusingly,
flush_tlb is redefined on SMP, so I can't call the paravirt op flush_tlb.
Instead, I chose to indicate the actual flush type, kernel (global) vs. user
(non-global). Global in this sense means using the global bit in the page
table entry, which makes TLB entries persistent across CR3 reloads, not
global as in the SMP sense of invoking remote shootdowns, so the term is
confusingly overloaded.
AK: folded in fix from Zach for PAE compilation
Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
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 |