From patchwork Fri Apr 29 09:25:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Xu X-Patchwork-Id: 8979061 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 1DFB9BF29F for ; Fri, 29 Apr 2016 09:30:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C509201FA for ; Fri, 29 Apr 2016 09:30:46 +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 7F643200FF for ; Fri, 29 Apr 2016 09:30:45 +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 1aw4jG-0000Bg-PD; Fri, 29 Apr 2016 09:28:54 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aw4jF-00009G-Tp for xen-devel@lists.xen.org; Fri, 29 Apr 2016 09:28:54 +0000 Received: from [85.158.143.35] by server-1.bemta-6.messagelabs.com id EF/44-18833-55923275; Fri, 29 Apr 2016 09:28:53 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRWlGSWpSXmKPExsVywNwkQjdUUzn cYMEkDoslHxezODB6HN39mymAMYo1My8pvyKBNWPLlPXsBVc5K751f2VsYPzL3sXIySEkUCHx YsUcVhBbQoBX4siyGVC2v0TbnS2sEDU1EnsmNbOA2GwCihIbLi5nArFFBKQlrn2+zNjFyMXBL DCfUeJpy3VGkISwQLTEtY2PwWwWAVWJT71dzCA2r4CjxNrHL9ghFihILPuyFizOKeAkcf36ez aIZY4SH7p/sE5g5F3AyLCKUb04tagstUjXSC+pKDM9oyQ3MTNH19DATC83tbg4MT01JzGpWC8 5P3cTIzAYGIBgB+Oyv06HGCU5mJREeUM4lcOF+JLyUyozEosz4otKc1KLDzHKcHAoSfDGaQDl BItS01Mr0jJzgGEJk5bg4FES4TUCSfMWFyTmFmemQ6ROMSpKifNqgSQEQBIZpXlwbbBYuMQoK yXMywh0iBBPQWpRbmYJqvwrRnEORiVh3g6QKTyZeSVw018BLWYCWiywSRFkcUkiQkqqgbHj43 r5ss3eFSWZi2x/fZmcX/rdfbLQg8PXU9dK/P7oEbSvsU4izPzYbJUTRvJf2W9YbU4vmmp98yG r5aeiT6vW1a/Vn/OiNX6D5+utbFoz5PI3KxtuiKh/XSC1e5byiivtQoWy3FaspzN8/l9mvzZh 7tz0rpsrtasTF3y+4H854mD7mZ9bQvcqsRRnJBpqMRcVJwIANZvaBoACAAA= X-Env-Sender: quan.xu@intel.com X-Msg-Ref: server-2.tower-21.messagelabs.com!1461922125!2123467!6 X-Originating-IP: [192.55.52.88] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjg4ID0+IDM3NDcyNQ==\n X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 45250 invoked from network); 29 Apr 2016 09:28:52 -0000 Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by server-2.tower-21.messagelabs.com with SMTP; 29 Apr 2016 09:28:52 -0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 29 Apr 2016 02:28:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,551,1455004800"; d="scan'208";a="965266439" Received: from xen-commits.sh.intel.com ([10.239.82.178]) by orsmga002.jf.intel.com with ESMTP; 29 Apr 2016 02:28:51 -0700 From: Quan Xu To: xen-devel@lists.xen.org Date: Fri, 29 Apr 2016 17:25:12 +0800 Message-Id: <1461921917-48394-6-git-send-email-quan.xu@intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1461921917-48394-1-git-send-email-quan.xu@intel.com> References: <1461921917-48394-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 v3 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 e908046..802de02 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1721,6 +1721,7 @@ static int intel_iommu_map_page( struct hvm_iommu *hd = domain_hvm_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) ) @@ -1763,9 +1764,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)