Re: [PATCH v3 12/13] PCI/TSM: support TDI related operations for host TSM driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Xu Yilun wrote:
[..]
> This field is intended for out-of-blob values, like fw_ret. But fw_ret
> is specified in GHCB and is vendor specific. Other vendors may also
> have different values of this kind.
> 
> So I intend to gather these out-of-blob values in type_info, like:
> 
> enum pci_tsm_guest_req_type {
>   PCI_TSM_GUEST_REQ_TDXC,
>   PCI_TSM_GUEST_REQ_SEV_SNP,
> };
> 
> /* SEV SNP guest request type info */
> struct pci_tsm_guest_req_sev_snp {
> 	s32 fw_err;
> };
> 
> Since IOMMUFD has the userspace entry, maybe these definitions should be
> moved to include/uapi/linux/iommufd.h.
> 
> In pci-tsm.h, just define:
> 
> struct pci_tsm_guest_req_info {
> 	u32 type;
> 	void __user *type_info;
> 	size_t type_info_len;
> 	void __user *req;
> 	size_t req_len;
> 	void __user *resp;
> 	size_t resp_len;
> };
> 
> BTW: TDX Connect has no out-of-blob value, so should set type_info_len = 0

2 comments:

No, I do not think 'struct pci_tsm_guest_req_info' needs the
sophistication of a "type-info + type-info-len" scheme. Just make it a
64-bit @fw_ret property. The kernel has no need for that value, and
there is nothing to indicate it needs to be larger than 64-bit. Both
ends of the pipe understand what @fw_ret might contain.

Yes, this envelope definition belongs in a uapi header.




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux