From: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
To: iommu@lists.linux-foundation.org
Cc: Ashok Raj <ashok.raj@intel.com>,
Will Deacon <will.deacon@arm.com>,
Robin Murphy <robin.murphy@arm.com>,
Christoph Hellwig <hch@lst.de>
Subject: [PATCH RFC 0/4] iommu: Add support to change default domain of a group
Date: Tue, 2 Jul 2019 18:53:58 -0700 [thread overview]
Message-ID: <cover.1562116655.git.sai.praneeth.prakhya@intel.com> (raw)
Presently, the default domain of a group is allocated during boot time and it
cannot be changed later. So, the device would typically be either in
identity/pass through mode or the device would be in DMA mode as long as the
system is up and running. There is no way to change the default domain type
dynamically i.e. after booting, a device cannot switch between identity mode and
DMA mode.
Assume a use case where-in the priviliged user would want to use the device in
pass-through mode when the device is used for host but would want to switch to
dma protected mode when switching for VFIO in user space. Presently, this is not
supported and hence add support to change default domain of a group dynamically.
Support this through a sysfs file, namely "/sys/kernel/iommu_groups/<grp_id>/type".
Testing:
--------
Tested by dynamically changing USB device from identity mode to dma and from dma
to identity. Only for x86_64 (i.e. intel_iommu/vt-d). Haven't tested for other
architectures.
Sai Praneeth Prakhya (4):
iommu/vt-d: Modify device_def_domain_type() to use at runtime
iommu: Add device_def_domain_type() call back function to iommu_ops
iommu: Add support to change default domain of a group
iommu: Document usage of "/sys/kernel/iommu_groups/<grp_id>/type" file
.../ABI/testing/sysfs-kernel-iommu_groups | 34 ++++
drivers/iommu/intel-iommu.c | 32 +++-
drivers/iommu/iommu.c | 178 +++++++++++++++++-
include/linux/iommu.h | 3 +
4 files changed, 237 insertions(+), 10 deletions(-)
Cc: Christoph Hellwig <hch@lst.de>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Lu Baolu <baolu.lu@linux.intel.com>
Cc: Sohil Mehta <sohil.mehta@intel.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
--
2.19.1
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next reply other threads:[~2019-07-03 1:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-03 1:53 Sai Praneeth Prakhya [this message]
2019-07-03 1:53 ` [PATCH RFC 1/4] iommu/vt-d: Modify device_def_domain_type() to use at runtime Sai Praneeth Prakhya
2019-07-22 15:11 ` Joerg Roedel
2019-07-26 6:47 ` Prakhya, Sai Praneeth
2019-07-03 1:54 ` [PATCH RFC 2/4] iommu: Add device_def_domain_type() call back function to iommu_ops Sai Praneeth Prakhya
2019-07-03 1:54 ` [PATCH RFC 3/4] iommu: Add support to change default domain of a group Sai Praneeth Prakhya
2019-07-03 1:54 ` [PATCH RFC 4/4] iommu: Document usage of "/sys/kernel/iommu_groups/<grp_id>/type" file Sai Praneeth Prakhya
2019-07-22 14:41 ` [PATCH RFC 0/4] iommu: Add support to change default domain of a group Joerg Roedel
2019-07-26 6:44 ` Prakhya, Sai Praneeth
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=cover.1562116655.git.sai.praneeth.prakhya@intel.com \
--to=sai.praneeth.prakhya@intel.com \
--cc=ashok.raj@intel.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=robin.murphy@arm.com \
--cc=will.deacon@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