From patchwork Wed May 18 08:08:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Xu X-Patchwork-Id: 9116811 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C8529F37F for ; Wed, 18 May 2016 08:14:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 329A620123 for ; Wed, 18 May 2016 08:14: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 07B5F20306 for ; Wed, 18 May 2016 08:14:37 +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 1b2wau-0004qT-Vs; Wed, 18 May 2016 08:12:40 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2wat-0004oi-8h for xen-devel@lists.xen.org; Wed, 18 May 2016 08:12:39 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 0C/98-19343-6F32C375; Wed, 18 May 2016 08:12:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDLMWRWlGSWpSXmKPExsVywNykQversk2 4wcQGY4slHxezODB6HN39mymAMYo1My8pvyKBNePik22MBft4K66tsmtgnMjdxcjJISRQIfHj xksWEFtCgFfiyLIZrBC2v8SNLz/Zuxg5gGpqJHbOKAMJswkoSmy4uJwJxBYRkJa49vkyYxcjF wezwEImieVruthAEsICMRINry6DzWQRUJV4fu0LmM0r4CjxpHcFO8R8BYllX9Yyg9icAk4SKx ZOYIe4x1Fi/vJpzBMYeRcwMqxi1ChOLSpLLdI1NNVLKspMzyjJTczM0TU0MNbLTS0uTkxPzUl MKtZLzs/dxAgMBQYg2MG4ZrvnIUZJDiYlUd6t8jbhQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR4 byoB5QSLUtNTK9Iyc4BBCZOW4OBREuE1AQamEG9xQWJucWY6ROoUo6KUOO9tkD4BkERGaR5cG ywSLjHKSgnzMgIdIsRTkFqUm1mCKv+KUZyDUUmY9x/IFJ7MvBK46a+AFjMBLb4lBra4JBEhJd XAqDh9VeMLMeagH1nnqovtfGOvhZ6vnJM5R+pW2fk/0ce/VDt+lLbUvB185OP3S5PtrbQvnjB WuCXTeiQipmZFb+hl7p3TP5941Pwr32LBpaD6ZuMu5pwV1ZYr1ac/YPmptKJos8KEgrivvPO+ Pt18Z/5sSRe79TPdt2Y9vbp5RsysnOddwqW+3UosxRmJhlrMRcWJAG/u7Nx/AgAA X-Env-Sender: quan.xu@intel.com X-Msg-Ref: server-13.tower-31.messagelabs.com!1463559142!40094725!9 X-Originating-IP: [192.55.52.120] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29106 invoked from network); 18 May 2016 08:12:37 -0000 Received: from mga04.intel.com (HELO mga04.intel.com) (192.55.52.120) by server-13.tower-31.messagelabs.com with SMTP; 18 May 2016 08:12:37 -0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP; 18 May 2016 01:12:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,328,1459839600"; d="scan'208";a="979407994" Received: from xen-commits.sh.intel.com ([10.239.82.178]) by orsmga002.jf.intel.com with ESMTP; 18 May 2016 01:12:35 -0700 From: Quan Xu To: xen-devel@lists.xen.org Date: Wed, 18 May 2016 16:08:29 +0800 Message-Id: <1463558911-98187-9-git-send-email-quan.xu@intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1463558911-98187-1-git-send-email-quan.xu@intel.com> References: <1463558911-98187-1-git-send-email-quan.xu@intel.com> Cc: Kevin Tian , Feng Wu , Jun Nakajima , George Dunlap , Andrew Cooper , dario.faggioli@citrix.com, Jan Beulich , Quan Xu Subject: [Xen-devel] [PATCH v5 08/10] vt-d/ept: propagate IOMMU Device-TLB flush error up to EPT update. 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 the ept_set_entry(), when VT-d shares EPT page table. Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Jun Nakajima CC: Kevin Tian CC: George Dunlap CC: Jan Beulich CC: Andrew Cooper CC: Feng Wu Reviewed-by: Jan Beulich --- xen/arch/x86/mm/p2m-ept.c | 2 +- xen/include/asm-x86/iommu.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c index 7d4809f..2b02f02 100644 --- a/xen/arch/x86/mm/p2m-ept.c +++ b/xen/arch/x86/mm/p2m-ept.c @@ -832,7 +832,7 @@ out: need_modify_vtd_table ) { if ( iommu_hap_pt_share ) - iommu_pte_flush(d, gfn, &ept_entry->epte, order, vtd_pte_present); + rc = iommu_pte_flush(d, gfn, &ept_entry->epte, order, vtd_pte_present); else { if ( iommu_flags ) diff --git a/xen/include/asm-x86/iommu.h b/xen/include/asm-x86/iommu.h index 43f1620..3d2c354 100644 --- a/xen/include/asm-x86/iommu.h +++ b/xen/include/asm-x86/iommu.h @@ -27,7 +27,8 @@ int iommu_setup_hpet_msi(struct msi_desc *); /* While VT-d specific, this must get declared in a generic header. */ int adjust_vtd_irq_affinities(void); -int iommu_pte_flush(struct domain *d, u64 gfn, u64 *pte, int order, bool_t present); +int __must_check iommu_pte_flush(struct domain *d, u64 gfn, u64 *pte, + int order, bool_t present); bool_t iommu_supports_eim(void); int iommu_enable_x2apic_IR(void); void iommu_disable_x2apic_IR(void);