From: "Jan Beulich" Subject: Re: [PATCH 09/12] xen: only map PV guest grants via iommu if HAS_PASSTHROUGH Date: Fri, 20 Jan 2012 12:38:50 +0000 Message-ID: <4F196E6A020000780006DF19@nat28.tlf.novell.com> References: <1327061025.30054.21.camel@zakaz.uk.xensource.com> <1327061198-29854-9-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1327061198-29854-9-git-send-email-ian.campbell@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org >>> On 20.01.12 at 13:06, Ian Campbell wrote: > Signed-off-by: Ian Campbell > --- > 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) ) Wouldn't #define-ing need_iommu() to 0 in the ARM headers achieve the same effect, without cluttering common code? Jan > { > 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@lists.xensource.com > http://lists.xensource.com/xen-devel