diff options
-rw-r--r-- | arch/x86/kernel/paravirt.c | 1 | ||||
-rw-r--r-- | arch/x86/xen/enlighten.c | 1 | ||||
-rw-r--r-- | drivers/lguest/lg.h | 1 | ||||
-rw-r--r-- | include/asm-x86/page.h | 1 | ||||
-rw-r--r-- | include/asm-x86/paravirt.h | 15 | ||||
-rw-r--r-- | include/asm-x86/pgtable.h | 16 |
6 files changed, 26 insertions, 9 deletions
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 74f0c5ea2a03..c98d54688180 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c | |||
@@ -403,6 +403,7 @@ struct pv_mmu_ops pv_mmu_ops = { | |||
403 | #endif /* PAGETABLE_LEVELS >= 3 */ | 403 | #endif /* PAGETABLE_LEVELS >= 3 */ |
404 | 404 | ||
405 | .pte_val = native_pte_val, | 405 | .pte_val = native_pte_val, |
406 | .pte_flags = native_pte_val, | ||
406 | .pgd_val = native_pgd_val, | 407 | .pgd_val = native_pgd_val, |
407 | 408 | ||
408 | .make_pte = native_make_pte, | 409 | .make_pte = native_make_pte, |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 4a372b71239d..1b4b5fa498b3 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1101,6 +1101,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = { | |||
1101 | .set_pmd = xen_set_pmd, | 1101 | .set_pmd = xen_set_pmd, |
1102 | 1102 | ||
1103 | .pte_val = xen_pte_val, | 1103 | .pte_val = xen_pte_val, |
1104 | .pte_flags = native_pte_val, | ||
1104 | .pgd_val = xen_pgd_val, | 1105 | .pgd_val = xen_pgd_val, |
1105 | 1106 | ||
1106 | .make_pte = xen_make_pte, | 1107 | .make_pte = xen_make_pte, |
diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h index 005bd045d2eb..5faefeaf6790 100644 --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h | |||
@@ -136,7 +136,6 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user); | |||
136 | * first step in the migration to the kernel types. pte_pfn is already defined | 136 | * first step in the migration to the kernel types. pte_pfn is already defined |
137 | * in the kernel. */ | 137 | * in the kernel. */ |
138 | #define pgd_flags(x) (pgd_val(x) & ~PAGE_MASK) | 138 | #define pgd_flags(x) (pgd_val(x) & ~PAGE_MASK) |
139 | #define pte_flags(x) (pte_val(x) & ~PAGE_MASK) | ||
140 | #define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT) | 139 | #define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT) |
141 | 140 | ||
142 | /* interrupts_and_traps.c: */ | 141 | /* interrupts_and_traps.c: */ |
diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h index dc936dddf161..a1e2b9470f25 100644 --- a/include/asm-x86/page.h +++ b/include/asm-x86/page.h | |||
@@ -160,6 +160,7 @@ static inline pteval_t native_pte_val(pte_t pte) | |||
160 | #endif | 160 | #endif |
161 | 161 | ||
162 | #define pte_val(x) native_pte_val(x) | 162 | #define pte_val(x) native_pte_val(x) |
163 | #define pte_flags(x) native_pte_val(x) | ||
163 | #define __pte(x) native_make_pte(x) | 164 | #define __pte(x) native_make_pte(x) |
164 | 165 | ||
165 | #endif /* CONFIG_PARAVIRT */ | 166 | #endif /* CONFIG_PARAVIRT */ |
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h index 0f13b945e240..5ea37a48eecb 100644 --- a/include/asm-x86/paravirt.h +++ b/include/asm-x86/paravirt.h | |||
@@ -239,6 +239,7 @@ struct pv_mmu_ops { | |||
239 | unsigned long addr, pte_t *ptep); | 239 | unsigned long addr, pte_t *ptep); |
240 | 240 | ||
241 | pteval_t (*pte_val)(pte_t); | 241 | pteval_t (*pte_val)(pte_t); |
242 | pteval_t (*pte_flags)(pte_t); | ||
242 | pte_t (*make_pte)(pteval_t pte); | 243 | pte_t (*make_pte)(pteval_t pte); |
243 | 244 | ||
244 | pgdval_t (*pgd_val)(pgd_t); | 245 | pgdval_t (*pgd_val)(pgd_t); |
@@ -996,6 +997,20 @@ static inline pteval_t pte_val(pte_t pte) | |||
996 | return ret; | 997 | return ret; |
997 | } | 998 | } |
998 | 999 | ||
1000 | static inline pteval_t pte_flags(pte_t pte) | ||
1001 | { | ||
1002 | pteval_t ret; | ||
1003 | |||
1004 | if (sizeof(pteval_t) > sizeof(long)) | ||
1005 | ret = PVOP_CALL2(pteval_t, pv_mmu_ops.pte_flags, | ||
1006 | pte.pte, (u64)pte.pte >> 32); | ||
1007 | else | ||
1008 | ret = PVOP_CALL1(pteval_t, pv_mmu_ops.pte_flags, | ||
1009 | pte.pte); | ||
1010 | |||
1011 | return ret; | ||
1012 | } | ||
1013 | |||
999 | static inline pgd_t __pgd(pgdval_t val) | 1014 | static inline pgd_t __pgd(pgdval_t val) |
1000 | { | 1015 | { |
1001 | pgdval_t ret; | 1016 | pgdval_t ret; |
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h index 97c271b2910b..47a852cb8c92 100644 --- a/include/asm-x86/pgtable.h +++ b/include/asm-x86/pgtable.h | |||
@@ -164,37 +164,37 @@ extern struct list_head pgd_list; | |||
164 | */ | 164 | */ |
165 | static inline int pte_dirty(pte_t pte) | 165 | static inline int pte_dirty(pte_t pte) |
166 | { | 166 | { |
167 | return pte_val(pte) & _PAGE_DIRTY; | 167 | return pte_flags(pte) & _PAGE_DIRTY; |
168 | } | 168 | } |
169 | 169 | ||
170 | static inline int pte_young(pte_t pte) | 170 | static inline int pte_young(pte_t pte) |
171 | { | 171 | { |
172 | return pte_val(pte) & _PAGE_ACCESSED; | 172 | return pte_flags(pte) & _PAGE_ACCESSED; |
173 | } | 173 | } |
174 | 174 | ||
175 | static inline int pte_write(pte_t pte) | 175 | static inline int pte_write(pte_t pte) |
176 | { | 176 | { |
177 | return pte_val(pte) & _PAGE_RW; | 177 | return pte_flags(pte) & _PAGE_RW; |
178 | } | 178 | } |
179 | 179 | ||
180 | static inline int pte_file(pte_t pte) | 180 | static inline int pte_file(pte_t pte) |
181 | { | 181 | { |
182 | return pte_val(pte) & _PAGE_FILE; | 182 | return pte_flags(pte) & _PAGE_FILE; |
183 | } | 183 | } |
184 | 184 | ||
185 | static inline int pte_huge(pte_t pte) | 185 | static inline int pte_huge(pte_t pte) |
186 | { | 186 | { |
187 | return pte_val(pte) & _PAGE_PSE; | 187 | return pte_flags(pte) & _PAGE_PSE; |
188 | } | 188 | } |
189 | 189 | ||
190 | static inline int pte_global(pte_t pte) | 190 | static inline int pte_global(pte_t pte) |
191 | { | 191 | { |
192 | return pte_val(pte) & _PAGE_GLOBAL; | 192 | return pte_flags(pte) & _PAGE_GLOBAL; |
193 | } | 193 | } |
194 | 194 | ||
195 | static inline int pte_exec(pte_t pte) | 195 | static inline int pte_exec(pte_t pte) |
196 | { | 196 | { |
197 | return !(pte_val(pte) & _PAGE_NX); | 197 | return !(pte_flags(pte) & _PAGE_NX); |
198 | } | 198 | } |
199 | 199 | ||
200 | static inline int pte_special(pte_t pte) | 200 | static inline int pte_special(pte_t pte) |
@@ -305,7 +305,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) | |||
305 | return __pgprot(preservebits | addbits); | 305 | return __pgprot(preservebits | addbits); |
306 | } | 306 | } |
307 | 307 | ||
308 | #define pte_pgprot(x) __pgprot(pte_val(x) & ~PTE_MASK) | 308 | #define pte_pgprot(x) __pgprot(pte_flags(x) & ~PTE_MASK) |
309 | 309 | ||
310 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) | 310 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) |
311 | 311 | ||