diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2011-02-18 06:32:40 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2011-03-19 14:58:25 -0400 |
commit | 14988a4d350ce3b41ecad4f63c4f44c56f5ae34d (patch) | |
tree | 25ee7d584ab8f4d707dfdf484928195f8c655b28 /arch/x86 | |
parent | e5f15b45ddf3afa2bbbb10c7ea34fb32b6de0a0e (diff) |
xen: set max_pfn_mapped to the last pfn mapped
Do not set max_pfn_mapped to the end of the initial memory mappings,
that also contain pages that don't belong in pfn space (like the mfn
list).
Set max_pfn_mapped to the last real pfn mapped in the initial memory
mappings that is the pfn backing _end.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
LKML-Reference: <alpine.DEB.2.00.1103171739050.3382@kaball-desktop>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/xen/mmu.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index a2d78ad35a55..6e27979506c1 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1701,9 +1701,6 @@ static __init void xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn) | |||
1701 | for (pteidx = 0; pteidx < PTRS_PER_PTE; pteidx++, pfn++) { | 1701 | for (pteidx = 0; pteidx < PTRS_PER_PTE; pteidx++, pfn++) { |
1702 | pte_t pte; | 1702 | pte_t pte; |
1703 | 1703 | ||
1704 | if (pfn > max_pfn_mapped) | ||
1705 | max_pfn_mapped = pfn; | ||
1706 | |||
1707 | if (!pte_none(pte_page[pteidx])) | 1704 | if (!pte_none(pte_page[pteidx])) |
1708 | continue; | 1705 | continue; |
1709 | 1706 | ||
@@ -1761,6 +1758,12 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, | |||
1761 | pud_t *l3; | 1758 | pud_t *l3; |
1762 | pmd_t *l2; | 1759 | pmd_t *l2; |
1763 | 1760 | ||
1761 | /* max_pfn_mapped is the last pfn mapped in the initial memory | ||
1762 | * mappings. Considering that on Xen after the kernel mappings we | ||
1763 | * have the mappings of some pages that don't exist in pfn space, we | ||
1764 | * set max_pfn_mapped to the last real pfn mapped. */ | ||
1765 | max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->mfn_list)); | ||
1766 | |||
1764 | /* Zap identity mapping */ | 1767 | /* Zap identity mapping */ |
1765 | init_level4_pgt[0] = __pgd(0); | 1768 | init_level4_pgt[0] = __pgd(0); |
1766 | 1769 | ||
@@ -1865,9 +1868,7 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, | |||
1865 | initial_kernel_pmd = | 1868 | initial_kernel_pmd = |
1866 | extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE); | 1869 | extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE); |
1867 | 1870 | ||
1868 | max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) + | 1871 | max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->mfn_list)); |
1869 | xen_start_info->nr_pt_frames * PAGE_SIZE + | ||
1870 | 512*1024); | ||
1871 | 1872 | ||
1872 | kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd); | 1873 | kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd); |
1873 | memcpy(initial_kernel_pmd, kernel_pmd, sizeof(pmd_t) * PTRS_PER_PMD); | 1874 | memcpy(initial_kernel_pmd, kernel_pmd, sizeof(pmd_t) * PTRS_PER_PMD); |