From: Lu Baolu <baolu.lu@linux.intel.com>
To: Joerg Roedel <joro@8bytes.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Bjorn Helgaas <bhelgaas@google.com>
Cc: ashok.raj@intel.com, jacob.jun.pan@intel.com,
kevin.tian@intel.com, Christoph Hellwig <hch@lst.de>,
Robin Murphy <robin.murphy@arm.com>,
iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
Lu Baolu <baolu.lu@linux.intel.com>
Subject: [RFC PATCH 1/4] driver core: Add iommu_passthrough to struct device
Date: Wed, 1 Jan 2020 13:26:45 +0800 [thread overview]
Message-ID: <20200101052648.14295-2-baolu.lu@linux.intel.com> (raw)
In-Reply-To: <20200101052648.14295-1-baolu.lu@linux.intel.com>
Add iommu_passthrough to struct device. This enables the iommu
subsystem to prepare an identity domain for the device so that
the DMA IOVA will be translated to the same physical address.
This field could be set in various subsystems, such as PCI,
according to the device/firmware properties or kernel command
parameters.
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
include/linux/device.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/device.h b/include/linux/device.h
index 96ff76731e93..763d2d078d34 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1247,6 +1247,8 @@ struct dev_links_info {
* sync_state() callback.
* @dma_coherent: this particular device is dma coherent, even if the
* architecture supports non-coherent devices.
+ * @iommu_passthrough: this particular device need to by pass the IOMMU DMA
+ * translation.
*
* At the lowest level, every device in a Linux system is represented by an
* instance of struct device. The device structure contains the information
@@ -1347,6 +1349,7 @@ struct device {
defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
bool dma_coherent:1;
#endif
+ bool iommu_passthrough:1;
};
static inline struct device *kobj_to_dev(struct kobject *kobj)
--
2.17.1
next prev parent reply other threads:[~2020-01-01 5:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-01 5:26 [RFC PATCH 0/4] iommu: Per-group default domain type Lu Baolu
2020-01-01 5:26 ` Lu Baolu [this message]
2020-01-01 5:26 ` [RFC PATCH 2/4] PCI: Add "pci=iommu_passthrough=" parameter for iommu passthrough Lu Baolu
2020-01-18 0:18 ` Bjorn Helgaas
2020-01-18 2:04 ` Lu Baolu
2020-01-21 14:17 ` Bjorn Helgaas
2020-01-22 4:49 ` Lu Baolu
2020-01-01 5:26 ` [RFC PATCH 3/4] iommu: Preallocate iommu group when probing devices Lu Baolu
2020-01-17 10:21 ` Joerg Roedel
2020-01-18 2:18 ` Lu Baolu
2020-01-19 6:29 ` Lu Baolu
2020-01-21 12:45 ` Robin Murphy
2020-01-22 5:39 ` Lu Baolu
2020-01-23 14:55 ` Robin Murphy
2020-01-01 5:26 ` [RFC PATCH 4/4] iommu: Determine default domain type before allocating domain Lu Baolu
2020-01-20 9:44 ` [RFC PATCH 0/4] iommu: Per-group default domain type John Garry
2020-01-21 0:43 ` Lu Baolu
2020-01-21 10:14 ` John Garry
2020-01-22 4:58 ` Lu Baolu
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=20200101052648.14295-2-baolu.lu@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=ashok.raj@intel.com \
--cc=bhelgaas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=jacob.jun.pan@intel.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
/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).