All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH] VT-d: dma_pte_clear_one() can't fail anymore
@ 2020-01-07 11:56 Jan Beulich
  2020-01-19  3:17 ` Tian, Kevin
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2020-01-07 11:56 UTC (permalink / raw)
  To: xen-devel; +Cc: Kevin Tian

Hence it's pointless for it to return an error indicator, and it's even
less useful for it to be __must_check. This is a result of commit
e8afe1124cc1 ("iommu: elide flushing for higher order map/unmap
operations") moving the TLB flushing out of the function.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -608,13 +608,12 @@ static int __must_check iommu_flush_iotl
 }
 
 /* clear one page's page table */
-static int __must_check dma_pte_clear_one(struct domain *domain, u64 addr,
-                                          unsigned int *flush_flags)
+static void dma_pte_clear_one(struct domain *domain, uint64_t addr,
+                              unsigned int *flush_flags)
 {
     struct domain_iommu *hd = dom_iommu(domain);
     struct dma_pte *page = NULL, *pte = NULL;
     u64 pg_maddr;
-    int rc = 0;
 
     spin_lock(&hd->arch.mapping_lock);
     /* get last level pte */
@@ -622,7 +621,7 @@ static int __must_check dma_pte_clear_on
     if ( pg_maddr == 0 )
     {
         spin_unlock(&hd->arch.mapping_lock);
-        return 0;
+        return;
     }
 
     page = (struct dma_pte *)map_vtd_domain_page(pg_maddr);
@@ -632,7 +631,7 @@ static int __must_check dma_pte_clear_on
     {
         spin_unlock(&hd->arch.mapping_lock);
         unmap_vtd_domain_page(page);
-        return 0;
+        return;
     }
 
     dma_clear_pte(*pte);
@@ -642,8 +641,6 @@ static int __must_check dma_pte_clear_on
     iommu_flush_cache_entry(pte, sizeof(struct dma_pte));
 
     unmap_vtd_domain_page(page);
-
-    return rc;
 }
 
 static void iommu_free_pagetable(u64 pt_maddr, int level)
@@ -1802,7 +1799,9 @@ static int __must_check intel_iommu_unma
     if ( iommu_hwdom_passthrough && is_hardware_domain(d) )
         return 0;
 
-    return dma_pte_clear_one(d, dfn_to_daddr(dfn), flush_flags);
+    dma_pte_clear_one(d, dfn_to_daddr(dfn), flush_flags);
+
+    return 0;
 }
 
 static int intel_iommu_lookup_page(struct domain *d, dfn_t dfn, mfn_t *mfn,

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Xen-devel] [PATCH] VT-d: dma_pte_clear_one() can't fail anymore
  2020-01-07 11:56 [Xen-devel] [PATCH] VT-d: dma_pte_clear_one() can't fail anymore Jan Beulich
@ 2020-01-19  3:17 ` Tian, Kevin
  0 siblings, 0 replies; 2+ messages in thread
From: Tian, Kevin @ 2020-01-19  3:17 UTC (permalink / raw)
  To: Jan Beulich, xen-devel

> From: Jan Beulich <jbeulich@suse.com>
> Sent: Tuesday, January 7, 2020 7:56 PM
> 
> Hence it's pointless for it to return an error indicator, and it's even
> less useful for it to be __must_check. This is a result of commit
> e8afe1124cc1 ("iommu: elide flushing for higher order map/unmap
> operations") moving the TLB flushing out of the function.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-19  3:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 11:56 [Xen-devel] [PATCH] VT-d: dma_pte_clear_one() can't fail anymore Jan Beulich
2020-01-19  3:17 ` Tian, Kevin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.