diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-01-30 07:32:58 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:58 -0500 |
commit | 4891645e764d2e181b834509a689fcd12e890c10 (patch) | |
tree | f347227c2d5a5b112bca8fe76b149ccc5157ef84 /include/asm-x86/paravirt.h | |
parent | 8405b122ad0dd75354b3bfed4de9a96514fd40cb (diff) |
x86: unify paravirt pagetable accessors
Put all the defines for mapping pagetable operations to their native
versions (for the non-paravirt case) into one place. Make the
corresponding changes to paravirt.h.
The tricky part here is that when a pagetable entry can't be updated
atomically (ie, 32-bit PAE), we need special handlers for pte_clear,
set_pte_atomic and set_pte_present. However, the other two modes
don't need special handling for these, and can use a common
set_pte(_at) path.
[ mingo@elte.hu: fixes ]
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/paravirt.h')
-rw-r--r-- | include/asm-x86/paravirt.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h index 24385decbd47..4aa06b929e48 100644 --- a/include/asm-x86/paravirt.h +++ b/include/asm-x86/paravirt.h | |||
@@ -1039,6 +1039,27 @@ static inline void set_pmd(pmd_t *pmdp, pmd_t pmdval) | |||
1039 | { | 1039 | { |
1040 | PVOP_VCALL2(pv_mmu_ops.set_pmd, pmdp, pmdval.pud.pgd.pgd); | 1040 | PVOP_VCALL2(pv_mmu_ops.set_pmd, pmdp, pmdval.pud.pgd.pgd); |
1041 | } | 1041 | } |
1042 | |||
1043 | static inline void pmd_clear(pmd_t *pmdp) | ||
1044 | { | ||
1045 | set_pmd(pmdp, __pmd(0)); | ||
1046 | } | ||
1047 | |||
1048 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | ||
1049 | { | ||
1050 | set_pte_at(mm, addr, ptep, __pte(0)); | ||
1051 | } | ||
1052 | |||
1053 | static inline void set_pte_atomic(pte_t *ptep, pte_t pte) | ||
1054 | { | ||
1055 | set_pte(ptep, pte); | ||
1056 | } | ||
1057 | |||
1058 | static inline void set_pte_present(struct mm_struct *mm, unsigned long addr, | ||
1059 | pte_t *ptep, pte_t pte) | ||
1060 | { | ||
1061 | set_pte(ptep, pte); | ||
1062 | } | ||
1042 | #endif /* CONFIG_X86_PAE */ | 1063 | #endif /* CONFIG_X86_PAE */ |
1043 | 1064 | ||
1044 | /* Lazy mode for batching updates / context switch */ | 1065 | /* Lazy mode for batching updates / context switch */ |