Re: [PATCH 1/7] PCI/TSM: Add pci_tsm_{bind,unbind}() methods for instantiating TDIs

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

 



Aneesh Kumar K.V wrote:
[..]
> Can we add tsm_bind/unbind so that we can call tsm function from iommufd instead of
> pci specific functions like pci_tsm_bind()?
> 
> modified   drivers/virt/coco/tsm-core.c
> @@ -193,6 +193,24 @@ void tsm_ide_stream_unregister(struct pci_ide *ide)
>  }
>  EXPORT_SYMBOL_GPL(tsm_ide_stream_unregister);
>  
> +int tsm_bind(struct device *dev, struct kvm *kvm, u64 tdi_id)
> +{
> +	if (!dev_is_pci(dev))
> +		return -EINVAL;
> +
> +	return pci_tsm_bind(to_pci_dev(dev), kvm, tdi_id);
> +}
> +EXPORT_SYMBOL_GPL(tsm_bind);

I do not immediately understand the value of this. dev_is_pci() and
to_pci_dev() are already EXPORT_SYMBOL functionality. Why do they need
to be wrapped in a new EXPORT_SYMBOL_GPL wrapper that validates the
device is PCI?

If this is really needed it can do in the follow-on patch that adds the
iommufd hookup.




[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