From: "Jan Beulich" Subject: Re: [RFC for-4.5 06/12] xen/passthrough: rework dom0_pvh_reqs to use it also on ARM Date: Mon, 10 Feb 2014 08:07:10 +0000 Message-ID: <52F896BE020000780011A995@nat28.tlf.novell.com> References: <1391794991-5919-1-git-send-email-julien.grall@linaro.org> <1391794991-5919-7-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.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WCltc-0001wH-HX for xen-devel@lists.xenproject.org; Mon, 10 Feb 2014 08:07:16 +0000 In-Reply-To: <1391794991-5919-7-git-send-email-julien.grall@linaro.org> Content-Disposition: inline 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: ian.campbell@citrix.com, patches@linaro.org, tim@xen.org, stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org, Xiantao Zhang List-Id: xen-devel@lists.xenproject.org >>> On 07.02.14 at 18:43, Julien Grall wrote: > DOM0 on ARM will have the same requirements as DOM0 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 commit message. s/commit/panic/ ? > > Signed-off-by: Julien Grall > Cc: Xiantao Zhang Other than the above, Acked-by: Jan Beulich > --- > xen/drivers/passthrough/iommu.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > > diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c > index 19b0e23..26a5d91 100644 > --- a/xen/drivers/passthrough/iommu.c > +++ b/xen/drivers/passthrough/iommu.c > @@ -130,13 +130,18 @@ int iommu_domain_init(struct domain *d) > return hd->platform_ops->init(d); > } > > -static __init void check_dom0_pvh_reqs(struct domain *d) > +static __init void check_dom0_reqs(struct domain *d) > { > + if ( !paging_mode_translate(d) ) > + return; > + > if ( !iommu_enabled ) > - panic("Presently, iommu must be enabled for pvh dom0\n"); > + panic("Presently, iommu must be enabled to use dom0 with translate > " > + "paging mode\n"); > > if ( iommu_passthrough ) > - panic("For pvh dom0, dom0-passthrough must not be enabled\n"); > + panic("Dom0 uses translate paging mode, dom0-passthrough must not be > " > + "enabled\n"); > > iommu_dom0_strict = 1; > } > @@ -145,8 +150,7 @@ void __init iommu_dom0_init(struct domain *d) > { > struct hvm_iommu *hd = domain_hvm_iommu(d); > > - if ( is_pvh_domain(d) ) > - check_dom0_pvh_reqs(d); > + check_dom0_reqs(d); > > if ( !iommu_enabled ) > return; > -- > 1.7.10.4