> > Could there be a situation where we need to know if a particular VFIO > > subsystem is enabled? Do you think it's worth adding (e.g. > > vfio_enabled |= VFIO_PCI_ENABLED or something)? (I don't imply it is > > necessary, just asking) > > Well... the semantics are quite tricky here. > > There are: vfio-pci, vfio-platform and vfio-amba in the Linux Kernel. I ignore > vfio-amba because I don't know any considerable device supported by this. > > With respect to the VFIO, if you have both PCI and SoC infra enabled, you > have to check for both vfio-pci and vfio-platform. > > If only PCI is there you have to check only for vfio-pci. > But, if you check for vfio-platform as well and it is not there then the EAL > init > would fail without a reason (because you don't need vfio-platform). Vice- > versa for SoC. > > This patch improves the check to cover those situations. Later on, I'll just > append something like: > > if (!internal_config.no_soc) { > soc_vfio_enable(); > vfio_enabled |= soc_vfio_is_enabled(); > } > > and the EAL init would be happy... I hope ;). > > The thing is that we don't know which devices will bind to VFIO and we don't > know which of those devices would use vfio-pci and vfio-platform. > So, if both PCI and SoC are enabled and only vfio-platform is there we cannot > say here "failed because vfio-pci is missing".
OK fair enough :) I haven't yet tested the patchset itself, I'll report back if I get any issues. Thanks, Anatoly