xen: don't map missing memory

When setting up a pte for a missing pfn (no matching mfn), just create
an empty pte rather than a junk mapping.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
This commit is contained in:
Jeremy Fitzhardinge
2010-08-31 14:06:22 -07:00
parent 33a847502b
commit cfd8951e08
2 changed files with 22 additions and 2 deletions

View File

@@ -41,10 +41,17 @@ extern bool set_phys_to_machine(unsigned long pfn, unsigned long mfn);
static inline unsigned long pfn_to_mfn(unsigned long pfn)
{
unsigned long mfn;
if (xen_feature(XENFEAT_auto_translated_physmap))
return pfn;
return get_phys_to_machine(pfn) & ~FOREIGN_FRAME_BIT;
mfn = get_phys_to_machine(pfn);
if (mfn != INVALID_P2M_ENTRY)
mfn &= ~FOREIGN_FRAME_BIT;
return mfn;
}
static inline int phys_to_machine_mapping_valid(unsigned long pfn)