On March 17, 2016 11:31pm, <[email protected]> wrote: > On Thu, Mar 17, 2016 at 6:54 AM, Quan Xu <[email protected]> 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 <[email protected]> > > > > CC: Jun Nakajima <[email protected]> > > CC: Kevin Tian <[email protected]> > > CC: George Dunlap <[email protected]> > > CC: Keir Fraser <[email protected]> > > CC: Jan Beulich <[email protected]> > > CC: Andrew Cooper <[email protected]> > > CC: Suravee Suthikulpanit <[email protected]> > > CC: Stefano Stabellini <[email protected]> > > CC: Julien Grall <[email protected]> > > CC: Feng Wu <[email protected]> > > CC: Dario Faggioli <[email protected]> > > --- > > 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?
I think it is _not_. I have gone through the altp2m design/design discussion. It looks Xen _can_ have altp2m and passthrough enabled at the same time. Also you can refer to http://lists.xenproject.org/archives/html/xen-devel/2015-01/msg01963.html Andrew, could you help me double check it? > > 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. > I think it _can_, and let's wait for the above check first. Quan _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
