aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/xen/mmu.c')
-rw-r--r--arch/x86/xen/mmu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 1e56ff583459..63146c378f1e 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -2038,7 +2038,8 @@ static unsigned long __init xen_read_phys_ulong(phys_addr_t addr)
2038 2038
2039/* 2039/*
2040 * Translate a virtual address to a physical one without relying on mapped 2040 * Translate a virtual address to a physical one without relying on mapped
2041 * page tables. 2041 * page tables. Don't rely on big pages being aligned in (guest) physical
2042 * space!
2042 */ 2043 */
2043static phys_addr_t __init xen_early_virt_to_phys(unsigned long vaddr) 2044static phys_addr_t __init xen_early_virt_to_phys(unsigned long vaddr)
2044{ 2045{
@@ -2059,7 +2060,7 @@ static phys_addr_t __init xen_early_virt_to_phys(unsigned long vaddr)
2059 sizeof(pud))); 2060 sizeof(pud)));
2060 if (!pud_present(pud)) 2061 if (!pud_present(pud))
2061 return 0; 2062 return 0;
2062 pa = pud_pfn(pud) << PAGE_SHIFT; 2063 pa = pud_val(pud) & PTE_PFN_MASK;
2063 if (pud_large(pud)) 2064 if (pud_large(pud))
2064 return pa + (vaddr & ~PUD_MASK); 2065 return pa + (vaddr & ~PUD_MASK);
2065 2066
@@ -2067,7 +2068,7 @@ static phys_addr_t __init xen_early_virt_to_phys(unsigned long vaddr)
2067 sizeof(pmd))); 2068 sizeof(pmd)));
2068 if (!pmd_present(pmd)) 2069 if (!pmd_present(pmd))
2069 return 0; 2070 return 0;
2070 pa = pmd_pfn(pmd) << PAGE_SHIFT; 2071 pa = pmd_val(pmd) & PTE_PFN_MASK;
2071 if (pmd_large(pmd)) 2072 if (pmd_large(pmd))
2072 return pa + (vaddr & ~PMD_MASK); 2073 return pa + (vaddr & ~PMD_MASK);
2073 2074