Fix the boot of Linux guest if allocated more than 4G memory. - The p2m table will track the max_mapped_pfn, and while doing p2m_gfn_to_mfn(), if the gfn is higher than max_mapped_pfn, the function will return _mfn(INVALID_MFN). This makes the Linux guest kernel panic. However when the gfn is a super page, the max_mapped_page should be (gfn + (1UL << page_order) - 1) but not gfn. Signed-off-by: Xu Dongxiao diff -r 09dd5492651c xen/arch/x86/mm/p2m.c --- a/xen/arch/x86/mm/p2m.c Mon Jun 09 17:18:27 2008 +0100 +++ b/xen/arch/x86/mm/p2m.c Fri Jun 13 09:49:52 2008 +0800 @@ -323,7 +323,7 @@ p2m_set_entry(struct domain *d, unsigned /* Track the highest gfn for which we have ever had a valid mapping */ if ( mfn_valid(mfn) && (gfn > d->arch.p2m->max_mapped_pfn) ) - d->arch.p2m->max_mapped_pfn = gfn; + d->arch.p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1; if ( iommu_enabled && (is_hvm_domain(d) || need_iommu(d)) ) {