From: Jason Gunthorpe <jgg@nvidia.com>
To: Wei Wang <wei.w.wang@hotmail.com>
Cc: iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
Robin Murphy <robin.murphy@arm.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Will Deacon <will@kernel.org>,
patches@lists.linux.dev
Subject: Re: [PATCH 2/5] iommu/amd: Pass last in through to build_inv_address()
Date: Wed, 1 Apr 2026 16:55:01 -0300 [thread overview]
Message-ID: <20260401195501.GE310919@nvidia.com> (raw)
In-Reply-To: <SI2PR01MB4393461E48F8CE929313A1A8DC52A@SI2PR01MB4393.apcprd01.prod.exchangelabs.com>
On Mon, Mar 30, 2026 at 04:03:38PM +0800, Wei Wang wrote:
> On 3/27/26 11:23 PM, Jason Gunthorpe wrote:
> > This is the trivial call chain below amd_iommu_domain_flush_pages().
> >
> > Cases that are doing a full invalidate will pass a last of U64_MAX.
> >
> > This avoids converting between size and last, and type confusion with
> > size_t, unsigned long and u64 all being used in different places along
> > the driver's invalidation path. Consistently use u64 in the internals.
> >
> > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> > ---
> > drivers/iommu/amd/amd_iommu.h | 2 +-
> > drivers/iommu/amd/iommu.c | 56 +++++++++++++++++------------------
> > drivers/iommu/amd/pasid.c | 2 +-
> > 3 files changed, 29 insertions(+), 31 deletions(-)
> >
> > diff --git a/drivers/iommu/amd/amd_iommu.h b/drivers/iommu/amd/amd_iommu.h
> > index 1342e764a5486d..ef4ebecb003494 100644
> > --- a/drivers/iommu/amd/amd_iommu.h
> > +++ b/drivers/iommu/amd/amd_iommu.h
> > @@ -90,7 +90,7 @@ void amd_iommu_flush_all_caches(struct amd_iommu *iommu);
> > void amd_iommu_domain_flush_pages(struct protection_domain *domain,
> > u64 address, size_t size);
> > void amd_iommu_dev_flush_pasid_pages(struct iommu_dev_data *dev_data,
> > - ioasid_t pasid, u64 address, size_t size);
> > + ioasid_t pasid, u64 address, u64 last);
>
> Using “addr_start/addr_last” or “start/last” would be more symmetrical and
> intuitive.
Okay, it doesn't make the diff look to bad!
Jason
next prev parent reply other threads:[~2026-04-01 19:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 15:23 [PATCH 0/5] Improve the invalidation path in AMD Jason Gunthorpe
2026-03-27 15:23 ` [PATCH 1/5] iommu/amd: Simplify build_inv_address() Jason Gunthorpe
2026-03-30 7:39 ` Wei Wang
2026-03-30 12:05 ` Jason Gunthorpe
2026-03-31 2:01 ` Wei Wang
2026-03-27 15:23 ` [PATCH 2/5] iommu/amd: Pass last in through to build_inv_address() Jason Gunthorpe
2026-03-30 8:03 ` Wei Wang
2026-04-01 19:55 ` Jason Gunthorpe [this message]
2026-03-27 15:23 ` [PATCH 3/5] iommu/amd: Have amd_iommu_domain_flush_pages() use last Jason Gunthorpe
2026-04-01 6:33 ` Wei Wang
2026-03-27 15:23 ` [PATCH 4/5] iommu/amd: Make CMD_INV_IOMMU_ALL_PAGES_ADDRESS match the spec Jason Gunthorpe
2026-04-01 6:42 ` Wei Wang
2026-04-01 13:17 ` Jason Gunthorpe
2026-03-27 15:23 ` [PATCH 5/5] iommu/amd: Control INVALIDATE_IOMMU_PAGES PDE from the gather Jason Gunthorpe
2026-04-01 8:51 ` Wei Wang
2026-05-29 9:33 ` [PATCH 0/5] Improve the invalidation path in AMD Vasant Hegde
2026-06-02 7:06 ` Srivastava, Dheeraj Kumar
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=20260401195501.GE310919@nvidia.com \
--to=jgg@nvidia.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=patches@lists.linux.dev \
--cc=robin.murphy@arm.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=wei.w.wang@hotmail.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.