aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/xen/mmu.c')
-rw-r--r--arch/x86/xen/mmu.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 9b43bb398d37..4c63b7f452dd 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -745,7 +745,20 @@ static pteval_t pte_pfn_to_mfn(pteval_t val)
745 if (val & _PAGE_PRESENT) { 745 if (val & _PAGE_PRESENT) {
746 unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; 746 unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT;
747 pteval_t flags = val & PTE_FLAGS_MASK; 747 pteval_t flags = val & PTE_FLAGS_MASK;
748 val = ((pteval_t)pfn_to_mfn(pfn) << PAGE_SHIFT) | flags; 748 unsigned long mfn = pfn_to_mfn(pfn);
749
750 /*
751 * If there's no mfn for the pfn, then just create an
752 * empty non-present pte. Unfortunately this loses
753 * information about the original pfn, so
754 * pte_mfn_to_pfn is asymmetric.
755 */
756 if (unlikely(mfn == INVALID_P2M_ENTRY)) {
757 mfn = 0;
758 flags = 0;
759 }
760
761 val = ((pteval_t)mfn << PAGE_SHIFT) | flags;
749 } 762 }
750 763
751 return val; 764 return val;