[PATCH 1/6] mdev: class id support

Jason Wang
Tue, 24 Sep 2019 11:23:16 -0000

On 2019/9/24 ??5:02, Parav Pandit wrote:
> Hi Jason,
>
>
>> -----Original Message-----
>> From: Jason Wang <jasowang at redhat.com>
>> Sent: Monday, September 23, 2019 8:03 AM
>> To: kvm at vger.kernel.org; linux-s390 at vger.kernel.org; linux-
>> kernel at vger.kernel.org; dri-devel at lists.freedesktop.org; intel-
>> gfx at lists.freedesktop.org; intel-gvt-dev at lists.freedesktop.org;
>> kwankhede at nvidia.com; alex.williamson at redhat.com; mst at
redhat.com;
>> tiwei.bie at intel.com
>> Cc: virtualization at lists.linux-foundation.org; netdev at
vger.kernel.org;
>> cohuck at redhat.com; maxime.coquelin at redhat.com;
>> cunming.liang at intel.com; zhihong.wang at intel.com;
>> rob.miller at broadcom.com; xiao.w.wang at intel.com;
>> haotian.wang at sifive.com; zhenyuw at linux.intel.com; zhi.a.wang at
intel.com;
>> jani.nikula at linux.intel.com; joonas.lahtinen at linux.intel.com;
>> rodrigo.vivi at intel.com; airlied at linux.ie; daniel at ffwll.ch;
>> farman at linux.ibm.com; pasic at linux.ibm.com; sebott at
linux.ibm.com;
>> oberpar at linux.ibm.com; heiko.carstens at de.ibm.com; gor at
linux.ibm.com;
>> borntraeger at de.ibm.com; akrowiak at linux.ibm.com; freude at
linux.ibm.com;
>> lingshan.zhu at intel.com; Ido Shamay <idos at mellanox.com>;
>> eperezma at redhat.com; lulu at redhat.com; Parav Pandit
>> <parav at mellanox.com>; Jason Wang <jasowang at
redhat.com>
>> Subject: [PATCH 1/6] mdev: class id support
>>
>> Mdev bus only supports vfio driver right now, so it doesn't
implement match
>> method. But in the future, we may add drivers other than vfio, one
example is
>> virtio-mdev[1] driver. This means we need to add device class id
support in bus
>> match method to pair the mdev device and mdev driver correctly.
>>
>> So this patch adds id_table to mdev_driver and class_id for mdev parent
with
>> the match method for mdev bus.
>>
>> Signed-off-by: Jason Wang <jasowang at redhat.com>
>> ---
>>  Documentation/driver-api/vfio-mediated-device.rst |  7 +++++--
>>  drivers/gpu/drm/i915/gvt/kvmgt.c                  |  2 +-
>>  drivers/s390/cio/vfio_ccw_ops.c                   |  2 +-
>>  drivers/s390/crypto/vfio_ap_ops.c                 |  3 ++-
>>  drivers/vfio/mdev/mdev_core.c                     | 14 ++++++++++++--
>>  drivers/vfio/mdev/mdev_driver.c                   | 14 ++++++++++++++
>>  drivers/vfio/mdev/mdev_private.h                  |  1 +
>>  drivers/vfio/mdev/vfio_mdev.c                     |  6 ++++++
>>  include/linux/mdev.h                              |  7 ++++++-
>>  include/linux/mod_devicetable.h                   |  8 ++++++++
>>  samples/vfio-mdev/mbochs.c                        |  2 +-
>>  samples/vfio-mdev/mdpy.c                          |  2 +-
>>  samples/vfio-mdev/mtty.c                          |  2 +-
>>  13 files changed, 59 insertions(+), 11 deletions(-)
>>
> You additionally need modpost support for id table integration to modifo,
modprobe and other tools.
> A small patch similar to this one [1] is needed.
> Please include in the series.
>
> [1] https://lore.kernel.org/patchwork/patch/1046991/


My understanding is this could be done on top and may require uevent
support for the bus. I can try to implement this in V2.

Thanks

>
>