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:52:19 +0000 Message-ID: <4F197193020000780006DF4A@nat28.tlf.novell.com> References: <1327061025.30054.21.camel@zakaz.uk.xensource.com> <1327061198-29854-9-git-send-email-ian.campbell@citrix.com> <4F196E6A020000780006DF19@nat28.tlf.novell.com> <1327063220.30054.33.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1327063220.30054.33.camel@zakaz.uk.xensource.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:40, Ian Campbell wrote: > On Fri, 2012-01-20 at 12:38 +0000, Jan Beulich wrote: >> >>> 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? > > Yes. I'd thought there were other uses of need_iommu but in fact they > are all in x86. And even if there were, you'd want them to resolve to 0 too until you have an IOMMU implementation. Jan