From patchwork Wed Jun 8 08:58:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Xu X-Patchwork-Id: 9163731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8D08C60467 for ; Wed, 8 Jun 2016 09:05:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D87F28345 for ; Wed, 8 Jun 2016 09:05:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71D8B2838F; Wed, 8 Jun 2016 09:05:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id BA23528363 for ; Wed, 8 Jun 2016 09:05: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 1bAZOh-00045S-Cx; Wed, 08 Jun 2016 09:03:35 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAZOg-00044n-Hy for xen-devel@lists.xen.org; Wed, 08 Jun 2016 09:03:34 +0000 Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id 20/CF-31829-56FD7575; Wed, 08 Jun 2016 09:03:33 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDLMWRWlGSWpSXmKPExsVywNwkQjf5fni 4waZZ6hZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aTTRtYC67JVBzqW8HawHhXrIuRk0NIoFLi 4aIFTCC2hACvxJFlM1ghbH+J2Xs62CBqaiT+PH8NZrMJqEjMaH7HDmKLCEhLXPt8mbGLkYuDW WA1k8TMx5fBEsICORLvF09mAbFZBFQlts5/ADaUV8BRor9tCtQyBYllX9YydzFycHAKOElsPV YKsctRYtvuJywTGHkXMDKsYlQvTi0qSy3SNdNLKspMzyjJTczM0TU0NNHLTS0uTkxPzUlMKtZ Lzs/dxAgMBQYg2MH4d4LzIUZJDiYlUV5F9/BwIb6k/JTKjMTijPii0pzU4kOMMhwcShK8tfeA coJFqempFWmZOcCghElLcPAoifBKgaR5iwsSc4sz0yFSpxgVpcR5RUESAiCJjNI8uDZYJFxil JUS5mUEOkSIpyC1KDezBFX+FaM4B6OSMG8YyBSezLwSuOmvgBYzAS1efgRscUkiQkqqgbH1fr NrZEOGHNfGj8orn9ge/+Z/b4rljJVx62T1J+VO7dzXt+qSv9xSF768ohb2/gID3/V/ZSZZvf2 oYe3fwV+1kkklIOr6vnpTEXvBvKksGYwh0kYSbR3/d7J95mXcfZB/xkzFoLkeMw/r/KitmN+d cVr0TdTkO6Elsfwzfq86e/xk00WLPCWW4oxEQy3mouJEAACo+Hx/AgAA X-Env-Sender: quan.xu@intel.com X-Msg-Ref: server-9.tower-27.messagelabs.com!1465376607!46437496!3 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.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28013 invoked from network); 8 Jun 2016 09:03:31 -0000 Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by server-9.tower-27.messagelabs.com with SMTP; 8 Jun 2016 09:03:31 -0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 08 Jun 2016 02:03:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,438,1459839600"; d="scan'208";a="983223918" Received: from xen-commits.sh.intel.com ([10.239.82.178]) by fmsmga001.fm.intel.com with ESMTP; 08 Jun 2016 02:03:30 -0700 From: "Xu, Quan" To: xen-devel@lists.xen.org Date: Wed, 8 Jun 2016 16:58:57 +0800 Message-Id: <1465376344-28290-5-git-send-email-quan.xu@intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1465376344-28290-1-git-send-email-quan.xu@intel.com> References: <1465376344-28290-1-git-send-email-quan.xu@intel.com> Cc: Kevin Tian , Stefano Stabellini , Feng Wu , Quan Xu , dario.faggioli@citrix.com, Julien Grall , Jan Beulich , Suravee Suthikulpanit Subject: [Xen-devel] [PATCH v7 04/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU mapping (top level ones) 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-Virus-Scanned: ClamAV using ClamSMTP From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Suravee Suthikulpanit CC: Stefano Stabellini CC: Julien Grall CC: Kevin Tian CC: Feng Wu CC: Jan Beulich v7: drop the amd_iommu_hwdom_init() fix, which has been added in patch 2 in this v7. Reviewed-by: Jan Beulich Acked-by: Suravee Suthikulpanit --- xen/drivers/passthrough/arm/smmu.c | 4 ++-- xen/drivers/passthrough/vtd/iommu.c | 7 ++++--- xen/include/asm-x86/hvm/svm/amd-iommu-proto.h | 4 ++-- xen/include/xen/iommu.h | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c index 1ce4ddf..ee5c89d 100644 --- a/xen/drivers/passthrough/arm/smmu.c +++ b/xen/drivers/passthrough/arm/smmu.c @@ -2745,8 +2745,8 @@ static void arm_smmu_iommu_domain_teardown(struct domain *d) xfree(xen_domain); } -static int arm_smmu_map_page(struct domain *d, unsigned long gfn, - unsigned long mfn, unsigned int flags) +static int __must_check arm_smmu_map_page(struct domain *d, unsigned long gfn, + unsigned long mfn, unsigned int flags) { p2m_type_t t; diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 4844193..e900019 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1687,9 +1687,10 @@ static void iommu_domain_teardown(struct domain *d) spin_unlock(&hd->arch.mapping_lock); } -static int intel_iommu_map_page( - struct domain *d, unsigned long gfn, unsigned long mfn, - unsigned int flags) +static int __must_check intel_iommu_map_page(struct domain *d, + unsigned long gfn, + unsigned long mfn, + unsigned int flags) { struct domain_iommu *hd = dom_iommu(d); struct dma_pte *page = NULL, *pte = NULL, old, new = { 0 }; diff --git a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h index 57b6cc1..ac9f036 100644 --- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h +++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h @@ -51,8 +51,8 @@ int amd_iommu_init(void); int amd_iommu_update_ivrs_mapping_acpi(void); /* mapping functions */ -int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn, - unsigned int flags); +int __must_check amd_iommu_map_page(struct domain *d, unsigned long gfn, + unsigned long mfn, unsigned int flags); int __must_check amd_iommu_unmap_page(struct domain *d, unsigned long gfn); u64 amd_iommu_get_next_table_from_pte(u32 *entry); int amd_iommu_reserve_domain_unity_map(struct domain *domain, diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index f45fa5a..2b86710 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -166,8 +166,8 @@ struct iommu_ops { #endif /* HAS_PCI */ void (*teardown)(struct domain *d); - int (*map_page)(struct domain *d, unsigned long gfn, unsigned long mfn, - unsigned int flags); + int __must_check (*map_page)(struct domain *d, unsigned long gfn, + unsigned long mfn, unsigned int flags); int __must_check (*unmap_page)(struct domain *d, unsigned long gfn); void (*free_page_table)(struct page_info *); #ifdef CONFIG_X86