From patchwork Sun Feb 23 22:16:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 25156 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1CDAF20143 for ; Sun, 23 Feb 2014 22:18:40 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id o6sf3141164oag.6 for ; Sun, 23 Feb 2014 14:18:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=cmeqQz6E9gs8He/01V5OHrKxjhf1wiZNTz2UH9fbdoU=; b=WA+n7wxBXcyl2AVOaSr4cBWVaGiqta9juGAn5lIhQi76/3PRC/xJMuyxxlPQtCdB8M vTmtEIsd3R31SsKFJo6xgOY9zNQ1Nb5Nni6Q95xvSfKW096h4x3arXuoUwcaLzQmOCwO nHRaPtJ6ws+y2OhXIBZfjw/Cte6j5JV0fGTcEhTMXC0WueC85YmmQug8/zgH5QrDVEqG Ev8X411O2+ae0tkcXKZI3SYgdHw7vS/+Zfs0/XI8ki++RryuEvcLJdApnFf1EGTyd+za AcDhnWdt+EkLAm7ABLjlBMvhYFA35lEmbPLhdhBRHyfaMiEMvG0m3shfiiVi2bLg13dC R/BA== X-Gm-Message-State: ALoCoQmECtcr4dDeIyiWyKONYV3Fl3+FGsUrP69SNhsvFEeM4qmYYvAvMSjuOhdaz8u7qlruUkJA X-Received: by 10.182.17.69 with SMTP id m5mr7829586obd.6.1393193919609; Sun, 23 Feb 2014 14:18:39 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.195 with SMTP id 61ls1782231qgv.19.gmail; Sun, 23 Feb 2014 14:18:39 -0800 (PST) X-Received: by 10.220.11.141 with SMTP id t13mr10796204vct.30.1393193919493; Sun, 23 Feb 2014 14:18:39 -0800 (PST) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id yv5si5294189veb.140.2014.02.23.14.18.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Feb 2014 14:18:39 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.172 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.172; Received: by mail-ve0-f172.google.com with SMTP id jz11so3262843veb.17 for ; Sun, 23 Feb 2014 14:18:39 -0800 (PST) X-Received: by 10.52.23.68 with SMTP id k4mr9049991vdf.24.1393193919419; Sun, 23 Feb 2014 14:18:39 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp20497vcz; Sun, 23 Feb 2014 14:18:39 -0800 (PST) X-Received: by 10.52.246.42 with SMTP id xt10mr8965307vdc.9.1393193919045; Sun, 23 Feb 2014 14:18:39 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id xn5si5286838vdc.107.2014.02.23.14.18.38 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 23 Feb 2014 14:18:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WHhLt-0006rN-Fz; Sun, 23 Feb 2014 22:16:49 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WHhLs-0006qb-EV for xen-devel@lists.xenproject.org; Sun, 23 Feb 2014 22:16:48 +0000 Received: from [85.158.137.68:23240] by server-6.bemta-3.messagelabs.com id 31/D2-09180-F437A035; Sun, 23 Feb 2014 22:16:47 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-4.tower-31.messagelabs.com!1393193806!2427400!1 X-Originating-IP: [74.125.83.49] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.9.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 24872 invoked from network); 23 Feb 2014 22:16:46 -0000 Received: from mail-ee0-f49.google.com (HELO mail-ee0-f49.google.com) (74.125.83.49) by server-4.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 23 Feb 2014 22:16:46 -0000 Received: by mail-ee0-f49.google.com with SMTP id d17so2747429eek.8 for ; Sun, 23 Feb 2014 14:16:46 -0800 (PST) X-Received: by 10.15.21.2 with SMTP id c2mr21063501eeu.77.1393193806441; Sun, 23 Feb 2014 14:16:46 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id g1sm55994749eet.6.2014.02.23.14.16.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Feb 2014 14:16:45 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Sun, 23 Feb 2014 22:16:24 +0000 Message-Id: <1393193792-20008-8-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1393193792-20008-1-git-send-email-julien.grall@linaro.org> References: <1393193792-20008-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com, Xiantao Zhang Subject: [Xen-devel] [PATCH v2 07/15] xen/passthrough: iommu: Don't need to map dom0 page when the PT is shared X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.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.172 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Currently iommu_init_dom0 is browsing the page list and call map_page callback on each page. On both AMD and VTD drivers, the function will directly return if the page table is shared with the processor. So Xen can safely avoid to run through the page list. Signed-off-by: Julien Grall Acked-by: Ian Campbell Acked-by: Jan Beulich Cc: Xiantao Zhang --- xen/drivers/passthrough/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index b534893..3c63f87 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -156,7 +156,7 @@ void __init iommu_dom0_init(struct domain *d) register_keyhandler('o', &iommu_p2m_table); d->need_iommu = !!iommu_dom0_strict; - if ( need_iommu(d) ) + if ( need_iommu(d) && !iommu_use_hap_pt(d) ) { struct page_info *page; unsigned int i = 0;