From: Nicolin Chen <nicolinc@nvidia.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: <acpica-devel@lists.linux.dev>, 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>,
"Alex Williamson" <alex.williamson@redhat.com>,
Eric Auger <eric.auger@redhat.com>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
Moritz Fischer <mdf@kernel.org>,
Michael Shavit <mshavit@google.com>, <patches@lists.linux.dev>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>,
"Mostafa Saleh" <smostafa@google.com>
Subject: Re: [PATCH v3 9/9] iommu/arm-smmu-v3: Use S2FWB for NESTED domains
Date: Wed, 9 Oct 2024 10:42:04 -0700 [thread overview]
Message-ID: <ZwbAbK0HkYHs1cza@Asurada-Nvidia> (raw)
In-Reply-To: <9-v3-e2e16cd7467f+2a6a1-smmuv3_nesting_jgg@nvidia.com>
On Wed, Oct 09, 2024 at 01:23:15PM -0300, Jason Gunthorpe wrote:
> Force Write Back (FWB) changes how the S2 IOPTE's MemAttr field
> works. When S2FWB is supported and enabled the IOPTE will force cachable
> access to IOMMU_CACHE memory when nesting with a S1 and deny cachable
> access otherwise.
>
> When using a single stage of translation, a simple S2 domain, it doesn't
> change things for PCI devices as it is just a different encoding for the
> existing mapping of the IOMMU protection flags to cachability attributes.
> For non-PCI it also changes the combining rules when incoming transactions
> have inconsistent attributes.
>
> However, when used with a nested S1, FWB has the effect of preventing the
> guest from choosing a MemAttr in it's S1 that would cause ordinary DMA to
> bypass the cache. Consistent with KVM we wish to deny the guest the
> ability to become incoherent with cached memory the hypervisor believes is
> cachable so we don't have to flush it.
>
> Allow NESTED domains to be created if the SMMU has S2FWB support and use
> S2FWB for NESTING_PARENTS. This is an additional option to CANWBS.
>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
My HW doesn't support this S2FWB for testing, but the patch LGTM.
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
> @@ -265,6 +266,7 @@ static inline u32 arm_smmu_strtab_l2_idx(u32 sid)
> #define STRTAB_STE_1_S1CSH GENMASK_ULL(7, 6)
>
> #define STRTAB_STE_1_S1STALLD (1UL << 27)
> +#define STRTAB_STE_1_S2FWB (1UL << 25)
Nit: seems that it should be in ascending order.
Thanks
Nicolin
next prev parent reply other threads:[~2024-10-09 17:55 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-09 16:23 [PATCH v3 0/9] Initial support for SMMUv3 nested translation Jason Gunthorpe
2024-10-09 16:23 ` [PATCH v3 1/9] vfio: Remove VFIO_TYPE1_NESTING_IOMMU Jason Gunthorpe
2024-10-09 16:23 ` [PATCH v3 2/9] ACPICA: IORT: Update for revision E.f Jason Gunthorpe
2024-10-10 1:48 ` Hanjun Guo
2024-10-09 16:23 ` [PATCH v3 3/9] ACPI/IORT: Support CANWBS memory access flag Jason Gunthorpe
2024-10-10 7:45 ` Hanjun Guo
2024-10-24 7:38 ` Tian, Kevin
2024-10-09 16:23 ` [PATCH v3 4/9] iommu/arm-smmu-v3: Report IOMMU_CAP_ENFORCE_CACHE_COHERENCY for CANWBS Jason Gunthorpe
2024-10-24 7:41 ` Tian, Kevin
2024-10-09 16:23 ` [PATCH v3 5/9] iommu/arm-smmu-v3: Support IOMMU_GET_HW_INFO via struct arm_smmu_hw_info Jason Gunthorpe
2024-10-30 16:24 ` Mostafa Saleh
2024-10-30 17:56 ` Jason Gunthorpe
2024-10-30 18:14 ` Nicolin Chen
2024-10-09 16:23 ` [PATCH v3 6/9] iommu/arm-smmu-v3: Implement IOMMU_HWPT_ALLOC_NEST_PARENT Jason Gunthorpe
2024-10-30 16:26 ` Mostafa Saleh
2024-10-09 16:23 ` [PATCH v3 7/9] iommu/arm-smmu-v3: Expose the arm_smmu_attach interface Jason Gunthorpe
2024-10-09 17:03 ` Nicolin Chen
2024-10-24 7:47 ` Tian, Kevin
2024-10-30 16:26 ` Mostafa Saleh
2024-10-09 16:23 ` [PATCH v3 8/9] iommu/arm-smmu-v3: Support IOMMU_DOMAIN_NESTED Jason Gunthorpe
2024-10-09 17:27 ` Nicolin Chen
2024-10-11 13:59 ` Jason Gunthorpe
2024-10-24 7:50 ` Tian, Kevin
2024-10-30 16:29 ` Mostafa Saleh
2024-10-30 23:59 ` Jason Gunthorpe
2024-10-09 16:23 ` [PATCH v3 9/9] iommu/arm-smmu-v3: Use S2FWB for NESTED domains Jason Gunthorpe
2024-10-09 17:42 ` Nicolin Chen [this message]
2024-10-11 14:00 ` Jason Gunthorpe
2024-10-24 7:54 ` Tian, Kevin
2024-10-25 14:00 ` Jason Gunthorpe
2024-10-28 2:25 ` Tian, Kevin
2024-10-09 17:46 ` [PATCH v3 0/9] Initial support for SMMUv3 nested translation Nicolin Chen
2024-10-26 20:26 ` Jerry Snitselaar
2024-10-30 4:06 ` Donald Dutile
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=ZwbAbK0HkYHs1cza@Asurada-Nvidia \
--to=nicolinc@nvidia.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=patches@lists.linux.dev \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
--cc=robin.murphy@arm.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=smostafa@google.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