From patchwork Fri Feb 7 17:43:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 24305 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 09DCF2096A for ; Fri, 7 Feb 2014 17:43:36 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id hu8sf8242373vcb.10 for ; Fri, 07 Feb 2014 09:43:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=8uuD56yJ6jVMO1mJIExIBghOj9y/PWZbg3OQmNKoTWY=; b=I8X0GiwORYmUYp3fMRoAbImjFRPRqnKxyQNos+4Zkw5aNkx0DCYiiZvkdD5GvrRol0 Sm0BJtqb4559a92tMGcAlH49HT9jYfPpCFmVIt5yk+Z7mXSyscM4Cypg/7T0D2LsGakS 58WjsBKJSG9u/7LfhIe+LfNwaHnsdRNeHDjbWjJVTLnjJZ0U5flh8DMDZQs2P3Pn1yad BFructLJYaf0SMdfDzac3NC3DZVxZIk3c8Dem3CLXy2TMdwyS5oH/VUuHbI++57SUK+O sWna3JnphL7QqzOf8YzDSD25V4/vrs5EnSpBXoiE+oewLEV9ylP/gI1+YtaieG7joyQd 4uPA== X-Gm-Message-State: ALoCoQkMTz+zvocDQ+d093JueZuzaZyXJGJO+BPbRwvS5/W1UYht7q0NFdt5mQW6cnDAahCfc6/d X-Received: by 10.236.13.36 with SMTP id a24mr5717733yha.50.1391795016111; Fri, 07 Feb 2014 09:43:36 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.8 with SMTP id c8ls1231010qgc.56.gmail; Fri, 07 Feb 2014 09:43:36 -0800 (PST) X-Received: by 10.58.252.8 with SMTP id zo8mr31604vec.55.1391795016022; Fri, 07 Feb 2014 09:43:36 -0800 (PST) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id fv9si1543523vcb.95.2014.02.07.09.43.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 09:43:36 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id c14so3019364vea.34 for ; Fri, 07 Feb 2014 09:43:35 -0800 (PST) X-Received: by 10.58.249.228 with SMTP id yx4mr72858vec.50.1391795015953; Fri, 07 Feb 2014 09:43:35 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp123595vcz; Fri, 7 Feb 2014 09:43:35 -0800 (PST) X-Received: by 10.15.41.14 with SMTP id r14mr5738146eev.78.1391795012702; Fri, 07 Feb 2014 09:43:32 -0800 (PST) Received: from mail-ea0-f170.google.com (mail-ea0-f170.google.com [209.85.215.170]) by mx.google.com with ESMTPS id 43si9511994eeh.220.2014.02.07.09.43.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 09:43:32 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.170 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.170; Received: by mail-ea0-f170.google.com with SMTP id k10so1734020eaj.1 for ; Fri, 07 Feb 2014 09:43:32 -0800 (PST) X-Received: by 10.14.204.9 with SMTP id g9mr5628656eeo.82.1391795012158; Fri, 07 Feb 2014 09:43:32 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id 8sm18849063eef.1.2014.02.07.09.43.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Feb 2014 09:43:31 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: patches@linaro.org, ian.campbell@citrix.com, tim@xen.org, stefano.stabellini@citrix.com, Julien Grall , Xiantao Zhang , Jan Beulich Subject: [RFC for-4.5 06/12] xen/passthrough: rework dom0_pvh_reqs to use it also on ARM Date: Fri, 7 Feb 2014 17:43:05 +0000 Message-Id: <1391794991-5919-7-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391794991-5919-1-git-send-email-julien.grall@linaro.org> References: <1391794991-5919-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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. Signed-off-by: Julien Grall Cc: Xiantao Zhang Cc: 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;