From patchwork Thu Feb 4 19:09:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Derrick X-Patchwork-Id: 12068431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A6FDC433DB for ; Thu, 4 Feb 2021 19:12:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6D4A264F38 for ; Thu, 4 Feb 2021 19:12:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238834AbhBDTM3 (ORCPT ); Thu, 4 Feb 2021 14:12:29 -0500 Received: from mga18.intel.com ([134.134.136.126]:31188 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239589AbhBDTKG (ORCPT ); Thu, 4 Feb 2021 14:10:06 -0500 IronPort-SDR: zjf4JSL3hkgBbkIRL7N/mjVIzDPnuyhz74nfZe+wJ2M/dj8UELma23r0lRYSXOnNfoKhhvw3pH rS/SgzitxXmw== X-IronPort-AV: E=McAfee;i="6000,8403,9885"; a="168988751" X-IronPort-AV: E=Sophos;i="5.81,153,1610438400"; d="scan'208";a="168988751" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2021 11:09:25 -0800 IronPort-SDR: cSP9LJxWRBz7I+yTpMlbQgvzji88bvziFq5UlYJ7uBXK1NOigBGTKnr1rEyV/k3vVzakXpIGAS jCR1V51rpIZw== X-IronPort-AV: E=Sophos;i="5.81,153,1610438400"; d="scan'208";a="434070474" Received: from sgklier-mobl1.amr.corp.intel.com (HELO jderrick-mobl.amr.corp.intel.com) ([10.212.165.190]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2021 11:09:23 -0800 From: Jon Derrick To: , Cc: Bjorn Helgaas , Lorenzo Pieralisi , David Woodhouse , Lu Baolu , Joerg Roedel , Nirmal Patel , Kapil Karkra , Will Deacon , Jon Derrick Subject: [PATCH v2 1/2] iommu/vt-d: Use Real PCI DMA device for IRTE Date: Thu, 4 Feb 2021 12:09:05 -0700 Message-Id: <20210204190906.38515-2-jonathan.derrick@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210204190906.38515-1-jonathan.derrick@intel.com> References: <20210204190906.38515-1-jonathan.derrick@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org VMD retransmits child device MSI/X with the VMD endpoint's requester-id. In order to support direct interrupt remapping of VMD child devices, ensure that the IRTE is programmed with the VMD endpoint's requester-id using pci_real_dma_dev(). Signed-off-by: Jon Derrick Acked-by: Lu Baolu --- drivers/iommu/intel/irq_remapping.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/intel/irq_remapping.c b/drivers/iommu/intel/irq_remapping.c index 685200a5cff0..1939e070eec8 100644 --- a/drivers/iommu/intel/irq_remapping.c +++ b/drivers/iommu/intel/irq_remapping.c @@ -1276,7 +1276,8 @@ static void intel_irq_remapping_prepare_irte(struct intel_ir_data *data, break; case X86_IRQ_ALLOC_TYPE_PCI_MSI: case X86_IRQ_ALLOC_TYPE_PCI_MSIX: - set_msi_sid(irte, msi_desc_to_pci_dev(info->desc)); + set_msi_sid(irte, + pci_real_dma_dev(msi_desc_to_pci_dev(info->desc))); break; default: BUG_ON(1);