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

[Xen-devel] [PATCH 6/7] vtd: change lookup_page failure semantics



Commit 43d1622b "vtd: add lookup_page method to iommu_ops" added a
lookup method in to the VT-d IOMMU implementation. In some cases (such as
when shared EPT is in operation) that function simply passes back an
identity MFN (i.e. an MFN with the same value as the DFN that was passed
in), but this doesn't actually make a lot of sense. If, for instance,
shared EPT is used then really the function should be doing a P2M lookup
since DFN space will be identical to GFN space.

In practice there are no current callers of the lookup_page method and,
when PV-IOMMU support is added, the method will not be called if either
shared EPT is in operation or iommu_passthrough is set, so this patch
simply fails the method with -EOPNOTSUPP in those cases.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
Cc: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/drivers/passthrough/vtd/iommu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c 
b/xen/drivers/passthrough/vtd/iommu.c
index 79ecd15e49..1e861b696d 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1853,10 +1853,7 @@ static int intel_iommu_lookup_page(struct domain *d, 
dfn_t dfn, mfn_t *mfn,
      */
     if ( iommu_use_hap_pt(d) ||
          (iommu_hwdom_passthrough && is_hardware_domain(d)) )
-    {
-        *mfn = _mfn(dfn_x(dfn));
-        return 0;
-    }
+        return -EOPNOTSUPP;
 
     spin_lock(&hd->arch.mapping_lock);
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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