From: Jason Gunthorpe <jgg@nvidia.com>
To: Vasant Hegde <vasant.hegde@amd.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>,
Alejandro Jimenez <alejandro.j.jimenez@oracle.com>,
Joerg Roedel <jroedel@suse.de>, Kevin Tian <kevin.tian@intel.com>,
patches@lists.linux.dev
Subject: Re: [PATCH 7/7] iommu/amd: Fully decode all combinations of alloc_paging_flags
Date: Thu, 9 Jan 2025 13:17:26 -0400 [thread overview]
Message-ID: <20250109171726.GA396083@nvidia.com> (raw)
In-Reply-To: <f8b228c7-ca79-469e-9266-985255a227b4@amd.com>
On Tue, Jan 07, 2025 at 04:17:59PM +0530, Vasant Hegde wrote:
> > @@ -2375,24 +2375,25 @@ amd_iommu_domain_alloc_paging_flags(struct device *dev, u32 flags,
> > if ((flags & ~supported_flags) || user_data)
^^^^^^
> > return ERR_PTR(-EOPNOTSUPP);
> >
> > - /* Allocate domain with v2 page table if IOMMU supports PASID. */
> > - if (flags & IOMMU_HWPT_ALLOC_PASID) {
> > + switch (flags &
> > + (IOMMU_HWPT_ALLOC_PASID | IOMMU_HWPT_ALLOC_DIRTY_TRACKING)) {
>
> Better use supported_flags. Otherwise patch looks good to me.
> With that
For now we can just delete it since we already checked that flags
can't be outside that range.
Maybe when new flags are added it will need to come back someday
- switch (flags &
- (IOMMU_HWPT_ALLOC_PASID | IOMMU_HWPT_ALLOC_DIRTY_TRACKING)) {
+ switch (flags & supported_flags) {
Thanks,
Jason
next prev parent reply other threads:[~2025-01-09 17:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 0:23 [PATCH 0/7] iommu/amd: Cleanup some of the domain_alloc_paging path Jason Gunthorpe
2024-12-06 0:23 ` [PATCH 1/7] iommu/amd: Remove unused amd_iommu_domain_update() Jason Gunthorpe
2025-01-06 11:09 ` Vasant Hegde
2024-12-06 0:23 ` [PATCH 2/7] iommu/amd: Remove domain_alloc() Jason Gunthorpe
2025-01-06 14:04 ` Vasant Hegde
2024-12-06 0:23 ` [PATCH 3/7] iommu/amd: Remove dev == NULL checks Jason Gunthorpe
2025-01-06 14:33 ` Vasant Hegde
2024-12-06 0:23 ` [PATCH 4/7] iommu/amd: Remove type argument from do_iommu_domain_alloc() and related Jason Gunthorpe
2025-01-06 14:54 ` Vasant Hegde
2024-12-06 0:23 ` [PATCH 5/7] iommu/amd: Change amd_iommu_pgtable to use enum protection_domain_mode Jason Gunthorpe
2025-01-07 9:39 ` Vasant Hegde
2024-12-06 0:23 ` [PATCH 6/7] iommu/amd: Move the nid to pdom_setup_pgtable() Jason Gunthorpe
2025-01-07 9:43 ` Vasant Hegde
2024-12-06 0:23 ` [PATCH 7/7] iommu/amd: Fully decode all combinations of alloc_paging_flags Jason Gunthorpe
2025-01-07 10:47 ` Vasant Hegde
2025-01-09 17:17 ` Jason Gunthorpe [this message]
2025-01-07 10:51 ` [PATCH 0/7] iommu/amd: Cleanup some of the domain_alloc_paging path Vasant Hegde
2025-01-09 17:18 ` Jason Gunthorpe
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=20250109171726.GA396083@nvidia.com \
--to=jgg@nvidia.com \
--cc=alejandro.j.jimenez@oracle.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=jroedel@suse.de \
--cc=kevin.tian@intel.com \
--cc=patches@lists.linux.dev \
--cc=robin.murphy@arm.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=vasant.hegde@amd.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.