diff options
author | Kirti Wankhede <kwankhede@nvidia.com> | 2016-11-17 02:16:14 +0530 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2016-11-17 08:24:50 -0700 |
commit | fa3da00cb8c0d403030f4805ae615b444f0d2f3c (patch) | |
tree | b4235ea4d0bb2f48a3742d06727facda15cf4ca3 /drivers/vfio/mdev/mdev_core.c | |
parent | 7b96953bc640b6b25665fe17ffca4b668b371f14 (diff) | |
download | linux-fa3da00cb8c0d403030f4805ae615b444f0d2f3c.tar.gz linux-fa3da00cb8c0d403030f4805ae615b444f0d2f3c.tar.bz2 linux-fa3da00cb8c0d403030f4805ae615b444f0d2f3c.zip |
vfio: VFIO based driver for Mediated devices
vfio_mdev driver registers with mdev core driver.
mdev core driver creates mediated device and calls probe routine of
vfio_mdev driver for each device.
Probe routine of vfio_mdev driver adds mediated device to VFIO core module
This driver forms a shim layer that pass through VFIO devices operations
to vendor driver for mediated devices.
Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Signed-off-by: Neo Jia <cjia@nvidia.com>
Reviewed-by: Jike Song <jike.song@intel.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/mdev/mdev_core.c')
-rw-r--r-- | drivers/vfio/mdev/mdev_core.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index 613e8a8a3b2a..be1ee89ee917 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c @@ -354,7 +354,18 @@ int mdev_device_remove(struct device *dev, bool force_remove) static int __init mdev_init(void) { - return mdev_bus_register(); + int ret; + + ret = mdev_bus_register(); + + /* + * Attempt to load known vfio_mdev. This gives us a working environment + * without the user needing to explicitly load vfio_mdev driver. + */ + if (!ret) + request_module_nowait("vfio_mdev"); + + return ret; } static void __exit mdev_exit(void) |