aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2008-01-30 07:33:20 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:20 -0500
commit9042219cd8d43b81322b826d463dd6e52acae6cf (patch)
tree0ab4f602f36467ff21701a5aa29f840292ea108b /include
parent1fe91514a3dc07ab540bc891589c46aaa47e92f6 (diff)
x86: include/asm-x86/paravirt.h: x86_64 mmu operations
Add .set_pgd field to pv_mmu_ops. Implement pud_val(), __pud(), set_pgd(), pud_clear(), pgd_clear(). pud_clear() and pgd_clear() are implemented simply using set_pud() and set_pmd(). They don't have a field at pv_mmu_ops. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/paravirt.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index 62cecb7778ee..9f9ff57b3efb 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -259,6 +259,8 @@ struct pv_mmu_ops {
259#if PAGETABLE_LEVELS == 4 259#if PAGETABLE_LEVELS == 4
260 pudval_t (*pud_val)(pud_t); 260 pudval_t (*pud_val)(pud_t);
261 pud_t (*make_pud)(pudval_t pud); 261 pud_t (*make_pud)(pudval_t pud);
262
263 void (*set_pgd)(pgd_t *pudp, pgd_t pgdval);
262#endif /* PAGETABLE_LEVELS == 4 */ 264#endif /* PAGETABLE_LEVELS == 4 */
263#endif /* PAGETABLE_LEVELS >= 3 */ 265#endif /* PAGETABLE_LEVELS >= 3 */
264 266
@@ -1065,6 +1067,59 @@ static inline void set_pud(pud_t *pudp, pud_t pud)
1065 PVOP_VCALL2(pv_mmu_ops.set_pud, pudp, 1067 PVOP_VCALL2(pv_mmu_ops.set_pud, pudp,
1066 val); 1068 val);
1067} 1069}
1070#if PAGETABLE_LEVELS == 4
1071static inline pud_t __pud(pudval_t val)
1072{
1073 pudval_t ret;
1074
1075 if (sizeof(pudval_t) > sizeof(long))
1076 ret = PVOP_CALL2(pudval_t, pv_mmu_ops.make_pud,
1077 val, (u64)val >> 32);
1078 else
1079 ret = PVOP_CALL1(pudval_t, pv_mmu_ops.make_pud,
1080 val);
1081
1082 return (pud_t) { ret };
1083}
1084
1085static inline pudval_t pud_val(pud_t pud)
1086{
1087 pudval_t ret;
1088
1089 if (sizeof(pudval_t) > sizeof(long))
1090 ret = PVOP_CALL2(pudval_t, pv_mmu_ops.pud_val,
1091 pud.pud, (u64)pud.pud >> 32);
1092 else
1093 ret = PVOP_CALL1(pudval_t, pv_mmu_ops.pud_val,
1094 pud.pud);
1095
1096 return ret;
1097}
1098
1099static inline void set_pgd(pgd_t *pgdp, pgd_t pgd)
1100{
1101 pgdval_t val = native_pgd_val(pgd);
1102
1103 if (sizeof(pgdval_t) > sizeof(long))
1104 PVOP_VCALL3(pv_mmu_ops.set_pgd, pgdp,
1105 val, (u64)val >> 32);
1106 else
1107 PVOP_VCALL2(pv_mmu_ops.set_pgd, pgdp,
1108 val);
1109}
1110
1111static inline void pgd_clear(pgd_t *pgdp)
1112{
1113 set_pgd(pgdp, __pgd(0));
1114}
1115
1116static inline void pud_clear(pud_t *pudp)
1117{
1118 set_pud(pudp, __pud(0));
1119}
1120
1121#endif /* PAGETABLE_LEVELS == 4 */
1122
1068#endif /* PAGETABLE_LEVELS >= 3 */ 1123#endif /* PAGETABLE_LEVELS >= 3 */
1069 1124
1070#ifdef CONFIG_X86_PAE 1125#ifdef CONFIG_X86_PAE