valid_mfn() cannot be used here as MMIO pages are always above max_mem.
Also added sanity checking for type == p2m_mmio_direct before clearing
page table entry. This should fix both VT-d and SR-IOV issues reported
recently as there are no SR-IOV specific code in Xen. As far as Xen
is concern, SR-IOV virtual function is just another PCI device.
Signed-off-by: Allen Kay allen.m.kay@intel.com
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
return 0;
mfn = gfn_to_mfn(p2m, gfn, &t);
- if ( !mfn_valid(mfn) )
+
+ /* Do not use mfn_valid() here as MMIO pages are always above max_page */
+ if ( (INVALID_MFN == mfn_x(mfn)) || (t != p2m_mmio_direct) )
{
gdprintk(XENLOG_ERR,
"clear_mmio_p2m_entry: gfn_to_mfn failed! gfn=%08lx\n", gfn);