[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFpduJmdcru6r1kd@yilunxu-OptiPlex-7050>
Date: Tue, 24 Jun 2025 16:11:36 +0800
From: Xu Yilun <yilun.xu@...ux.intel.com>
To: Baolu Lu <baolu.lu@...ux.intel.com>
Cc: jgg@...dia.com, jgg@...pe.ca, kevin.tian@...el.com, will@...nel.org,
aneesh.kumar@...nel.org, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org, joro@...tes.org, robin.murphy@....com,
shuah@...nel.org, nicolinc@...dia.com, aik@....com,
dan.j.williams@...el.com, yilun.xu@...el.com
Subject: Re: [PATCH v2 3/4] iommufd: Destroy vdevice on idevice destroy
On Tue, Jun 24, 2025 at 11:32:01AM +0800, Baolu Lu wrote:
> On 6/23/25 17:49, Xu Yilun wrote:
> > Destroy iommufd_vdevice(vdev) on iommufd_idevice(idev) destroy so that
> > vdev can't outlive idev.
> >
> > iommufd_device(idev) represents the physical device bound to iommufd,
> > while the iommufd_vdevice(vdev) represents the virtual instance of the
> > physical device in the VM. The lifecycle of the vdev should not be
> > longer than idev. This doesn't cause real problem on existing use cases
> > cause vdev doesn't impact the physical device, only provides
> > virtualization information. But to extend vdev for Confidential
> > Computing(CC), there are needs to do secure configuration for the vdev,
> > e.g. TSM Bind/Unbind. These configurations should be rolled back on idev
> > destroy, or the external driver(VFIO) functionality may be impact.
> >
> > Building the association between idev & vdev requires the two objects
> > pointing each other, but not referencing each other.
>
> Does this mean each idevice can have at most a single vdevice? Is it
Yes, I got this idea from here.
https://lore.kernel.org/all/20250604132403.GJ5028@nvidia.com/
> possible that different PASIDs of a physical device are assigned to
> userspace for different purposes, such that there is a need for multiple
> vdevices per idevice?
Mm.. I don't have a clear idea how SIOV assignment work with iommufd,
may come back later.
Thanks,
Yilun
Powered by blists - more mailing lists