Linux IOMMU Development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Yi Liu <yi.l.liu@intel.com>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>
Subject: Re: Two opens about iommufd pasid + IOPF
Date: Fri, 16 Aug 2024 09:47:07 -0300	[thread overview]
Message-ID: <20240816124707.GZ2032816@nvidia.com> (raw)
In-Reply-To: <0bf383b7-ed96-49ca-b1da-d1fff48e161a@intel.com>

On Fri, Aug 16, 2024 at 07:50:05PM +0800, Yi Liu wrote:
> Hi Kevin, Baolu, Jason,
> 
> I've got two opens when rebasing iommufd pasid series on top of 6.11.
> Would like to hear about your ideas. :)
> 
> 1) How to retrieve attached domain for pasid in the iommu core. This is
>    needed when adding domain replacement for pasid. In the before, it can
>    be done by searching the group->pasid_array[1]. However, the
>    group->pasid_array stores iommu_attach_handle after the iopf patch [2].
>    IIUC, iommu_attach_handle is passed only when the domain is
>    iopf-capable. So, if the old domain does not support iopf, then it's not
>    able to get this old domain from the group->pasid_array when trying to
>    do domain replacement. :(
>    Not sure if any side-effect if I always pass an iommu_attach_handle even
>    if the hwpt/domain is not iopf-capable. @Baolu?

You should always pass the handle

Alternatively you could use the xa based encoding I showed earlier to
store either handles or naked domains in the xarray. But really it
seems just fine to have iommufd allocate handle memory

> 2) Should I enable/disable IOPF when attaching/detaching pasid to/from
>    domains just like patch [3] does?
> 
> [1] https://lore.kernel.org/linux-iommu/20240628090557.50898-2-yi.l.liu@intel.com/
> [2] https://lore.kernel.org/linux-iommu/20240702063444.105814-2-baolu.lu@linux.intel.com/
> [3] https://lore.kernel.org/linux-iommu/20240702063444.105814-8-baolu.lu@linux.intel.com/

I would really like to remove IOMMU_DEV_FEAT_IOPF...

Jason

  reply	other threads:[~2024-08-16 12:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-16 11:50 Two opens about iommufd pasid + IOPF Yi Liu
2024-08-16 12:47 ` Jason Gunthorpe [this message]
2024-08-16 13:05   ` 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=20240816124707.GZ2032816@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=kevin.tian@intel.com \
    --cc=yi.l.liu@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