All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Vasant Hegde <vasant.hegde@amd.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	"Tian, Kevin" <kevin.tian@intel.com>
Cc: baolu.lu@linux.intel.com,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"will@kernel.org" <will@kernel.org>,
	"robin.murphy@arm.com" <robin.murphy@arm.com>,
	"suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>,
	"Liu, Yi L" <yi.l.liu@intel.com>,
	Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [PATCH RFCv2] iommu: Add domain type and flag to domain_alloc_paging()
Date: Thu, 15 Aug 2024 12:59:13 +0800	[thread overview]
Message-ID: <60778628-2b2c-4671-b1c6-276db3cd42ea@linux.intel.com> (raw)
In-Reply-To: <ad009d03-9a38-4b0e-ac90-13bd8ea0b191@amd.com>

On 2024/8/15 11:28, Vasant Hegde wrote:
> Jason, Kevin,
> 
> 
> On 8/15/2024 4:10 AM, Jason Gunthorpe wrote:
>> On Wed, Aug 14, 2024 at 02:38:58AM +0000, Tian, Kevin wrote:
>>
>>>> Flags = 0 means the domain cannot be attached to a PASID
>>>> Flags = 0 means the domain cannot be attached to the RID while PASID
>>>> is in use
>>>  From my understanding there are only two type of formats so far:
>>>
>>>    - a format only working with RID (V1 in AMD, S2 in ARM)
>>>    - a format working with both RID and PASID (V2 in AMD, S1 in ARM,
>>>     S1/S2 in Intel)
>>>
>>> With that in mind we only need one bit to indicate whether a domain
>>> allows PASID attach. The user learns the PASID capability via
>>> GET_HW_INFO and should set or clear the PASID flag consistently
>>> for all non-nesting domains attached to a same device (RID, or RID+PASID).
>>>
>>> for AMD/ARM this consistency is mandatory as one device can only be
>>> configured to a single format. no mix.
>>>
>>> for Intel there's more flexibility but I don't see a reason to mix S1/S2
>>> between RID and PASID, and now both are fixed to S2 for UNMANAGED.
>>>
>>>> The core code should enforce this rule always.
>>>>
>>>> Above that we minimally need
>>>>
>>>> Flags = IOMMU_HWPT_ALLOC_PASID allows the domain to be attached to a
>>>> PASID
>>>>
>>>> And you need to decide if the RID usage is bundled with the above as
>>>> well.
>>> A single bit IOMMU_HWPT_ALLOC_PASID is what I meant. Setting it
>>> means the domain can be attached to both RID and PASID, i.e. RID
>>> attach is always implied.
>> OK, lets try it like that then
>>
>> I also know of no HW that would need it to be different on the RID
> Ok. Single macro with `IOMMU_HWPT_ALLOC_PASID` which allocates PASID capable
> domain if both IOMMU and device supports the feature. If not allocate normal
> domain -OR- return error?
> 
> Also I would assume we want to enhance iommufd_get_hw_info ioctl to get device
> PASID capability. Is that correct?

I suppose that this also includes converting paging domain to user
domain allocation in VFIO (ideally vhost-vdpa as well), right?

Thanks,
baolu

  parent reply	other threads:[~2024-08-15  4:59 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
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 [this message]
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=60778628-2b2c-4671-b1c6-276db3cd42ea@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --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.