aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/paravirt.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-05-26 18:31:06 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-27 04:11:36 -0400
commita15af1c9ea2750a9ff01e51615c45950bad8221b (patch)
treeb4167c16c23365d016180b20248c724902e0c954 /include/asm-x86/paravirt.h
parent239d1fc04ed0b58d638096b12a7f6d50269d30c9 (diff)
x86/paravirt: add pte_flags to just get pte flags
Add pte_flags() to extract the flags from a pte. This is a special case of pte_val() which is only guaranteed to return the pte's flags correctly; the page number may be corrupted or missing. The intent is to allow paravirt implementations to return pte flags without having to do any translation of the page number (most notably, Xen). Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/paravirt.h')
-rw-r--r--include/asm-x86/paravirt.h15
1 files changed, 15 insertions, 0 deletions
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
1000static 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
999static inline pgd_t __pgd(pgdval_t val) 1014static inline pgd_t __pgd(pgdval_t val)
1000{ 1015{
1001 pgdval_t ret; 1016 pgdval_t ret;