[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2] x86/vtd: fix IOMMU share PT destruction path

On Tue, Oct 09, 2018 at 03:57:08PM +0100, Wei Liu wrote:
> 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 either already switched to or has
> always been in disabled state, and the shared PT test would always be
> false.
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

This is fine (and will fix destroying HVM/PVH guests), but I would
still like deallocate_iommu_page_tables (from pci_amd_iommu.c) to be
fixed in order to avoid the usage of iommu_use_hap_pt there also.

IMO the check itself could be converted into
ASSERT(!iommu_hap_pt_share) since it's unlikely that AMD will have
support for share page tables anytime soon.

Thanks, Roger.

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.