From patchwork Thu Jul 31 15:00:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 34670 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7AE6120540 for ; Thu, 31 Jul 2014 15:02:54 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id m15sf1816196wgh.8 for ; Thu, 31 Jul 2014 08:02:52 -0700 (PDT) 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=E/BaEeOgQlCg/Sn6KXblePtzIqj4Y8nrlD8r+5DCsww=; b=L/TK076CMz35NZnMCLgLBwmB5wXwFUQx6MiMpSKF2XhjC8fZsycICQouv0mfLljYE7 InVaPvD07ij+CnzSTgzzYON6bHH+6QjVIoKGUx4NKAndf7xQiF3nTvezaQVOIEKVzs+G mhRC+y9nr3NaWOcjyXqhMRLt4/vSj5+XdQeJ+a9le4faIwHl1WcyZSVAIyd0E0jVAMus ZRKAr3d8UdtMjuHsWYlIK0qYItddUZI37NBMEFUBMoIbzELlh+WN1tSkYfm7OWygsV7E CklfoeNzGjwd1ihDOt/YtbIRs5qNm3sFHhGefhXSzfiIEgYlv8ROM6ryonFulpcGK/xl B0sg== X-Gm-Message-State: ALoCoQmRaRDMVSkdotqme3tKRHxcqqq3kMLXYLyb4jeCKyxIAojbU0Ou7RNXy5OiuvQ2pZzzkOXn X-Received: by 10.181.9.65 with SMTP id dq1mr1257511wid.7.1406818971537; Thu, 31 Jul 2014 08:02:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.80 with SMTP id o74ls900264qgd.48.gmail; Thu, 31 Jul 2014 08:02:51 -0700 (PDT) X-Received: by 10.220.160.67 with SMTP id m3mr11947743vcx.56.1406818971383; Thu, 31 Jul 2014 08:02:51 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id a10si4607256vcl.90.2014.07.31.08.02.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 31 Jul 2014 08:02:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id la4so4449724vcb.33 for ; Thu, 31 Jul 2014 08:02:51 -0700 (PDT) X-Received: by 10.220.97.5 with SMTP id j5mr13425873vcn.16.1406818971193; Thu, 31 Jul 2014 08:02:51 -0700 (PDT) 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.221.37.5 with SMTP id tc5csp25110vcb; Thu, 31 Jul 2014 08:02:50 -0700 (PDT) X-Received: by 10.50.66.197 with SMTP id h5mr44448659igt.34.1406818970583; Thu, 31 Jul 2014 08:02:50 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id gb7si14936001igd.0.2014.07.31.08.02.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 31 Jul 2014 08:02:50 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) 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 1XCrrA-0000m3-Ac; Thu, 31 Jul 2014 15:01:24 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XCrr8-0000jW-Ty for xen-devel@lists.xenproject.org; Thu, 31 Jul 2014 15:01:23 +0000 Received: from [85.158.143.35:23882] by server-2.bemta-4.messagelabs.com id 50/3A-04525-24A5AD35; Thu, 31 Jul 2014 15:01:22 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-7.tower-21.messagelabs.com!1406818881!12705354!1 X-Originating-IP: [209.85.212.180] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18534 invoked from network); 31 Jul 2014 15:01:21 -0000 Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com) (209.85.212.180) by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 31 Jul 2014 15:01:21 -0000 Received: by mail-wi0-f180.google.com with SMTP id n3so4267354wiv.13 for ; Thu, 31 Jul 2014 08:01:21 -0700 (PDT) X-Received: by 10.180.9.38 with SMTP id w6mr17562924wia.61.1406818881243; Thu, 31 Jul 2014 08:01:21 -0700 (PDT) Received: from belegaer.uk.xensource.com ([185.25.64.249]) by mx.google.com with ESMTPSA id r20sm67128337wik.0.2014.07.31.08.01.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jul 2014 08:01:20 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 31 Jul 2014 16:00:46 +0100 Message-Id: <1406818852-31856-16-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1406818852-31856-1-git-send-email-julien.grall@linaro.org> References: <1406818852-31856-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com, Jan Beulich Subject: [Xen-devel] [PATCH v2 15/21] xen/passthrough: Call arch_iommu_domain_destroy before calling iommu_teardown 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) 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: arch_iommu_domain_destroy contains specific architecture code. On x86, this code will clean up the ioport_list which is not used in both iommu (i.e AMD & x86) drivers. On ARM, the toolstack may not have deassign every device to the guest. Therefore, we have to go through the device list and removing them before asking the IOMMU drivers to release memory for this domain. This is done by iommu_dt_domain_destroy which is called by arch_iommu_domain_destroy. Signed-off-by: Julien Grall Cc: Jan Beulich --- I didn't change this patch as I wasn't sure what was the conclusion of the discussion on the RFC --- xen/drivers/passthrough/iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index 65479d6..2953ede 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -219,10 +219,10 @@ void iommu_domain_destroy(struct domain *d) if ( !iommu_enabled || !hd->platform_ops ) return; + arch_iommu_domain_destroy(d); + if ( need_iommu(d) ) iommu_teardown(d); - - arch_iommu_domain_destroy(d); } int iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,