All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Derrick <jonathan.derrick@intel.com>
To: <linux-pci@vger.kernel.org>, <iommu@lists.linux-foundation.org>
Cc: Nirmal Patel <nirmal.patel@intel.com>,
	Will Deacon <will@kernel.org>,
	Kapil Karkra <kapil.karkra@intel.com>,
	Bjorn Helgaas <helgaas@kernel.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Jon Derrick <jonathan.derrick@intel.com>
Subject: [PATCH v2 1/2] iommu/vt-d: Use Real PCI DMA device for IRTE
Date: Thu,  4 Feb 2021 12:09:05 -0700	[thread overview]
Message-ID: <20210204190906.38515-2-jonathan.derrick@intel.com> (raw)
In-Reply-To: <20210204190906.38515-1-jonathan.derrick@intel.com>

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 <jonathan.derrick@intel.com>
---
 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);
-- 
2.27.0

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Jon Derrick <jonathan.derrick@intel.com>
To: <linux-pci@vger.kernel.org>, <iommu@lists.linux-foundation.org>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	Joerg Roedel <joro@8bytes.org>,
	Nirmal Patel <nirmal.patel@intel.com>,
	Kapil Karkra <kapil.karkra@intel.com>,
	Will Deacon <will@kernel.org>,
	Jon Derrick <jonathan.derrick@intel.com>
Subject: [PATCH v2 1/2] iommu/vt-d: Use Real PCI DMA device for IRTE
Date: Thu,  4 Feb 2021 12:09:05 -0700	[thread overview]
Message-ID: <20210204190906.38515-2-jonathan.derrick@intel.com> (raw)
In-Reply-To: <20210204190906.38515-1-jonathan.derrick@intel.com>

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 <jonathan.derrick@intel.com>
---
 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);
-- 
2.27.0


  reply	other threads:[~2021-02-04 19:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 19:09 [PATCH v2 0/2] VMD MSI Remapping Bypass Jon Derrick
2021-02-04 19:09 ` Jon Derrick
2021-02-04 19:09 ` Jon Derrick [this message]
2021-02-04 19:09   ` [PATCH v2 1/2] iommu/vt-d: Use Real PCI DMA device for IRTE Jon Derrick
2021-02-05  1:39   ` Lu Baolu
2021-02-05  1:39     ` Lu Baolu
2021-02-04 19:09 ` [PATCH v2 2/2] PCI: vmd: Disable MSI/X remapping when possible Jon Derrick
2021-02-04 19:09   ` Jon Derrick
2021-02-05 21:57   ` Bjorn Helgaas
2021-02-05 21:57     ` Bjorn Helgaas
2021-02-06  2:50     ` Derrick, Jonathan
2021-02-06  2:50       ` Derrick, Jonathan
2021-02-05  8:45 ` [PATCH v2 0/2] VMD MSI Remapping Bypass Joerg Roedel
2021-02-05  8:45   ` Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210204190906.38515-2-jonathan.derrick@intel.com \
    --to=jonathan.derrick@intel.com \
    --cc=dwmw2@infradead.org \
    --cc=helgaas@kernel.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kapil.karkra@intel.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=nirmal.patel@intel.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.