All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: joro@8bytes.org, will@kernel.org, iommu@lists.linux.dev,
	baolu.lu@linux.intel.com, linux-kernel@vger.kernel.org,
	jsnitsel@redhat.com
Subject: Re: [PATCH v6 3/7] iommu: Validate that devices match domains
Date: Tue, 21 Nov 2023 14:52:32 -0400	[thread overview]
Message-ID: <20231121185232.GI6083@nvidia.com> (raw)
In-Reply-To: <097c6f30480e4efe12195d00ba0e84ea4837fb4c.1700589539.git.robin.murphy@arm.com>

On Tue, Nov 21, 2023 at 06:03:59PM +0000, Robin Murphy wrote:
> Before we can allow drivers to coexist, we need to make sure that one
> driver's domain ops can't misinterpret another driver's dev_iommu_priv
> data. To that end, add a token to the domain so we can remember how it
> was allocated - for now this may as well be the device ops, since they
> still correlate 1:1 with drivers. We can trust ourselves for internal
> default domain attachment, so add checks to cover all the public attach
> interfaces.
> 
> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> 
> ---
> 
> v4: Cover iommu_attach_device_pasid() as well, and improve robustness
>     against theoretical attempts to attach a noiommu group.
> v6: Cover new iommu_domain_alloc_user() sites as well. I don't entirely
>     dislike the idea of tying this into the domain ops, but I'd rather
>     do the simple thing for now and revisit that in future, since domain
>     ops also deserve some other cleanup.

Looks good

Jason

  reply	other threads:[~2023-11-21 18:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 18:03 [PATCH v6 0/7] iommu: Retire bus ops Robin Murphy
2023-11-21 18:03 ` [PATCH v6 1/7] iommu: Factor out some helpers Robin Murphy
2023-11-21 18:03 ` [PATCH v6 2/7] iommu: Decouple iommu_present() from bus ops Robin Murphy
2023-11-21 18:03 ` [PATCH v6 3/7] iommu: Validate that devices match domains Robin Murphy
2023-11-21 18:52   ` Jason Gunthorpe [this message]
2023-11-21 18:04 ` [PATCH v6 4/7] iommu: Decouple iommu_domain_alloc() from bus ops Robin Murphy
2023-11-22  1:51   ` Baolu Lu
2023-11-21 18:04 ` [PATCH v6 5/7] iommu/arm-smmu: Don't register fwnode for legacy binding Robin Murphy
2023-11-21 18:04 ` [PATCH v6 6/7] iommu: Retire bus ops Robin Murphy
2023-11-21 18:04 ` [PATCH v6 7/7] iommu: Clean up open-coded ownership checks Robin Murphy
2023-11-27 10:03 ` [PATCH v6 0/7] iommu: Retire bus ops 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=20231121185232.GI6083@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=jsnitsel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@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 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.