iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Jon Derrick <jonathan.derrick@intel.com>
To: <iommu@lists.linux-foundation.org>, <linux-pci@vger.kernel.org>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Keith Busch <kbusch@kernel.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Christoph Hellwig <hch@lst.de>,
	Jon Derrick <jonathan.derrick@intel.com>
Subject: [PATCH v3 2/5] x86/PCI: Expose VMD's PCI Device in pci_sysdata
Date: Fri, 10 Jan 2020 10:21:10 -0700	[thread overview]
Message-ID: <1578676873-6206-3-git-send-email-jonathan.derrick@intel.com> (raw)
In-Reply-To: <1578676873-6206-1-git-send-email-jonathan.derrick@intel.com>

To be used by Intel-IOMMU code to find the correct domain.

CC: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
---
 arch/x86/include/asm/pci.h   | 5 ++---
 drivers/pci/controller/vmd.c | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index cf680c5..b982d9c 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -25,7 +25,7 @@ struct pci_sysdata {
 	void		*fwnode;	/* IRQ domain for MSI assignment */
 #endif
 #if IS_ENABLED(CONFIG_VMD)
-	bool vmd_domain;		/* True if in Intel VMD domain */
+	struct pci_dev	*vmd_dev;	/* VMD Device if in Intel VMD domain */
 #endif
 };
 
@@ -64,12 +64,11 @@ static inline void *_pci_root_bus_fwnode(struct pci_bus *bus)
 #if IS_ENABLED(CONFIG_VMD)
 static inline bool is_vmd(struct pci_bus *bus)
 {
-	return to_pci_sysdata(bus)->vmd_domain;
+	return to_pci_sysdata(bus)->vmd_dev != NULL;
 }
 #else
 #define is_vmd(bus)		false
 #endif /* CONFIG_VMD */
-}
 
 /* Can be used to override the logic in pci_scan_bus for skipping
    already-configured bus numbers - to be used for buggy BIOSes
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 2128422..d67ad56 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -679,7 +679,7 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
 		.parent = res,
 	};
 
-	sd->vmd_domain = true;
+	sd->vmd_dev = vmd->dev;
 	sd->domain = vmd_find_free_domain();
 	if (sd->domain < 0)
 		return sd->domain;
-- 
1.8.3.1

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

  parent reply	other threads:[~2020-01-10 23:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10 17:21 [PATCH v3 0/5] Clean up VMD DMA Map Ops Jon Derrick
2020-01-10 17:21 ` [PATCH v3 1/5] x86/pci: Add a to_pci_sysdata helper Jon Derrick
2020-01-13 14:40   ` Bjorn Helgaas
2020-01-14  8:49   ` Christoph Hellwig
2020-01-10 17:21 ` Jon Derrick [this message]
2020-01-14  8:50   ` [PATCH v3 2/5] x86/PCI: Expose VMD's PCI Device in pci_sysdata Christoph Hellwig
2020-01-10 17:21 ` [PATCH v3 3/5] PCI: Introduce pci_direct_dma_alias() Jon Derrick
2020-01-14  8:51   ` Christoph Hellwig
2020-01-10 17:21 ` [PATCH v3 4/5] PCI: vmd: Stop overriding dma_map_ops Jon Derrick
2020-01-14  8:54   ` Christoph Hellwig
2020-01-17 18:17     ` Derrick, Jonathan
2020-01-10 17:21 ` [PATCH v3 5/5] x86/pci: Remove X86_DEV_DMA_OPS Jon Derrick
2020-01-13 12:08 ` [PATCH v3 0/5] Clean up VMD DMA Map Ops Lorenzo Pieralisi
2020-01-13 17:13   ` Derrick, Jonathan
2020-01-13 18:01     ` Bjorn Helgaas
2020-01-13 18:17       ` Lorenzo Pieralisi

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=1578676873-6206-3-git-send-email-jonathan.derrick@intel.com \
    --to=jonathan.derrick@intel.com \
    --cc=dwmw2@infradead.org \
    --cc=hch@lst.de \
    --cc=helgaas@kernel.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kbusch@kernel.org \
    --cc=linux-pci@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).