From: Mostafa Saleh <smostafa@google.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: acpica-devel@lists.linux.dev,
Alex Williamson <alex.williamson@redhat.com>,
Hanjun Guo <guohanjun@huawei.com>,
iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
Kevin Tian <kevin.tian@intel.com>,
kvm@vger.kernel.org, Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Robert Moore <robert.moore@intel.com>,
Robin Murphy <robin.murphy@arm.com>,
Sudeep Holla <sudeep.holla@arm.com>,
Will Deacon <will@kernel.org>, Eric Auger <eric.auger@redhat.com>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
Moritz Fischer <mdf@kernel.org>,
Michael Shavit <mshavit@google.com>,
Nicolin Chen <nicolinc@nvidia.com>,
patches@lists.linux.dev,
Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
Subject: Re: [PATCH 0/8] Initial support for SMMUv3 nested translation
Date: Tue, 20 Aug 2024 08:20:32 +0000 [thread overview]
Message-ID: <ZsRR0MUHPz23zxu3@google.com> (raw)
In-Reply-To: <0-v1-54e734311a7f+14f72-smmuv3_nesting_jgg@nvidia.com>
Hi Jason,
On Tue, Aug 06, 2024 at 08:41:13PM -0300, Jason Gunthorpe wrote:
> This brings support for the IOMMFD ioctls:
>
> - IOMMU_GET_HW_INFO
> - IOMMU_HWPT_ALLOC_NEST_PARENT
> - IOMMU_DOMAIN_NESTED
> - ops->enforce_cache_coherency()
>
> This is quite straightforward as the nested STE can just be built in the
> special NESTED domain op and fed through the generic update machinery.
>
> The design allows the user provided STE fragment to control several
> aspects of the translation, including putting the STE into a "virtual
> bypass" or a aborting state. This duplicates functionality available by
> other means, but it allows trivially preserving the VMID in the STE as we
> eventually move towards the VIOMMU owning the VMID.
>
> Nesting support requires the system to either support S2FWB or the
> stronger CANWBS ACPI flag. This is to ensure the VM cannot bypass the
> cache and view incoherent data, currently VFIO lacks any cache flushing
> that would make this safe.
>
> Yan has a series to add some of the needed infrastructure for VFIO cache
> flushing here:
>
> https://lore.kernel.org/linux-iommu/20240507061802.20184-1-yan.y.zhao@intel.com/
>
> Which may someday allow relaxing this further.
>
> Remove VFIO_TYPE1_NESTING_IOMMU since it was never used and superseded by
> this.
>
> This is the first series in what will be several to complete nesting
> support. At least:
> - IOMMU_RESV_SW_MSI related fixups
> - VIOMMU object support to allow ATS invalidations
> - vCMDQ hypervisor support for direct invalidation queue assignment
> - KVM pinned VMID using VIOMMU for vBTM
> - Cross instance S2 sharing
> - Virtual Machine Structure using VIOMMU (for vMPAM?)
> - Fault forwarding support through IOMMUFD's fault fd for vSVA
>
> It is enough to allow significant amounts of qemu work to progress.
>
Are there any qemu patches to tests this?
As I am confused with some of the user space bits and that would help.
Thanks,
Mostafa
> This is on github: https://github.com/jgunthorpe/linux/commits/smmuv3_nesting
>
> Jason Gunthorpe (5):
> vfio: Remove VFIO_TYPE1_NESTING_IOMMU
> iommu/arm-smmu-v3: Use S2FWB when available
> iommu/arm-smmu-v3: Report IOMMU_CAP_ENFORCE_CACHE_COHERENCY for CANWBS
> iommu/arm-smmu-v3: Implement IOMMU_HWPT_ALLOC_NEST_PARENT
> iommu/arm-smmu-v3: Support IOMMU_DOMAIN_NESTED
>
> Nicolin Chen (3):
> ACPI/IORT: Support CANWBS memory access flag
> iommu/arm-smmu-v3: Support IOMMU_GET_HW_INFO via struct
> arm_smmu_hw_info
> iommu/arm-smmu-v3: Add arm_smmu_cache_invalidate_user
>
> drivers/acpi/arm64/iort.c | 13 +
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 398 ++++++++++++++++++--
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 27 ++
> drivers/iommu/arm/arm-smmu/arm-smmu.c | 16 -
> drivers/iommu/io-pgtable-arm.c | 24 +-
> drivers/iommu/iommu.c | 10 -
> drivers/iommu/iommufd/vfio_compat.c | 7 +-
> drivers/vfio/vfio_iommu_type1.c | 12 +-
> include/acpi/actbl2.h | 1 +
> include/linux/io-pgtable.h | 2 +
> include/linux/iommu.h | 54 ++-
> include/uapi/linux/iommufd.h | 79 ++++
> include/uapi/linux/vfio.h | 2 +-
> 13 files changed, 572 insertions(+), 73 deletions(-)
>
>
> base-commit: e5e288d94186b266b062b3e44c82c285dfe68712
> --
> 2.46.0
>
next prev parent reply other threads:[~2024-08-20 8:21 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 23:41 [PATCH 0/8] Initial support for SMMUv3 nested translation Jason Gunthorpe
2024-08-06 23:41 ` [PATCH 1/8] vfio: Remove VFIO_TYPE1_NESTING_IOMMU Jason Gunthorpe
2024-08-07 17:52 ` Alex Williamson
2024-08-20 8:23 ` Mostafa Saleh
2024-08-06 23:41 ` [PATCH 2/8] iommu/arm-smmu-v3: Use S2FWB when available Jason Gunthorpe
2024-08-09 14:26 ` Shameerali Kolothum Thodi
2024-08-09 15:12 ` Jason Gunthorpe
2024-08-15 16:14 ` Shameerali Kolothum Thodi
2024-08-15 16:18 ` Jason Gunthorpe
2024-08-20 8:30 ` Mostafa Saleh
2024-08-20 12:01 ` Jason Gunthorpe
2024-08-20 13:01 ` Jason Gunthorpe
2024-08-20 19:52 ` Mostafa Saleh
2024-08-20 20:21 ` Jason Gunthorpe
2024-08-21 9:53 ` Mostafa Saleh
2024-08-21 12:06 ` Jason Gunthorpe
2024-08-06 23:41 ` [PATCH 3/8] ACPI/IORT: Support CANWBS memory access flag Jason Gunthorpe
2024-08-09 14:36 ` Shameerali Kolothum Thodi
2024-08-09 14:59 ` Jason Gunthorpe
2024-08-09 15:15 ` Shameerali Kolothum Thodi
2024-08-09 20:14 ` Nicolin Chen
2024-08-06 23:41 ` [PATCH 4/8] iommu/arm-smmu-v3: Report IOMMU_CAP_ENFORCE_CACHE_COHERENCY for CANWBS Jason Gunthorpe
2024-08-06 23:41 ` [PATCH 5/8] iommu/arm-smmu-v3: Support IOMMU_GET_HW_INFO via struct arm_smmu_hw_info Jason Gunthorpe
2024-08-06 23:41 ` [PATCH 6/8] iommu/arm-smmu-v3: Implement IOMMU_HWPT_ALLOC_NEST_PARENT Jason Gunthorpe
2024-08-09 15:06 ` Robin Murphy
2024-08-09 16:09 ` Jason Gunthorpe
2024-08-09 18:34 ` Robin Murphy
2024-08-13 14:35 ` Jason Gunthorpe
2024-08-06 23:41 ` [PATCH 7/8] iommu/arm-smmu-v3: Support IOMMU_DOMAIN_NESTED Jason Gunthorpe
2024-08-09 16:05 ` Robin Murphy
2024-08-09 18:03 ` Jason Gunthorpe
2024-08-06 23:41 ` [PATCH 8/8] iommu/arm-smmu-v3: Add arm_smmu_cache_invalidate_user Jason Gunthorpe
2024-08-20 8:20 ` Mostafa Saleh [this message]
2024-08-20 15:24 ` [PATCH 0/8] Initial support for SMMUv3 nested translation Nicolin Chen
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=ZsRR0MUHPz23zxu3@google.com \
--to=smostafa@google.com \
--cc=acpica-devel@lists.linux.dev \
--cc=alex.williamson@redhat.com \
--cc=eric.auger@redhat.com \
--cc=guohanjun@huawei.com \
--cc=iommu@lists.linux.dev \
--cc=jean-philippe@linaro.org \
--cc=jgg@nvidia.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=mdf@kernel.org \
--cc=mshavit@google.com \
--cc=nicolinc@nvidia.com \
--cc=patches@lists.linux.dev \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
--cc=robin.murphy@arm.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=sudeep.holla@arm.com \
--cc=will@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).