Fixes booting Linux guest 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.
Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
/* 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)) )
{