On Tue, Oct 09, 2018 at 12:22:34PM +0100, Paul Durrant wrote: > > -----Original Message----- > > From: Wei Liu [mailto:wei.l...@citrix.com] > > Sent: 09 October 2018 11:42 > > To: xen-devel@lists.xenproject.org > > Cc: Jan Beulich <jbeul...@suse.com>; Roger Pau Monne > > <roger....@citrix.com>; Paul Durrant <paul.durr...@citrix.com>; Wei Liu > > <wei.l...@citrix.com>; Kevin Tian <kevin.t...@intel.com> > > Subject: [PATCH] x86/vtd: fix IOMMU share PT destruction path > > > > Commit 2916951c1 ("mm / iommu: include need_iommu() test in > > iommu_use_hap_pt()") included need_iommu() in iommu_use_hap_pt and > > 91d4eca7add (" mm / iommu: split need_iommu() into has_iommu_pt() and > > need_iommu_pt_sync()") made things finer grain by spliting need_iommu > > into three states. > > > > The destruction path can't use iommu_use_hap_pt because at the point > > platform op is called, IOMMU is already switched to disabled state and > > the shared PT test would always be false. > > > > This is VT-d specific and the issue could affect AMD too. Can't you just > switch round the call to teardown and setting IOMMU_status_disabled in > xen/drivers/passthrough/iommu.c:iommu_teardown()?
AMD doesn't support shared page tables so far, but in order to avoid having to debug this again if AMD ever gains support for shared page tables I think switching the order in iommu_teardown might be better. Thanks, Roger. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel