From patchwork Fri Apr 5 07:01:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 10886963 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 242DC1390 for ; Fri, 5 Apr 2019 07:03:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C43F287E0 for ; Fri, 5 Apr 2019 07:03:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F33B428A8F; Fri, 5 Apr 2019 07:03:34 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A56A5287E0 for ; Fri, 5 Apr 2019 07:03:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hCIrN-00024s-03; Fri, 05 Apr 2019 07:01:57 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hCIrM-00024k-Bo for xen-devel@lists.xenproject.org; Fri, 05 Apr 2019 07:01:56 +0000 X-Inumbo-ID: af301af8-5770-11e9-b84c-13249199fb9e Received: from prv1-mh.provo.novell.com (unknown [137.65.248.33]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id af301af8-5770-11e9-b84c-13249199fb9e; Fri, 05 Apr 2019 07:01:50 +0000 (UTC) Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Fri, 05 Apr 2019 01:01:49 -0600 Message-Id: <5CA6FD5D0200007800224C46@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.1.0 Date: Fri, 05 Apr 2019 01:01:49 -0600 From: "Jan Beulich" To: "xen-devel" Mime-Version: 1.0 Content-Disposition: inline Subject: [Xen-devel] [PATCH] VT-d: posted interrupts require interrupt remapping X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Kevin Tian Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Initially I had just noticed the unnecessary indirection in the call from pi_update_irte(). The generic wrapper having an iommu_intremap conditional made me look at the setup code though. So first of all enforce the necessary dependency. Signed-off-by: Jan Beulich Acked-by: Kevin Tian Reviewed-by: Andrew Cooper --- a/xen/drivers/passthrough/vtd/intremap.c +++ b/xen/drivers/passthrough/vtd/intremap.c @@ -993,7 +993,8 @@ int pi_update_irte(const struct pi_desc spin_unlock_irq(&desc->lock); ASSERT(pcidevs_locked()); - return iommu_update_ire_from_msi(msi_desc, &msi_desc->msg); + + return msi_msg_write_remap_rte(msi_desc, &msi_desc->msg); unlock_out: spin_unlock_irq(&desc->lock); --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -2342,7 +2342,7 @@ static int __init vtd_setup(void) * not supported, since we count on this feature to * atomically update 16-byte IRTE in posted format. */ - if ( !cap_intr_post(iommu->cap) || !cpu_has_cx16 ) + if ( !cap_intr_post(iommu->cap) || !iommu_intremap || !cpu_has_cx16 ) iommu_intpost = 0; if ( !vtd_ept_page_compatible(iommu) )