On Thu, Mar 17, 2016 at 6:54 AM, Quan Xu <quan...@intel.com> wrote: > Current code would be panic(), when VT-d Device-TLB flush timed out. > the panic() is going to be eliminated, so we must check all kinds of > error and all the way up the call trees. > > Signed-off-by: Quan Xu <quan...@intel.com> > > CC: Jun Nakajima <jun.nakaj...@intel.com> > CC: Kevin Tian <kevin.t...@intel.com> > CC: George Dunlap <george.dun...@eu.citrix.com> > CC: Keir Fraser <k...@xen.org> > CC: Jan Beulich <jbeul...@suse.com> > CC: Andrew Cooper <andrew.coop...@citrix.com> > CC: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> > CC: Stefano Stabellini <stefano.stabell...@citrix.com> > CC: Julien Grall <julien.gr...@arm.com> > CC: Feng Wu <feng...@intel.com> > CC: Dario Faggioli <dario.faggi...@citrix.com> > --- > xen/arch/x86/mm/p2m-ept.c | 2 +- > xen/drivers/passthrough/amd/iommu_init.c | 12 ++- > xen/drivers/passthrough/amd/pci_amd_iommu.c | 2 +- > xen/drivers/passthrough/arm/smmu.c | 10 ++- > xen/drivers/passthrough/iommu.c | 17 ++-- > xen/drivers/passthrough/vtd/extern.h | 2 +- > xen/drivers/passthrough/vtd/iommu.c | 120 > ++++++++++++++++++-------- > xen/drivers/passthrough/vtd/quirks.c | 26 +++--- > xen/include/asm-x86/hvm/svm/amd-iommu-proto.h | 2 +- > xen/include/asm-x86/iommu.h | 2 +- > xen/include/xen/iommu.h | 6 +- > 11 files changed, 133 insertions(+), 68 deletions(-) > > diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c > index f9bcce7..fa6c710 100644 > --- a/xen/arch/x86/mm/p2m-ept.c > +++ b/xen/arch/x86/mm/p2m-ept.c > @@ -825,7 +825,7 @@ out: > need_modify_vtd_table ) > { > if ( iommu_hap_pt_share ) > - iommu_pte_flush(d, gfn, &ept_entry->epte, order, > vtd_pte_present); > + rc = iommu_pte_flush(d, gfn, &ept_entry->epte, order, > vtd_pte_present);
So this sort changes the meaning of the "rc" check near the end of the function, when we check whether we want to update altp2m. As it happens, I *think* it doesn't matter, because you can't have altp2m and passthrough enabled at the same time, right? If so, this at least merits a comment above the altp2m check; something like: "NB that if altp2m is enabled, rc cannot be non-zero here due to iommu_pte_flush, since you can't have altp2m and pass-through enabled at the same time." If you *can* have both altp2m and pass-through, then we need to make sure that the altp2m gets updated when the hostp2m is updated, even if the iommu flush fails. -George _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel