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

[Xen-devel] [PATCH v2 04/11] grant_table: avoid unnecessary work during grant table unmapping



While grant table is unmapping, the domain (with the exception of the
hardware domain) may be crashed due to IOMMU mapping and unmapping
failures, and then it is unnecessary to flush specified CPUs' TLBs.

Signed-off-by: Quan Xu <quan.xu@xxxxxxxxx>

CC: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CC: Jan Beulich <jbeulich@xxxxxxxx>
CC: Keir Fraser <keir@xxxxxxx>
CC: Tim Deegan <tim@xxxxxxx>
---
 xen/common/grant_table.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 8b22299..1801fe9 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1366,8 +1366,9 @@ gnttab_unmap_grant_ref(
      
     return 0;
 
-fault:
-    gnttab_flush_tlb(current->domain);
+ fault:
+    if ( current->domain->is_shut_down )
+        gnttab_flush_tlb(current->domain);
 
     for ( i = 0; i < partial_done; i++ )
         __gnttab_unmap_common_complete(&(common[i]));
@@ -1429,8 +1430,9 @@ gnttab_unmap_and_replace(
 
     return 0;
 
-fault:
-    gnttab_flush_tlb(current->domain);
+ fault:
+    if ( current->domain->is_shut_down )
+        gnttab_flush_tlb(current->domain);
 
     for ( i = 0; i < partial_done; i++ )
         __gnttab_unmap_common_complete(&(common[i]));
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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