public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] iommu/vt-d: Convert to use static identity domain
@ 2023-12-05  1:21 Lu Baolu
  2023-12-05  1:21 ` [PATCH v2 1/6] iommu/vt-d: Setup scalable mode context entry in probe path Lu Baolu
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Lu Baolu @ 2023-12-05  1:21 UTC (permalink / raw)
  To: Joerg Roedel, Will Deacon, Robin Murphy, Jason Gunthorpe,
	Kevin Tian
  Cc: iommu, linux-kernel, Lu Baolu

Intel's IOMMU driver used a special domain called 1:1 mapping domain to
support the domain of type IOMMU_DOMAIN_IDENTITY, which enables device
drivers to directly utilize physical addresses for DMA access despite
the presence of IOMMU units.

The implementation of the 1:1 mapping domain is influenced by hardware
differences. While modern Intel VT-d implementations support hardware
passthrough translation mode, earlier versions lacked this feature,
which requires a more complex implementation approach.

The 1:1 mapping domain for earlier hardware was implemented by associating
a DMA domain with an IOVA (IO Virtual Address) equivalent to the
physical address. While, for most hardware supporting passthrough mode,
simply setting the hardware's passthrough mode is sufficient. These two
modes were merged together in si_domain, which is a special DMA domain
sharing the domain ops of an ordinary DMA domain.

As the iommu core has evolved, it has introduced global static identity
domain with "never fail" attach semantics. This means that the domain is
always available and cannot fail to attach. The iommu driver now assigns
this domain directly at iommu_ops->identity_domain instead of allocating
it through the domain allocation interface.

This converts the Intel IOMMU driver to embrace the global static
identity domain. For early legacy hardwares that don't support
passthrough translation mode, ask the iommu core to use a DMA type of
default domain. For modern hardwares that support passthrough
translation mode, implement a static global identity domain.

The whole series is also avaiable at

https://github.com/LuBaolu/intel-iommu/commits/vtd-static-identity-domain-v2

Very appreciated for your review comments and suggestions.

Change log:
v2:
 - Re-orgnize the patches by removing 1:1 mappings before implementing
   global static domain.

v1: https://lore.kernel.org/linux-iommu/20231120112944.142741-1-baolu.lu@linux.intel.com/ 

Lu Baolu (6):
  iommu/vt-d: Setup scalable mode context entry in probe path
  iommu/vt-d: Remove scalable mode context entry setup from attach_dev
  iommu/vt-d: Refactor domain_context_mapping_one() to be reusable
  iommu/vt-d: Remove 1:1 mappings from identity domain
  iommu/vt-d: Add support for static identity domain
  iommu/vt-d: Cleanup si_domain

 drivers/iommu/intel/pasid.h |   1 +
 drivers/iommu/intel/iommu.c | 568 +++++++++++++++---------------------
 drivers/iommu/intel/pasid.c | 180 ++++++++++++
 drivers/iommu/intel/svm.c   |   2 +-
 4 files changed, 415 insertions(+), 336 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2023-12-13  3:06 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-05  1:21 [PATCH v2 0/6] iommu/vt-d: Convert to use static identity domain Lu Baolu
2023-12-05  1:21 ` [PATCH v2 1/6] iommu/vt-d: Setup scalable mode context entry in probe path Lu Baolu
2023-12-08  8:50   ` Tian, Kevin
2023-12-09  7:52     ` Baolu Lu
2023-12-11  4:06       ` Tian, Kevin
2023-12-11 17:38   ` Jason Gunthorpe
2023-12-12  5:34     ` Baolu Lu
2023-12-05  1:21 ` [PATCH v2 2/6] iommu/vt-d: Remove scalable mode context entry setup from attach_dev Lu Baolu
2023-12-08  8:56   ` Tian, Kevin
2023-12-09  7:57     ` Baolu Lu
2023-12-05  1:22 ` [PATCH v2 3/6] iommu/vt-d: Refactor domain_context_mapping_one() to be reusable Lu Baolu
2023-12-05  1:22 ` [PATCH v2 4/6] iommu/vt-d: Remove 1:1 mappings from identity domain Lu Baolu
2023-12-08  9:09   ` Tian, Kevin
2023-12-08 12:45     ` Baolu Lu
2023-12-11  3:58       ` Tian, Kevin
2023-12-12  6:20         ` Baolu Lu
2023-12-13  2:20           ` Tian, Kevin
2023-12-13  2:43             ` Baolu Lu
2023-12-13  3:04               ` Tian, Kevin
2023-12-13  3:02                 ` Baolu Lu
2023-12-05  1:22 ` [PATCH v2 5/6] iommu/vt-d: Add support for static " Lu Baolu
2023-12-05  1:22 ` [PATCH v2 6/6] iommu/vt-d: Cleanup si_domain Lu Baolu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox