From: Allen Kay allen.m.kay@intel.com Date: Wed, 1 Sep 2010 08:48:52 +0000 (+0100) Subject: x86 mm: revert check in clear_mmio_p2m_entry() changed in 21940:e7afe98afd43 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11558 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5cd887a6153a7e3f1af4fb7c29a7b10ccf93a51d;p=xen.git x86 mm: revert check in clear_mmio_p2m_entry() changed in 21940:e7afe98afd43 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 --- diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index 6d12ec2c2a..7c0373effe 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -2620,7 +2620,9 @@ clear_mmio_p2m_entry(struct p2m_domain *p2m, unsigned long gfn) 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);