All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>, Vasant Hegde <vasant.hegde@amd.com>
Cc: baolu.lu@linux.intel.com, iommu@lists.linux.dev, joro@8bytes.org,
	will@kernel.org, robin.murphy@arm.com,
	suravee.suthikulpanit@amd.com, yi.l.liu@intel.com
Subject: Re: [PATCH RFCv2] iommu: Add domain type and flag to domain_alloc_paging()
Date: Wed, 7 Aug 2024 13:49:02 +0800	[thread overview]
Message-ID: <2c537d82-c511-4367-8a5c-29122745326d@linux.intel.com> (raw)
In-Reply-To: <20240806173230.GS676757@ziepe.ca>

On 2024/8/7 1:32, Jason Gunthorpe wrote:
> On Tue, Aug 06, 2024 at 08:11:19PM +0530, Vasant Hegde wrote:
> 
>> I only have issue with allocating right page table for UNMANAGED domain. In this
>> case just 'dev' param is not sufficient. Ops should send some sort of indication
>> that its UNMANAGED domain (like its non DMA API domain). Otherwise AMD driver
>> cannot allocate right page table.
> Be specific, you mean when VFIO allocates it because VFIO is almost
> the exclusive user of UNMANAGED domains on x86 hardware.
> 
>> My understanding is we essentially have two modes for device passthrough.
>>    1 - Existing interface where vfio driver manages page table (call
>> iommu_paging_domain_alloc()). No PASID support in this mode.
>>    With this RFC I am trying to solve this scenario.
> Honestly I'd prefer you change VFIO type 1 to call domain_alloc_user()
> instead of hacking domain_alloc_paging().
> 
> This is a lot more explicit than trying to push new meaning onto
> UNMANAGED which is trying to get itself removed.
> 
>>    2 - via iommufd - It will use domain_alloc_user() ops. This is the interface
>> where we want to support PASID w/ passthrough device.
>>
>>     This is where you/Yi suggested to start discussing with Alex on Yi's PASID
>> support series. I am running behind. I will start looking into Yi's thread soon.
>>
>> Is my understanding correct?
> Broadly, but I'd rather VFIO exclusively use domain_alloc_user() and
> it can accomodate both cases. So add a flag to indicate if PASID
> should be enabled.
> 
> It makes sense to me that type 1 would just always disable PASID
> support, it should just be done explicitly without the word
> "UNMANAGED".

Convert paging domain to user domain allocation appears to be a
reasonable solution. But I think it's not VFIO-only, vhost-vdpa is
another case, right?

Thanks,
baolu

  reply	other threads:[~2024-08-07  5:49 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-01 14:45 [PATCH RFCv2] iommu: Add domain type and flag to domain_alloc_paging() Vasant Hegde
2024-08-02  0:44 ` Baolu Lu
2024-08-02  5:53   ` Vasant Hegde
2024-08-06 12:34     ` Jason Gunthorpe
2024-08-06 14:41       ` Vasant Hegde
2024-08-06 17:32         ` Jason Gunthorpe
2024-08-07  5:49           ` Baolu Lu [this message]
2024-08-07  9:32             ` Vasant Hegde
2024-08-07 12:33             ` Jason Gunthorpe
2024-08-07  9:30           ` Vasant Hegde
2024-08-07 13:59             ` Jason Gunthorpe
2024-08-07 16:52               ` Vasant Hegde
2024-08-07 18:29                 ` Jason Gunthorpe
2024-08-08  1:16                   ` Jason Gunthorpe
2024-08-08 13:08                     ` Jason Gunthorpe
2024-08-09  6:43                       ` Vasant Hegde
2024-08-09 13:44                         ` Jason Gunthorpe
2024-08-12  9:21                           ` Vasant Hegde
2024-08-13 16:22                             ` Jason Gunthorpe
2024-08-14 10:54                               ` Vasant Hegde
2024-08-09  5:36                   ` Vasant Hegde
2024-08-12 12:07                   ` Yi Liu
2024-08-13  9:40                   ` Tian, Kevin
2024-08-13 16:20                     ` Jason Gunthorpe
2024-08-14  2:38                       ` Tian, Kevin
2024-08-14 22:40                         ` Jason Gunthorpe
2024-08-15  3:28                           ` Vasant Hegde
2024-08-15  4:58                             ` Yi Liu
2024-08-15 13:06                               ` Jason Gunthorpe
2024-08-16 11:59                                 ` Yi Liu
2024-08-15  4:59                             ` Baolu Lu
2024-08-15 13:47                               ` Jason Gunthorpe
2024-08-16  8:17                                 ` Vasant Hegde
2024-08-16 12:01                                   ` Yi Liu
2024-08-16 18:37                                   ` Jason Gunthorpe
2024-08-19  8:27                                     ` Vasant Hegde
2024-08-19 17:52                                       ` Jason Gunthorpe
2024-08-20  8:18                                         ` Vasant Hegde
2024-08-15 13:05                             ` Jason Gunthorpe
2024-08-12 12:01               ` Yi Liu

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=2c537d82-c511-4367-8a5c-29122745326d@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    --cc=will@kernel.org \
    --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 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.