From: Vasant Hegde <vasant.hegde@amd.com>
To: <joro@8bytes.org>, <iommu@lists.linux.dev>
Cc: <suravee.suthikulpanit@amd.com>, <robin.murphy@arm.com>,
Vasant Hegde <vasant.hegde@amd.com>
Subject: [PATCH v2 0/6] iommu/amd: Add Generic IO Page Table Framework Support for v2 Page Table
Date: Wed, 13 Jul 2022 11:00:28 +0530 [thread overview]
Message-ID: <20220713053034.12061-1-vasant.hegde@amd.com> (raw)
This series introduces a new usage model for the v2 page table, where it
can be used to implement support for DMA-API by adopting the generic
IO page table framework.
One of the target usecases is to support nested IO page tables
where the guest uses the guest IO page table (v2) for translating
GVA to GPA, and the hypervisor uses the host I/O page table (v1) for
translating GPA to SPA. This is a pre-requisite for supporting the new
HW-assisted vIOMMU presented at the KVM Forum 2020.
https://static.sched.com/hosted_files/kvmforum2020/26/vIOMMU%20KVM%20Forum%202020.pdf
The following components are introduced in this series:
- Part 1 (patch 1-3 and 5)
Refactor the current IOMMU page table code to adopt the generic IO page
table framework, and add AMD IOMMU Guest (v2) page table management code.
- Part 2 (patch 4)
Add support for the AMD IOMMU Guest IO Protection feature (GIOV)
where requests from the I/O device without a PASID are treated as
if they have PASID of 0.
- Part 3 (patch 6)
Introduce new "amd_iommu_pgtable" command-line to allow users
to select the mode of operation (v1 or v2).
See AMD I/O Virtualization Technology Specification for more detail.
http://www.amd.com/system/files/TechDocs/48882_IOMMU_3.05_PUB.pdf
@Robin,
We are not addressing your comment on cleaning up pgsize_bitmap in
this series. As mentioned in other thread [1] we can work on that
as separate cleanup series.
[1] https://lore.kernel.org/linux-iommu/15337b9f-48d7-d956-5d6c-b40319ba38ad@amd.com/
Thanks,
Vasant
Changes from v1 -> v2 :
- Allow v2 page table only when FEATURE_GT is enabled
- V2 page table doesn't support IOMMU passthrough mode. Hence added
check to fall back to v1 mode if system is booted with iommu=pt
- Overloaded amd_iommu command line option (removed amd_iommu_pgtable option)
- Override supported page sizes dynamically instead of selecting at boot time.
V1 patchset : https://lore.kernel.org/linux-iommu/20220603112107.8603-1-vasant.hegde@amd.com/T/#t
Changes from RFC -> v1:
- Addressed review comments from Joerg
- Reimplemented v2 page table
RFC patchset : https://lore.kernel.org/linux-iommu/20210312090411.6030-1-suravee.suthikulpanit@amd.com/T/#t
Suravee Suthikulpanit (4):
iommu/amd: Refactor amd_iommu_domain_enable_v2 to remove locking
iommu/amd: Update sanity check when enable PRI/ATS for IOMMU v1 table
iommu/amd: Add support for Guest IO protection
iommu/amd: Add support for using AMD IOMMU v2 page table for DMA-API
Vasant Hegde (2):
iommu/amd: Initial support for AMD IOMMU v2 page table
iommu/amd: Add command-line option to enable different page table
.../admin-guide/kernel-parameters.txt | 2 +
drivers/iommu/amd/Makefile | 2 +-
drivers/iommu/amd/amd_iommu_types.h | 8 +-
drivers/iommu/amd/init.c | 36 +-
drivers/iommu/amd/io_pgtable_v2.c | 407 ++++++++++++++++++
drivers/iommu/amd/iommu.c | 89 +++-
drivers/iommu/io-pgtable.c | 1 +
include/linux/io-pgtable.h | 2 +
8 files changed, 518 insertions(+), 29 deletions(-)
create mode 100644 drivers/iommu/amd/io_pgtable_v2.c
--
2.31.1
next reply other threads:[~2022-07-13 5:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 5:30 Vasant Hegde [this message]
2022-07-13 5:30 ` [PATCH v2 1/6] iommu/amd: Refactor amd_iommu_domain_enable_v2 to remove locking Vasant Hegde
2022-07-13 5:30 ` [PATCH v2 2/6] iommu/amd: Update sanity check when enable PRI/ATS for IOMMU v1 table Vasant Hegde
2022-07-13 5:30 ` [PATCH v2 3/6] iommu/amd: Initial support for AMD IOMMU v2 page table Vasant Hegde
2022-07-15 11:55 ` Robin Murphy
2022-07-21 10:52 ` Vasant Hegde
2022-07-13 5:30 ` [PATCH v2 4/6] iommu/amd: Add support for Guest IO protection Vasant Hegde
2022-07-13 5:30 ` [PATCH v2 5/6] iommu/amd: Add support for using AMD IOMMU v2 page table for DMA-API Vasant Hegde
2022-07-13 5:30 ` [PATCH v2 6/6] iommu/amd: Add command-line option to enable different page table Vasant Hegde
2022-07-15 8:49 ` [PATCH v2 0/6] iommu/amd: Add Generic IO Page Table Framework Support for v2 Page Table Joerg Roedel
2022-07-21 10:48 ` Vasant Hegde
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=20220713053034.12061-1-vasant.hegde@amd.com \
--to=vasant.hegde@amd.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=robin.murphy@arm.com \
--cc=suravee.suthikulpanit@amd.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