aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/paravirt.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-01-30 07:33:15 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:15 -0500
commit60b3f626dee9f0b1b656918e40e211822c18200d (patch)
treedc37c871dc7b18e0a2d24cbf93487fcc2b3b6678 /include/asm-x86/paravirt.h
parent4eed80cd7a1668df6ddd884f9474beccc81ef3f7 (diff)
x86/paravirt: make set_pmd operation common
Remove duplicate set_pmd()s. 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.h43
1 files changed, 20 insertions, 23 deletions
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index ba1b94334144..d9957ece49b5 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -998,6 +998,16 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
998 PVOP_VCALL4(pv_mmu_ops.set_pte_at, mm, addr, ptep, pte.pte); 998 PVOP_VCALL4(pv_mmu_ops.set_pte_at, mm, addr, ptep, pte.pte);
999} 999}
1000 1000
1001static inline void set_pmd(pmd_t *pmdp, pmd_t pmd)
1002{
1003 pmdval_t val = native_pmd_val(pmd);
1004
1005 if (sizeof(pmdval_t) > sizeof(long))
1006 PVOP_VCALL3(pv_mmu_ops.set_pmd, pmdp, val, (u64)val >> 32);
1007 else
1008 PVOP_VCALL2(pv_mmu_ops.set_pmd, pmdp, val);
1009}
1010
1001#ifdef CONFIG_X86_PAE 1011#ifdef CONFIG_X86_PAE
1002/* Special-case pte-setting operations for PAE, which can't update a 1012/* Special-case pte-setting operations for PAE, which can't update a
1003 64-bit pte atomically */ 1013 64-bit pte atomically */
@@ -1019,6 +1029,11 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
1019{ 1029{
1020 PVOP_VCALL3(pv_mmu_ops.pte_clear, mm, addr, ptep); 1030 PVOP_VCALL3(pv_mmu_ops.pte_clear, mm, addr, ptep);
1021} 1031}
1032
1033static inline void pmd_clear(pmd_t *pmdp)
1034{
1035 PVOP_VCALL1(pv_mmu_ops.pmd_clear, pmdp);
1036}
1022#else /* !CONFIG_X86_PAE */ 1037#else /* !CONFIG_X86_PAE */
1023static inline void set_pte_atomic(pte_t *ptep, pte_t pte) 1038static inline void set_pte_atomic(pte_t *ptep, pte_t pte)
1024{ 1039{
@@ -1036,6 +1051,11 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
1036{ 1051{
1037 set_pte_at(mm, addr, ptep, __pte(0)); 1052 set_pte_at(mm, addr, ptep, __pte(0));
1038} 1053}
1054
1055static inline void pmd_clear(pmd_t *pmdp)
1056{
1057 set_pmd(pmdp, __pmd(0));
1058}
1039#endif /* CONFIG_X86_PAE */ 1059#endif /* CONFIG_X86_PAE */
1040 1060
1041#if PAGETABLE_LEVELS >= 3 1061#if PAGETABLE_LEVELS >= 3
@@ -1070,35 +1090,12 @@ static inline pmdval_t pmd_val(pmd_t pmd)
1070 1090
1071#ifdef CONFIG_X86_PAE 1091#ifdef CONFIG_X86_PAE
1072 1092
1073static inline void set_pmd(pmd_t *pmdp, pmd_t pmdval)
1074{
1075 PVOP_VCALL3(pv_mmu_ops.set_pmd, pmdp,
1076 pmdval.pmd, pmdval.pmd >> 32);
1077}
1078
1079static inline void set_pud(pud_t *pudp, pud_t pudval) 1093static inline void set_pud(pud_t *pudp, pud_t pudval)
1080{ 1094{
1081 PVOP_VCALL3(pv_mmu_ops.set_pud, pudp, 1095 PVOP_VCALL3(pv_mmu_ops.set_pud, pudp,
1082 pudval.pgd.pgd, pudval.pgd.pgd >> 32); 1096 pudval.pgd.pgd, pudval.pgd.pgd >> 32);
1083} 1097}
1084 1098
1085static inline void pmd_clear(pmd_t *pmdp)
1086{
1087 PVOP_VCALL1(pv_mmu_ops.pmd_clear, pmdp);
1088}
1089
1090#else /* !CONFIG_X86_PAE */
1091
1092static inline void set_pmd(pmd_t *pmdp, pmd_t pmdval)
1093{
1094 PVOP_VCALL2(pv_mmu_ops.set_pmd, pmdp, pmdval.pud.pgd.pgd);
1095}
1096
1097static inline void pmd_clear(pmd_t *pmdp)
1098{
1099 set_pmd(pmdp, __pmd(0));
1100}
1101
1102#endif /* CONFIG_X86_PAE */ 1099#endif /* CONFIG_X86_PAE */
1103 1100
1104/* Lazy mode for batching updates / context switch */ 1101/* Lazy mode for batching updates / context switch */