* RE: [PATCH v4 4/4] iommufd/vdevice: add TSM guest request ioctl [not found] ` <20260428124854.GA849557@ziepe.ca> @ 2026-05-08 3:12 ` Tian, Kevin 2026-05-08 4:12 ` Aneesh Kumar K.V 0 siblings, 1 reply; 2+ messages in thread From: Tian, Kevin @ 2026-05-08 3:12 UTC (permalink / raw) To: Jason Gunthorpe, Aneesh Kumar K.V Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Alexey Kardashevskiy, Bjorn Helgaas, Dan Williams, Joerg Roedel, Jonathan Cameron, Nicolin Chen, Samuel Ortiz, Steven Price, Suzuki K Poulose, Will Deacon, Xu Yilun, Shameer Kolothum > From: Jason Gunthorpe <jgg@ziepe.ca> > Sent: Tuesday, April 28, 2026 8:49 PM > > On Tue, Apr 28, 2026 at 05:43:05PM +0530, Aneesh Kumar K.V wrote: > > Jason Gunthorpe <jgg@ziepe.ca> writes: > > > > > On Mon, Apr 27, 2026 at 11:40:05AM +0530, Aneesh Kumar K.V (Arm) > wrote: > > >> +/** > > >> + * struct iommu_vdevice_tsm_guest_request - > ioctl(IOMMU_VDEVICE_TSM_GUEST_REQUEST) > > >> + * @size: sizeof(struct iommu_vdevice_tsm_guest_request) > > >> + * @vdevice_id: vDevice ID the guest request is for > > >> + * @scope: Bus-specific scope classification for the guest request > > >> + * @req_len: Size in bytes of the input payload at @req_uptr > > >> + * @resp_len: Size in bytes of the output buffer at @resp_uptr > > >> + * @__reserved: Must be 0 > > >> + * @req_uptr: Userspace pointer to the guest-provided request > payload > > >> + * @resp_uptr: Userspace pointer to the guest response buffer > > >> + * > > >> + * Forward a guest request to the TSM bound vDevice. This is intended > for > > >> + * guest TSM/TDISP message transport where the host kernel only > marshals > > >> + * bytes between userspace and the TSM implementation. > > >> + * > > >> + * The meaning and valid values of @scope are defined by the TSM > backend for > > >> + * the device bus type. > > > > > > If you want to do this then you have to also provide a way to discover > > > what the TSM backend is so userspace can form the correct numbers. > > > > > > > These guest-driven requests end up in the correct VMM backend, which > > should already be aware of the scope value to use. In the case of ARM > > CCA, the RHI calls include a device ID (vdev_id), which the VMM can use > > to determine the appropriate scope value. > > That seems kind of indirect, we technically support multiple TSMs in > the kernel, how does it all get reconciled? > > Passing overlapping numbers here without any way to tell them apart is > not a good uapi design. > Agree. another thing is, as I replied to last version, what about userspace providing a wrong scope value then what would be the consequence... ^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH v4 4/4] iommufd/vdevice: add TSM guest request ioctl 2026-05-08 3:12 ` [PATCH v4 4/4] iommufd/vdevice: add TSM guest request ioctl Tian, Kevin @ 2026-05-08 4:12 ` Aneesh Kumar K.V 0 siblings, 0 replies; 2+ messages in thread From: Aneesh Kumar K.V @ 2026-05-08 4:12 UTC (permalink / raw) To: Tian, Kevin, Jason Gunthorpe Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Alexey Kardashevskiy, Bjorn Helgaas, Dan Williams, Joerg Roedel, Jonathan Cameron, Nicolin Chen, Samuel Ortiz, Steven Price, Suzuki K Poulose, Will Deacon, Xu Yilun, Shameer Kolothum, djbw "Tian, Kevin" <kevin.tian@intel.com> writes: >> From: Jason Gunthorpe <jgg@ziepe.ca> >> Sent: Tuesday, April 28, 2026 8:49 PM >> >> On Tue, Apr 28, 2026 at 05:43:05PM +0530, Aneesh Kumar K.V wrote: >> > Jason Gunthorpe <jgg@ziepe.ca> writes: >> > >> > > On Mon, Apr 27, 2026 at 11:40:05AM +0530, Aneesh Kumar K.V (Arm) >> wrote: >> > >> +/** >> > >> + * struct iommu_vdevice_tsm_guest_request - >> ioctl(IOMMU_VDEVICE_TSM_GUEST_REQUEST) >> > >> + * @size: sizeof(struct iommu_vdevice_tsm_guest_request) >> > >> + * @vdevice_id: vDevice ID the guest request is for >> > >> + * @scope: Bus-specific scope classification for the guest request >> > >> + * @req_len: Size in bytes of the input payload at @req_uptr >> > >> + * @resp_len: Size in bytes of the output buffer at @resp_uptr >> > >> + * @__reserved: Must be 0 >> > >> + * @req_uptr: Userspace pointer to the guest-provided request >> payload >> > >> + * @resp_uptr: Userspace pointer to the guest response buffer >> > >> + * >> > >> + * Forward a guest request to the TSM bound vDevice. This is intended >> for >> > >> + * guest TSM/TDISP message transport where the host kernel only >> marshals >> > >> + * bytes between userspace and the TSM implementation. >> > >> + * >> > >> + * The meaning and valid values of @scope are defined by the TSM >> backend for >> > >> + * the device bus type. >> > > >> > > If you want to do this then you have to also provide a way to discover >> > > what the TSM backend is so userspace can form the correct numbers. >> > > >> > >> > These guest-driven requests end up in the correct VMM backend, which >> > should already be aware of the scope value to use. In the case of ARM >> > CCA, the RHI calls include a device ID (vdev_id), which the VMM can use >> > to determine the appropriate scope value. >> >> That seems kind of indirect, we technically support multiple TSMs in >> the kernel, how does it all get reconciled? >> >> Passing overlapping numbers here without any way to tell them apart is >> not a good uapi design. >> > > Agree. another thing is, as I replied to last version, what about userspace > providing a wrong scope value then what would be the consequence... I will wait for Dan’s feedback on how we should handle the scope. We may have to move that to the generic headers as part of the TSM patchset. Regarding what happens when an invalid scope is passed: tsm_guest_req() currently only handles pci_device, and the backend driver’s pci_tsm_guest_req() callback will reject unsupported scope values. I understand that we may want to add some checks in the generic ioctl handler once these scope values are moved out of PCI TSM. -aneesh ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-08 4:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260427061005.901854-1-aneesh.kumar@kernel.org>
[not found] ` <20260427061005.901854-5-aneesh.kumar@kernel.org>
[not found] ` <20260427140539.GE740385@ziepe.ca>
[not found] ` <yq5acxzj1dwu.fsf@kernel.org>
[not found] ` <20260428124854.GA849557@ziepe.ca>
2026-05-08 3:12 ` [PATCH v4 4/4] iommufd/vdevice: add TSM guest request ioctl Tian, Kevin
2026-05-08 4:12 ` Aneesh Kumar K.V
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox