All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Baolu Lu <baolu.lu@linux.intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Will Deacon <will@kernel.org>,
	patches@lists.linux.dev, Wei Wang <wei.w.wang@intel.com>
Subject: Re: [PATCH 3/7] iommu/vtd: Do not wipe out the page table NID when devices detach
Date: Tue, 10 Jun 2025 10:18:24 -0300	[thread overview]
Message-ID: <20250610131824.GD543171@nvidia.com> (raw)
In-Reply-To: <06566252-25a9-4b68-8deb-e1fbd8b7a3b8@linux.intel.com>

On Tue, Jun 10, 2025 at 02:41:11PM +0800, Baolu Lu wrote:
> On 6/10/25 03:58, Jason Gunthorpe wrote:
> > The NID is used to control which NUMA node memory for the page table is
> > allocated it from. It should be a permanent property of the page table
> > when it was allocated and not change during attach/detach of devices.
> > 
> > Signed-off-by: Jason Gunthorpe<jgg@nvidia.com>
> > ---
> >   drivers/iommu/intel/iommu.c | 1 -
> >   1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
> > index ceb960a796e2ba..72b0769c391008 100644
> > --- a/drivers/iommu/intel/iommu.c
> > +++ b/drivers/iommu/intel/iommu.c
> > @@ -1391,7 +1391,6 @@ void domain_detach_iommu(struct dmar_domain *domain, struct intel_iommu *iommu)
> >   	if (--info->refcnt == 0) {
> >   		ida_free(&iommu->domain_ida, info->did);
> >   		xa_erase(&domain->iommu_array, iommu->seq_id);
> > -		domain->nid = NUMA_NO_NODE;
> 
> It appears that this is a fix.

Hard to say, but sure it could be..

> Fixes: 7c204426b818 ("iommu/vt-d: Add domain_alloc_paging support")

Arguably it is before this, the NID should not have been cleared once
set by attach. The above only fixed things to have the NID set from
the creation side..

I'd pick:

Fixes: ba949f4cd4c3 ("iommu/vt-d: Refactor iommu information of each domain")

As the patch that introduced the NUMA_NO_NODE on the detach flow in
the first place..

But that would encourage people to back port this quite far, and I
don't think that's really a good idea since it isn't something someone
cares about, and maybe there is good reason the above had it..

So I'd leave it with no fixes line..

Thanks,
Jason

  reply	other threads:[~2025-06-10 13:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 19:58 [PATCH 0/7] Reorganize Intel VT-D to be ready for iommupt Jason Gunthorpe
2025-06-09 19:58 ` [PATCH 1/7] iommu/vtd: Lift the __pa to domain_setup_first_level/intel_svm_set_dev_pasid() Jason Gunthorpe
2025-06-10 18:34   ` Jason Gunthorpe
2025-06-11 21:07   ` kernel test robot
2025-06-09 19:58 ` [PATCH 2/7] iommu/vtd: Fold domain_exit() into intel_iommu_domain_free() Jason Gunthorpe
2025-06-10  9:15   ` Wang, Wei W
2025-06-10 13:29     ` Jason Gunthorpe
2025-06-09 19:58 ` [PATCH 3/7] iommu/vtd: Do not wipe out the page table NID when devices detach Jason Gunthorpe
2025-06-10  6:41   ` Baolu Lu
2025-06-10 13:18     ` Jason Gunthorpe [this message]
2025-06-10  9:14   ` Wang, Wei W
2025-06-09 19:58 ` [PATCH 4/7] iommu/vtd: Split intel_iommu_domain_alloc_paging_flags() Jason Gunthorpe
2025-06-10  9:14   ` Wang, Wei W
2025-06-10 13:25     ` Jason Gunthorpe
2025-06-09 19:58 ` [PATCH 5/7] iommu/vtd: Create unique domain ops for each stage Jason Gunthorpe
2025-06-10  9:14   ` Wang, Wei W
2025-06-10 13:26     ` Jason Gunthorpe
2025-06-09 19:58 ` [PATCH 6/7] iommu/vtd: Split intel_iommu_enforce_cache_coherency() Jason Gunthorpe
2025-06-09 19:58 ` [PATCH 7/7] iommu/vtd: Split paging_domain_compatible() Jason Gunthorpe
2025-06-10  7:12   ` Baolu Lu
2025-06-10 23:51     ` Jason Gunthorpe
2025-06-11  4:50       ` Baolu Lu
2025-06-12 13:47         ` Jason Gunthorpe
2025-06-13  3:15           ` Baolu Lu
2025-06-12  7:18 ` [PATCH 0/7] Reorganize Intel VT-D to be ready for iommupt Joerg Roedel

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=20250610131824.GD543171@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=patches@lists.linux.dev \
    --cc=robin.murphy@arm.com \
    --cc=wei.w.wang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.