From: Ian Campbell Subject: Re: [PATCH v4 11/21] xen/passthrough: rework hwdom_pvh_reqs to use it also on ARM Date: Mon, 28 Apr 2014 14:57:24 +0100 Message-ID: <1398693444.29700.117.camel@kazak.uk.xensource.com> References: <1398172475-27873-1-git-send-email-julien.grall@linaro.org> <1398172475-27873-12-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wem4F-0000Zm-BX for xen-devel@lists.xenproject.org; Mon, 28 Apr 2014 13:57:59 +0000 In-Reply-To: <1398172475-27873-12-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, Xiantao Zhang , tim@xen.org, Jan Beulich , stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Tue, 2014-04-22 at 14:14 +0100, Julien Grall wrote: > Hardware domain on ARM will have the same requirements as hwdom PVH when iommu > is enabled. Both PVH and ARM guest has paging mode translate enabled, so Xen > can use it to know if it needs to check the requirements. > > Rename the function and remove "pvh" word in the panic message. > > Signed-off-by: Julien Grall > Acked-by: Jan Beulich > Cc: Xiantao Zhang Acked-by: Ian Campbell > > --- > Changes in v4: > - Rebase on the latest staging (hwdom series was pushed) > - Remove is_phv_domain bits ... and update the next patch > (should be #7) to create in new function arch_iommu_check_dom0_reqs. > - Update printed message to be more readable > Changes in v2: > - IOMMU can be disabled on ARM if the platform doesn't have > IOMMU. > --- > xen/drivers/passthrough/iommu.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c > index 96a79ce..ccb354d 100644 > --- a/xen/drivers/passthrough/iommu.c > +++ b/xen/drivers/passthrough/iommu.c > @@ -130,13 +130,17 @@ int iommu_domain_init(struct domain *d) > return hd->platform_ops->init(d); > } > > -static void __hwdom_init check_hwdom_pvh_reqs(struct domain *d) > +static void __hwdom_init check_hwdom_reqs(struct domain *d) > { > + if ( !paging_mode_translate(d) ) > + return; > + > if ( !iommu_enabled ) > panic("Presently, iommu must be enabled for pvh dom0\n"); > > if ( iommu_passthrough ) > - panic("For pvh dom0, dom0-passthrough must not be enabled\n"); > + panic("Dom0 uses paging translated mode, dom0-passthrough must not be " > + "enabled\n"); > > iommu_dom0_strict = 1; > } > @@ -145,8 +149,7 @@ void __hwdom_init iommu_hwdom_init(struct domain *d) > { > struct hvm_iommu *hd = domain_hvm_iommu(d); > > - if ( is_pvh_domain(d) ) > - check_hwdom_pvh_reqs(d); > + check_hwdom_reqs(d); > > if ( !iommu_enabled ) > return;