From: Yi Liu <yi.l.liu@intel.com>
To: Zhenzhong Duan <zhenzhong.duan@intel.com>,
<iommu@lists.linux.dev>, <linux-kernel@vger.kernel.org>
Cc: <dwmw2@infradead.org>, <jgg@ziepe.ca>, <kevin.tian@intel.com>,
<joro@8bytes.org>, <will@kernel.org>, <robin.murphy@arm.com>,
<baolu.lu@linux.intel.com>, <stable@vger.kernel.org>,
Joao Martins <joao.m.martins@oracle.com>
Subject: Re: [PATCH v2 1/4] iommu/vt-d: Block PASID attachment to nested domain with dirty tracking
Date: Tue, 31 Mar 2026 15:36:07 +0800 [thread overview]
Message-ID: <2c664395-72b2-4436-b60a-3ba2e73eaf95@intel.com> (raw)
In-Reply-To: <20260330101108.12594-2-zhenzhong.duan@intel.com>
On 3/30/26 18:11, Zhenzhong Duan wrote:
> Kernel lacks dirty tracking support on nested domain attached to PASID,
> fails the attachment early if nesting parent domain is dirty tracking
> configured, otherwise dirty pages would be lost.
>
> Cc: stable@vger.kernel.org
> Fixes: f35f22cc760e ("iommu/vt-d: Access/Dirty bit support for SS domains")
> Suggested-by: Kevin Tian <kevin.tian@intel.com>
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
> drivers/iommu/intel/nested.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
Good catch. Just one nit. I think the below fix tag is more accurate. SS
dirty was merged before PASID attachment. So this fix should be
backported since the first PASID nested domain attachment.
Fixes: 67f6f56b5912 ("iommu/vt-d: Add set_dev_pasid callback for nested
domain")
Reviewed-by: Yi Liu <yi.l.liu@intel.com>
> diff --git a/drivers/iommu/intel/nested.c b/drivers/iommu/intel/nested.c
> index 2b979bec56ce..16c82ba47d30 100644
> --- a/drivers/iommu/intel/nested.c
> +++ b/drivers/iommu/intel/nested.c
> @@ -148,6 +148,7 @@ static int intel_nested_set_dev_pasid(struct iommu_domain *domain,
> {
> struct device_domain_info *info = dev_iommu_priv_get(dev);
> struct dmar_domain *dmar_domain = to_dmar_domain(domain);
> + struct iommu_domain *s2_domain = &dmar_domain->s2_domain->domain;
> struct intel_iommu *iommu = info->iommu;
> struct dev_pasid_info *dev_pasid;
> int ret;
> @@ -155,10 +156,13 @@ static int intel_nested_set_dev_pasid(struct iommu_domain *domain,
> if (!pasid_supported(iommu) || dev_is_real_dma_subdevice(dev))
> return -EOPNOTSUPP;
>
> + if (s2_domain->dirty_ops)
> + return -EINVAL;
> +
> if (context_copied(iommu, info->bus, info->devfn))
> return -EBUSY;
>
> - ret = paging_domain_compatible(&dmar_domain->s2_domain->domain, dev);
> + ret = paging_domain_compatible(s2_domain, dev);
> if (ret)
> return ret;
>
next prev parent reply other threads:[~2026-03-31 7:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 10:11 [PATCH v2 0/4] iommupt/vtd: Support dirty tracking on PASID Zhenzhong Duan
2026-03-30 10:11 ` [PATCH v2 1/4] iommu/vt-d: Block PASID attachment to nested domain with dirty tracking Zhenzhong Duan
2026-03-31 7:19 ` Tian, Kevin
2026-03-31 7:36 ` Yi Liu [this message]
2026-04-01 9:02 ` Duan, Zhenzhong
2026-03-30 10:11 ` [PATCH v2 2/4] iommupt/vtd: Rename device_set_dirty_tracking() and pass dmar_domain pointer Zhenzhong Duan
2026-03-31 7:19 ` Tian, Kevin
2026-03-30 10:11 ` [PATCH v2 3/4] iommupt/vtd: Support dirty tracking on PASID Zhenzhong Duan
2026-03-31 7:19 ` Tian, Kevin
2026-03-30 10:11 ` [PATCH v2 4/4] iommufd/selftest: Test " Zhenzhong Duan
2026-03-31 7:19 ` Tian, Kevin
2026-04-01 6:46 ` [PATCH v2 0/4] iommupt/vtd: Support " Baolu Lu
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=2c664395-72b2-4436-b60a-3ba2e73eaf95@intel.com \
--to=yi.l.liu@intel.com \
--cc=baolu.lu@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=joao.m.martins@oracle.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=stable@vger.kernel.org \
--cc=will@kernel.org \
--cc=zhenzhong.duan@intel.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
all inboxes | Powered by JetHome®