From patchwork Fri May 6 08:54:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Xu X-Patchwork-Id: 9030361 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 484ABBF29F for ; Fri, 6 May 2016 09:00:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 783732035D for ; Fri, 6 May 2016 09:00:39 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5AEB120392 for ; Fri, 6 May 2016 09:00:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aybac-0004Pb-9q; Fri, 06 May 2016 08:58:26 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aybaa-0004P7-RL for xen-devel@lists.xen.org; Fri, 06 May 2016 08:58:24 +0000 Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id A6/4F-03753-0BC5C275; Fri, 06 May 2016 08:58:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRWlGSWpSXmKPExsXS1tYhors+Rif cYEKDnMWSj4tZHBg9ju7+zRTAGMWamZeUX5HAmvFq633GgoucFas+vmBsYPzJ3sXIySEkUCEx 5c4WRhBbQoBX4siyGawQtr/E/BczmSBqaiTW7e9nAbHZBBQlNlxcDhYXEZCWuPb5MlAvFwezw HxGiact14EcDg5hgWiJ1gNBIDUsAqoSi2+9YAaxeQUcJR6famGHmK8gsezLWrA4p4CTRNvUdq h7HCV+TNvGNIGRdwEjwypGjeLUorLUIl1DI72kosz0jJLcxMwcXUNDE73c1OLixPTUnMSkYr3 k/NxNjMBgYACCHYxnpzkfYpTkYFIS5V31TztciC8pP6UyI7E4I76oNCe1+BCjDAeHkgRvTrRO uJBgUWp6akVaZg4wLGHSEhw8SiK8f0HSvMUFibnFmekQqVOMilLivAtAEgIgiYzSPLg2WCxcY pSVEuZlBDpEiKcgtSg3swRV/hWjOAejkjDvNJApPJl5JXDTXwEtZgJa/H6uJsjikkSElFQDY7 /SiQhP1rOGk27df3Hl/jRze17LOZePSscb/FibzHh+aXSEaOOcS3G+fjONE5WUlx6MvPT56e3 vWtduc6stO5mz4kvexwzmQx2eje0L7/DnO/+KSOMtnrP2165VzpsDT2jFPlBiW/Wx8W/yPQb1 2Xnp3isFL6858ndJziqVSRFZt6y2zUy/U6TEUpyRaKjFXFScCAA5IgBKgAIAAA== X-Env-Sender: quan.xu@intel.com X-Msg-Ref: server-9.tower-27.messagelabs.com!1462525094!39896475!6 X-Originating-IP: [134.134.136.20] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzU1MzU4\n X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46048 invoked from network); 6 May 2016 08:58:23 -0000 Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by server-9.tower-27.messagelabs.com with SMTP; 6 May 2016 08:58:23 -0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 06 May 2016 01:58:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,586,1455004800"; d="scan'208";a="969963812" Received: from xen-commits.sh.intel.com ([10.239.82.178]) by orsmga002.jf.intel.com with ESMTP; 06 May 2016 01:58:21 -0700 From: Quan Xu To: xen-devel@lists.xen.org Date: Fri, 6 May 2016 16:54:35 +0800 Message-Id: <1462524880-67205-6-git-send-email-quan.xu@intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1462524880-67205-1-git-send-email-quan.xu@intel.com> References: <1462524880-67205-1-git-send-email-quan.xu@intel.com> Cc: dario.faggioli@citrix.com, Jan Beulich , Feng Wu , Kevin Tian , Quan Xu Subject: [Xen-devel] [PATCH v4 05/10] vt-d: propagate IOMMU Device-TLB flush error up to IOMMU mapping. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Propagate the IOMMU Device-TLB flush error up to IOMMU mapping. Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Kevin Tian CC: Feng Wu CC: Jan Beulich --- xen/drivers/passthrough/vtd/iommu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index e0e1126..584982a 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1716,6 +1716,7 @@ static int intel_iommu_map_page( struct domain_iommu *hd = dom_iommu(d); struct dma_pte *page = NULL, *pte = NULL, old, new = { 0 }; u64 pg_maddr; + int rc = 0; /* Do nothing if VT-d shares EPT page table */ if ( iommu_use_hap_pt(d) ) @@ -1758,9 +1759,9 @@ static int intel_iommu_map_page( unmap_vtd_domain_page(page); if ( !this_cpu(iommu_dont_flush_iotlb) ) - iommu_flush_iotlb(d, gfn, dma_pte_present(old), 1); + rc = iommu_flush_iotlb(d, gfn, dma_pte_present(old), 1); - return 0; + return rc; } static int intel_iommu_unmap_page(struct domain *d, unsigned long gfn)