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

[Xen-devel] [PATCH 09/12] xen: only map PV guest grants via iommu if HAS_PASSTHROUGH



Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 xen/Rules.mk             |    1 +
 xen/arch/arm/dummy.S     |    2 --
 xen/common/grant_table.c |    6 ++++++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index e25e8d4..ce88316 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -52,6 +52,7 @@ CFLAGS-$(perfc_arrays)  += -DPERF_ARRAYS
 CFLAGS-$(lock_profile)  += -DLOCK_PROFILE
 CFLAGS-$(HAS_ACPI)      += -DHAS_ACPI
 CFLAGS-$(HAS_TMEM)      += -DHAS_TMEM
+CFLAGS-$(HAS_PASSTHROUGH) += -DHAS_PASSTHROUGH
 CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
 
 ifneq ($(max_phys_cpus),)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 5010619..e858613 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -27,8 +27,6 @@ DUMMY(gmfn_to_mfn);
 DUMMY(gnttab_clear_flag);
 DUMMY(gnttab_mark_dirty);
 DUMMY(hypercall_create_continuation);
-DUMMY(iommu_map_page);
-DUMMY(iommu_unmap_page);
 DUMMY(is_iomem_page);
 DUMMY(max_page);
 DUMMY(node_online_map);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index b024016..1798fcd 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -434,6 +434,7 @@ static int _set_status(unsigned gt_version,
         return _set_status_v2(domid, readonly, mapflag, shah, act, status);
 }
 
+#ifdef HAS_PASSTHROUGH
 static void mapcount(
     struct domain *ld, unsigned long mfn,
     unsigned int *wrc, unsigned int *rdc)
@@ -456,6 +457,7 @@ static void mapcount(
         rcu_unlock_domain(rd);
     }
 }
+#endif
 
 /*
  * Returns 0 if TLB flush / invalidate required by caller.
@@ -662,6 +664,7 @@ __gnttab_map_grant_ref(
         goto undo_out;
     }
 
+#ifdef HAS_PASSTHROUGH
     if ( !is_hvm_domain(ld) && need_iommu(ld) )
     {
         unsigned int wrc, rdc;
@@ -689,6 +692,7 @@ __gnttab_map_grant_ref(
             goto undo_out;
         }
     }
+#endif
 
     TRACE_1D(TRC_MEM_PAGE_GRANT_MAP, op->dom);
 
@@ -858,6 +862,7 @@ __gnttab_unmap_common(
             act->pin -= GNTPIN_hstw_inc;
     }
 
+#ifdef HAS_PASSTHROUGH
     if ( !is_hvm_domain(ld) && need_iommu(ld) )
     {
         unsigned int wrc, rdc;
@@ -874,6 +879,7 @@ __gnttab_unmap_common(
             goto unmap_out;
         }
     }
+#endif
 
     /* If just unmapped a writable mapping, mark as dirtied */
     if ( !(op->flags & GNTMAP_readonly) )
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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