Re: [PATCH 1/5] vfio/iommu_type1: Fixes vfio_dma_populate_bitmap to avoid dirty lose

2021-01-13 Thread Kirti Wankhede
On 1/13/2021 2:50 AM, Alex Williamson wrote: On Thu, 7 Jan 2021 17:28:57 +0800 Keqian Zhu wrote: Defer checking whether vfio_dma is of fully-dirty in update_user_bitmap is easy to lose dirty log. For example, after promoting pinned_scope of vfio_iommu, vfio_dma is not considered as fully-di

Re: [PATCH] vfio: Fix typo of the device_state

2020-09-11 Thread Kirti Wankhede
Ops. Thanks for fixing it. Reviewed-by: Kirti Wankhede On 9/10/2020 5:55 PM, Zenghui Yu wrote: A typo fix ("_RUNNNG" => "_RUNNING") in comment block of the uapi header. Signed-off-by: Zenghui Yu --- include/uapi/linux/vfio.h | 2 +- 1 file changed, 1 insertion(

Re: [PATCH] vfio/type1: Fix migration info capability ID

2020-06-19 Thread Kirti Wankhede
On 6/19/2020 12:42 AM, Alex Williamson wrote: ID 1 is already used by the IOVA range capability, use ID 2. Ops. Thanks for Fixing it. Reviewed-by: Kirti Wankhede Reported-by: Liu Yi L Cc: Kirti Wankhede Fixes: ad721705d09c ("vfio iommu: Add migration capability to report supp

Re: [PATCH] vfio/mdev: Fix reference count leak in add_mdev_supported_type.

2020-05-29 Thread Kirti Wankhede
rtion(+), 1 deletion(-) Reviewed-by: Cornelia Huck Thanks for fixing. Reviewed-by: Kirti Wankhede

Re: [PATCH v2 0/2] Simplify mtty driver and mdev core

2019-08-12 Thread Kirti Wankhede
On 8/9/2019 4:32 AM, Alex Williamson wrote: > On Thu, 8 Aug 2019 09:12:53 -0500 > Parav Pandit wrote: > >> Currently mtty sample driver uses mdev state and UUID in convoluated way to >> generate an interrupt. >> It uses several translations from mdev_state to mdev_device to mdev uuid. >> Afte

Re: [PATCH v3] mdev: Send uevents around parent device registration

2019-07-10 Thread Kirti Wankhede
mment clarifying expected device requirements for unreg > Reviewed-by: Kirti Wankhede Thanks, Kirti > drivers/vfio/mdev/mdev_core.c |9 + > 1 file changed, 9 insertions(+) > > diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c > index ae2315144

Re: [PATCH v2] mdev: Send uevents around parent device registration

2019-07-02 Thread Kirti Wankhede
On 7/2/2019 8:13 PM, Alex Williamson wrote: > On Tue, 2 Jul 2019 19:10:17 +0530 > Kirti Wankhede wrote: > >> On 7/2/2019 6:38 PM, Alex Williamson wrote: >>> On Tue, 2 Jul 2019 18:17:41 +0530 >>> Kirti Wankhede wrote: >>> >

Re: [PATCH v2] mdev: Send uevents around parent device registration

2019-07-02 Thread Kirti Wankhede
On 7/2/2019 6:38 PM, Alex Williamson wrote: > On Tue, 2 Jul 2019 18:17:41 +0530 > Kirti Wankhede wrote: > >> On 7/2/2019 12:43 PM, Parav Pandit wrote: >>> >>> >>>> -Original Message- >>>> From: linux-kernel-ow...@vge

Re: [PATCH v2] mdev: Send uevents around parent device registration

2019-07-02 Thread Kirti Wankhede
On 7/2/2019 12:43 PM, Parav Pandit wrote: > > >> -Original Message- >> From: linux-kernel-ow...@vger.kernel.org > ow...@vger.kernel.org> On Behalf Of Alex Williamson >> Sent: Tuesday, July 2, 2019 11:12 AM >> To: Kirti Wankhede >> Cc: coh.

Re: [PATCH v2] mdev: Send uevents around parent device registration

2019-07-01 Thread Kirti Wankhede
On 7/2/2019 1:34 AM, Alex Williamson wrote: > On Mon, 1 Jul 2019 23:20:35 +0530 > Kirti Wankhede wrote: > >> On 7/1/2019 10:54 PM, Alex Williamson wrote: >>> On Mon, 1 Jul 2019 22:43:10 +0530 >>> Kirti Wankhede wrote: >>> >>>> On

Re: [PATCH v2] mdev: Send uevents around parent device registration

2019-07-01 Thread Kirti Wankhede
On 7/1/2019 10:54 PM, Alex Williamson wrote: > On Mon, 1 Jul 2019 22:43:10 +0530 > Kirti Wankhede wrote: > >> On 7/1/2019 8:24 PM, Alex Williamson wrote: >>> This allows udev to trigger rules when a parent device is registered >>> or unregistered from

Re: [PATCH v2] mdev: Send uevents around parent device registration

2019-07-01 Thread Kirti Wankhede
On 7/1/2019 8:24 PM, Alex Williamson wrote: > This allows udev to trigger rules when a parent device is registered > or unregistered from mdev. > > Signed-off-by: Alex Williamson > --- > > v2: Don't remove the dev_info(), Kirti requested they stay and > removing them is only tangential to

Re: [PATCH] mdev: Send uevents around parent device registration

2019-06-27 Thread Kirti Wankhede
On 6/27/2019 1:51 PM, Cornelia Huck wrote: > On Thu, 27 Jun 2019 00:33:59 +0530 > Kirti Wankhede wrote: > >> On 6/26/2019 11:35 PM, Alex Williamson wrote: >>> On Wed, 26 Jun 2019 23:23:00 +0530 >>> Kirti Wankhede wrote: >>> >>>> On

Re: [PATCH] mdev: Send uevents around parent device registration

2019-06-26 Thread Kirti Wankhede
On 6/26/2019 11:35 PM, Alex Williamson wrote: > On Wed, 26 Jun 2019 23:23:00 +0530 > Kirti Wankhede wrote: > >> On 6/26/2019 7:57 PM, Alex Williamson wrote: >>> This allows udev to trigger rules when a parent device is registered >>> or unregistered from

Re: [PATCH] mdev: Send uevents around parent device registration

2019-06-26 Thread Kirti Wankhede
On 6/26/2019 7:57 PM, Alex Williamson wrote: > This allows udev to trigger rules when a parent device is registered > or unregistered from mdev. > > Signed-off-by: Alex Williamson > --- > drivers/vfio/mdev/mdev_core.c | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) > > d

Re: [PATCH 8/8] vfio/mdev: Improve the create/remove sequence

2019-03-28 Thread Kirti Wankhede
On 3/26/2019 9:00 PM, Parav Pandit wrote: > > >> -Original Message----- >> From: Kirti Wankhede >> Sent: Tuesday, March 26, 2019 2:06 AM >> To: Parav Pandit ; k...@vger.kernel.org; linux- >> ker...@vger.kernel.org; alex.william...@redhat.com >&g

Re: [PATCH 8/8] vfio/mdev: Improve the create/remove sequence

2019-03-26 Thread Kirti Wankhede
On 3/23/2019 4:50 AM, Parav Pandit wrote: > There are five problems with current code structure. > 1. mdev device is placed on the mdev bus before it is created in the > vendor driver. Once a device is placed on the mdev bus without creating > its supporting underlying vendor device, an open() c

Re: [PATCH 7/8] vfio/mdev: Fix aborting mdev child device removal if one fails

2019-03-25 Thread Kirti Wankhede
On 3/23/2019 4:50 AM, Parav Pandit wrote: > device_for_each_child() stops executing callback function for remaining > child devices, if callback hits an error. > Each child mdev device is independent of each other. > While unregistering parent device, mdev core must remove all child mdev > devic

Re: [PATCH 5/8] vfio/mdev: Avoid masking error code to EBUSY

2019-03-25 Thread Kirti Wankhede
On 3/23/2019 4:50 AM, Parav Pandit wrote: > Instead of masking return error to -EBUSY, return actual error > returned by the driver. > > Signed-off-by: Parav Pandit > --- > drivers/vfio/mdev/mdev_core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vfio/mde

Re: [PATCH 4/8] vfio/mdev: Drop redundant extern for exported symbols

2019-03-25 Thread Kirti Wankhede
On 3/23/2019 4:50 AM, Parav Pandit wrote: > There is no need use 'extern' for exported functions. > > Signed-off-by: Parav Pandit > --- > include/linux/mdev.h | 21 ++--- > 1 file changed, 10 insertions(+), 11 deletions(-) > > diff --git a/include/linux/mdev.h b/include/linux

Re: [PATCH 3/8] vfio/mdev: Removed unused kref

2019-03-25 Thread Kirti Wankhede
; > uuid_le uuid; > void *driver_data; > - struct kref ref; > struct list_head next; > struct kobject *type_kobj; > bool active; > Yes, this should be removed. Reviewed By: Kirti Wankhede Thanks, Kirti

Re: [PATCH 2/8] vfio/mdev: Avoid release parent reference during error path

2019-03-25 Thread Kirti Wankhede
parent) { > + parent = NULL; > ret = -EEXIST; > goto add_dev_err; > } > Agreed. Thanks for fixing this. Reviewed By: Kirti Wankhede Thanks, Kirti

Re: [PATCH 1/8] vfio/mdev: Fix to not do put_device on device_register failure

2019-03-25 Thread Kirti Wankhede
On 3/23/2019 4:50 AM, Parav Pandit wrote: > device_register() performs put_device() if device_add() fails. > This balances with device_initialize(). > > mdev core performing put_device() when device_register() fails, > is an error that puts already released device again. > Therefore, don't put

Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-08 Thread Kirti Wankhede
On 3/8/2019 4:01 AM, Parav Pandit wrote: > > >> -Original Message----- >> From: Kirti Wankhede >> Sent: Thursday, March 7, 2019 4:02 PM >> To: Parav Pandit ; Jakub Kicinski >> >> Cc: Or Gerlitz ; net...@vger.kernel.org; linux- >> ker

Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-07 Thread Kirti Wankhede
On 3/8/2019 2:51 AM, Parav Pandit wrote: > > >> -Original Message----- >> From: Kirti Wankhede >> Sent: Thursday, March 7, 2019 3:08 PM >> To: Parav Pandit ; Jakub Kicinski >> >> Cc: Or Gerlitz ; net...@vger.kernel.org; linux- >> ker

Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-07 Thread Kirti Wankhede
On 3/8/2019 2:32 AM, Parav Pandit wrote: > > >> -Original Message----- >> From: Kirti Wankhede >> Sent: Thursday, March 7, 2019 2:54 PM >> To: Parav Pandit ; Jakub Kicinski >> >> Cc: Or Gerlitz ; net...@vger.kernel.org; linux- >> ker

Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-07 Thread Kirti Wankhede
>>> >>> Yes. I got my patches to adapt to mdev way. Will be posting RFC v2 soon. >>> Will wait for a day to receive more comments/views from Greg and others. >>> >>> As I explained in this cover-letter and discussion, First use case is >>> to create and use mdevs in the host (and not in VM). >

Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-07 Thread Kirti Wankhede
CC += Alex On 3/6/2019 11:12 AM, Parav Pandit wrote: > Hi Kirti, > >> -Original Message----- >> From: Kirti Wankhede >> Sent: Tuesday, March 5, 2019 9:51 PM >> To: Parav Pandit ; Jakub Kicinski >> >> Cc: Or Gerlitz ; net...@vger.kernel.org;

Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-05 Thread Kirti Wankhede
On 3/6/2019 6:14 AM, Parav Pandit wrote: > Hi Greg, Kirti, > >> -Original Message- >> From: Parav Pandit >> Sent: Tuesday, March 5, 2019 5:45 PM >> To: Parav Pandit ; Kirti Wankhede >> ; Jakub Kicinski >> Cc: Or Gerlitz ; net...@vger.ke

Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-05 Thread Kirti Wankhede
On 3/6/2019 1:16 AM, Parav Pandit wrote: > > >> -Original Message- >> From: Jakub Kicinski >> Sent: Monday, March 4, 2019 7:35 PM >> To: Parav Pandit >> Cc: Or Gerlitz ; net...@vger.kernel.org; linux- >> ker...@vger.kernel.org; michal.l...@markovi.net; da...@davemloft.net; >> gre...@

Re: [PATCH v3 2/2] vfio: add edid support to mbochs sample driver

2018-09-28 Thread Kirti Wankhede
On 9/28/2018 11:10 AM, Gerd Hoffmann wrote: >>> + case MBOCHS_EDID_REGION_INDEX: >>> + ext->base.argsz = sizeof(*ext); >>> + ext->base.offset = MBOCHS_EDID_OFFSET; >>> + ext->base.size = MBOCHS_EDID_SIZE; >>> + ext->base.flags = (VFIO_REGION_INFO_FLAG_RE

Re: [PATCH v3 2/2] vfio: add edid support to mbochs sample driver

2018-09-27 Thread Kirti Wankhede
On 9/21/2018 2:00 PM, Gerd Hoffmann wrote: > Signed-off-by: Gerd Hoffmann > --- > samples/vfio-mdev/mbochs.c | 136 > ++--- > 1 file changed, 117 insertions(+), 19 deletions(-) > > diff --git a/samples/vfio-mdev/mbochs.c b/samples/vfio-mdev/mbochs.c >

Re: [PATCH v4 2/2] vfio/mdev: Re-order sysfs attribute creation

2018-05-18 Thread Kirti Wankhede
dev_device_remove() with an -EAGAIN return, but we can marginally > reduce this gap by adding this attribute as a final step of our sysfs > setup. > > Signed-off-by: Alex Williamson Looks good. Reviewed by: Kirti Wankhede > --- > drivers/vfio/mdev/mdev_sysfs.c | 14 +++

Re: [PATCH v4 0/2] vfio/mdev: Device namespace protection

2018-05-18 Thread Kirti Wankhede
On 5/19/2018 12:40 AM, Alex Williamson wrote: > v4: Fix the 'create' racing 'remove' gap noted by Kirti by moving > removal from mdev_list to mdev_device_release(). Fix missing > mdev_put_parent() cases in mdev_device_create(), also noted > by Kirti. Added documention update regardi

Re: [PATCH v4 1/2] vfio/mdev: Check globally for duplicate devices

2018-05-18 Thread Kirti Wankhede
e case where mdev_device_remove_ops() returns error. Previously > concurrent calls to mdev_device_remove() could see the device > disappear with -ENODEV and return in the case of error. Now a user > would see -EAGAIN while the device is in this transitory state. > > Signed-off-by: Alex Williams

Re: [PATCH v3] vfio/mdev: Check globally for duplicate devices

2018-05-18 Thread Kirti Wankhede
On 5/18/2018 11:00 PM, Alex Williamson wrote: > On Fri, 18 May 2018 12:34:03 +0530 > Kirti Wankhede wrote: > >> On 5/18/2018 3:07 AM, Alex Williamson wrote: >>> On Fri, 18 May 2018 01:56:50 +0530 >>> Kirti Wankhede wrote: >>> >>>> On 5/

Re: [PATCH v3] vfio/mdev: Check globally for duplicate devices

2018-05-18 Thread Kirti Wankhede
On 5/18/2018 3:07 AM, Alex Williamson wrote: > On Fri, 18 May 2018 01:56:50 +0530 > Kirti Wankhede wrote: > >> On 5/17/2018 9:50 PM, Alex Williamson wrote: >>> On Thu, 17 May 2018 21:25:22 +0530 >>> Kirti Wankhede wrote: >>> >>>> On

Re: [PATCH v3] vfio/mdev: Check globally for duplicate devices

2018-05-17 Thread Kirti Wankhede
On 5/17/2018 9:50 PM, Alex Williamson wrote: > On Thu, 17 May 2018 21:25:22 +0530 > Kirti Wankhede wrote: > >> On 5/17/2018 1:39 PM, Cornelia Huck wrote: >>> On Wed, 16 May 2018 21:30:19 -0600 >>> Alex Williamson wrote: >>> >>>>

Re: [PATCH v3] vfio/mdev: Check globally for duplicate devices

2018-05-17 Thread Kirti Wankhede
On 5/17/2018 1:39 PM, Cornelia Huck wrote: > On Wed, 16 May 2018 21:30:19 -0600 > Alex Williamson wrote: > >> When we create an mdev device, we check for duplicates against the >> parent device and return -EEXIST if found, but the mdev device >> namespace is global since we'll link all devices

Re: [PATCH v2] vfio/mdev: Check globally for duplicate devices

2018-05-16 Thread Kirti Wankhede
On 5/16/2018 8:53 PM, Alex Williamson wrote: > When we create an mdev device, we check for duplicates against the > parent device and return -EEXIST if found, but the mdev device > namespace is global since we'll link all devices from the bus. We do > catch this later in sysfs_do_create_link_sd(

Re: [PATCH] vfio-mdev/samples: change RDI interrupt condition

2018-03-08 Thread Kirti Wankhede
Thanks for fixing it. Patch looks good to me. +Alex to pull this patch. Reviewed by: Kirti Wankhede Thanks, Kirti On 3/8/2018 12:38 PM, Shunyong Yang wrote: > When FIFO mode is enabled, the receive data available interrupt > (UART_IIR_RDI in code) should be triggered when the number o

Re: [PATCH] vfio: mdev: make a couple of functions and structure vfio_mdev_driver static

2017-12-26 Thread Kirti Wankhede
struct mdev_driver vfio_mdev_driver = { > .name = "vfio_mdev", > .probe = vfio_mdev_probe, > .remove = vfio_mdev_remove, > Reviewed by: Kirti Wankhede

Re: [PATCH] vfio: Simplify capability helper

2017-12-13 Thread Kirti Wankhede
le task. >>> >>> Signed-off-by: Alex Williamson >> >> >> Makes more sense now, thanks. I'll repost mine on top of this. >> >> >> Reviewed-by: Alexey Kardashevskiy >> >> > > Looks good for KVMGT part. > >

Re: [PATCH v18 5/6] vfio: ABI for mdev display dma-buf operation

2017-11-18 Thread Kirti Wankhede
Extremely sorry for the delay. This works for VFIO_GFX_PLANE_TYPE_REGION. Tested with local changes. Reviewed-by: Kirti Wankhede Thanks, Kirti On 11/18/2017 9:00 PM, Alex Williamson wrote: > > Kirti? > > On Wed, 15 Nov 2017 21:11:42 -0700 > Alex Williamson wrote: > >

Re: [RFC]Add new mdev interface for QoS

2017-08-07 Thread Kirti Wankhede
On 8/7/2017 1:11 PM, Gao, Ping A wrote: > > On 2017/8/4 5:11, Alex Williamson wrote: >> On Thu, 3 Aug 2017 20:26:14 +0800 >> "Gao, Ping A" wrote: >> >>> On 2017/8/3 0:58, Alex Williamson wrote: >>>> On Wed, 2 Aug 2017 21:16:28 +0530 >&

Re: [RFC]Add new mdev interface for QoS

2017-08-02 Thread Kirti Wankhede
On 8/2/2017 6:29 PM, Gao, Ping A wrote: > > On 2017/8/2 18:19, Kirti Wankhede wrote: >> >> On 8/2/2017 3:56 AM, Alex Williamson wrote: >>> On Tue, 1 Aug 2017 13:54:27 +0800 >>> "Gao, Ping A" wrote: >>> >>>> On 2017/7/28 0:00

Re: [RFC]Add new mdev interface for QoS

2017-08-02 Thread Kirti Wankhede
On 8/2/2017 3:56 AM, Alex Williamson wrote: > On Tue, 1 Aug 2017 13:54:27 +0800 > "Gao, Ping A" wrote: > >> On 2017/7/28 0:00, Gao, Ping A wrote: >>> On 2017/7/27 0:43, Alex Williamson wrote: [cc +libvir-list] On Wed, 26 Jul 2017 21:16:59 +0800 "Gao, Ping A" wrote:

Re: [PATCH v10] vfio: ABI for mdev display dma-buf operation

2017-07-19 Thread Kirti Wankhede
On 7/19/2017 11:55 AM, Gerd Hoffmann wrote: > On Wed, 2017-07-19 at 00:16 +, Zhang, Tina wrote: >>> -Original Message- >>> From: Gerd Hoffmann [mailto:kra...@redhat.com] >>> Sent: Monday, July 17, 2017 7:03 PM >>> To: Kirti Wankhede ; Zhang,

Re: [PATCH v10] vfio: ABI for mdev display dma-buf operation

2017-07-14 Thread Kirti Wankhede
On 7/14/2017 5:35 PM, Gerd Hoffmann wrote: > Hi, > >> There could be only two planes, one DRM_PLANE_TYPE_PRIMARY and one >> DRM_PLANE_TYPE_CURSOR. >> Steps from gfx_update for region case would be: >> - VFIO_DEVICE_QUERY_GFX_PLANE with plane_type = >> DRM_PLANE_TYPE_PRIMARY > >> - if vfio_dev

Re: [PATCH v10] vfio: ABI for mdev display dma-buf operation

2017-07-14 Thread Kirti Wankhede
On 7/14/2017 3:31 PM, Gerd Hoffmann wrote: > Hi, > >> In case when VFIO region is used to provide surface to QEMU, plane_id >> would be region index, > > Then we should name it "region_index" not "plane_id". > >> for example region 10 could be used for primary >> surface and region 11 could

Re: [PATCH v10] vfio: ABI for mdev display dma-buf operation

2017-07-14 Thread Kirti Wankhede
On 7/14/2017 7:00 AM, Zhang, Tina wrote: > > >> -Original Message- >> From: intel-gvt-dev [mailto:intel-gvt-dev-boun...@lists.freedesktop.org] On >> Behalf Of Kirti Wankhede >> Sent: Wednesday, July 12, 2017 8:45 PM >> To: Zhang, Tina ; Gerd Hoffm

Re: [PATCH v9 5/7] vfio: Define vfio based dma-buf operations

2017-07-12 Thread Kirti Wankhede
Hey Gerd, Sorry, I missed this mail earlier. On 6/21/2017 12:52 PM, Gerd Hoffmann wrote: > Hi, > >> We don't support cursor for console vnc. Ideally console vnc should >> be >> used by admin for configuration or during maintenance, which refresh >> primary surface at low refresh rate, 10 fps.

Re: [PATCH v10] vfio: ABI for mdev display dma-buf operation

2017-07-12 Thread Kirti Wankhede
r >>> Sent: Tuesday, July 11, 2017 5:13 PM >>> To: Gerd Hoffmann >>> Cc: Tian, Kevin ; linux-kernel@vger.kernel.org; intel- >>> g...@lists.freedesktop.org; alex.william...@redhat.com; >>> zhen...@linux.intel.com; ch...@chris-wilson.co.uk;

Re: [PATCH] vfio: Remove unnecessary uses of vfio_container.group_lock

2017-07-11 Thread Kirti Wankhede
Sounds reasonable to me. Thanks, Kirti On 7/8/2017 3:45 AM, Alex Williamson wrote: > The original intent of vfio_container.group_lock is to protect > vfio_container.group_list, however over time it's become a crutch to > prevent changes in container composition any time we call into the > iommu d

Re: [PATCH v10] vfio: ABI for mdev display dma-buf operation

2017-07-06 Thread Kirti Wankhede
On 7/6/2017 3:59 AM, Tina Zhang wrote: > Add VFIO_DEVICE_QUERY_GFX_PLANE ioctl command to let user mode query and > get the plan and its related information. > > The dma-buf's life cycle is handled by user mode and tracked by kernel. > The returned fd in struct vfio_device_query_gfx_plane can be

Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf operations

2017-06-20 Thread Kirti Wankhede
On 6/20/2017 8:30 PM, Alex Williamson wrote: > On Tue, 20 Jun 2017 12:57:36 +0200 > Gerd Hoffmann wrote: > >> On Tue, 2017-06-20 at 08:41 +, Zhang, Tina wrote: >>> Hi, >>> >>> Thanks for all the comments. Here are the summaries: >>> >>> 1. Modify the structures to make it more general. >>>

Re: [PATCH v9 5/7] vfio: Define vfio based dma-buf operations

2017-06-20 Thread Kirti Wankhede
On 6/20/2017 2:05 PM, Gerd Hoffmann wrote: > Hi, > >>> Hmm, plane isn't really an ID, it is a type, with type being either >>> DRM_PLANE_TYPE_PRIMARY or DRM_PLANE_TYPE_CURSOR, so I don't think >>> the >>> flage above make sense. >> >> The intention was that ..._REGION_ID and ...PLANE_ID are de

Re: [PATCH v9 5/7] vfio: Define vfio based dma-buf operations

2017-06-20 Thread Kirti Wankhede
On 6/19/2017 8:25 PM, Alex Williamson wrote: > On Mon, 19 Jun 2017 08:38:32 +0200 > Gerd Hoffmann wrote: > >> Hi, >> >>> My suggestion was to use vfio device fd for this ioctl and have >>> dmabuf >>> mgr fd as member in above query_plane structure, for region type it >>> would be set to 0.

Re: [PATCH v9 5/7] vfio: Define vfio based dma-buf operations

2017-06-16 Thread Kirti Wankhede
On 6/16/2017 10:09 PM, Alex Williamson wrote: > On Fri, 16 Jun 2017 19:02:30 +0530 > Kirti Wankhede wrote: > >> On 6/16/2017 2:08 AM, Alex Williamson wrote: >>> On Thu, 15 Jun 2017 18:00:38 +0200 >>> Gerd Hoffmann wrote: >>> >>>>

Re: [PATCH v9 5/7] vfio: Define vfio based dma-buf operations

2017-06-16 Thread Kirti Wankhede
On 6/16/2017 2:08 AM, Alex Williamson wrote: > On Thu, 15 Jun 2017 18:00:38 +0200 > Gerd Hoffmann wrote: > >> Hi, >> +struct vfio_dmabuf_mgr_plane_info { + __u64 start; + __u64 drm_format_mod; + __u32 drm_format; + __u32 width; + __u32 height; + __u32

Re: [PATCH v9 5/7] vfio: Define vfio based dma-buf operations

2017-06-15 Thread Kirti Wankhede
On 6/15/2017 1:30 PM, Xiaoguang Chen wrote: > Here we defined a new ioctl to create a fd for a vfio device based on > the input type. Now only one type is supported that is a dma-buf > management fd. > Two ioctls are defined for the dma-buf management fd: query the vfio > vgpu's plane information

Re: [PATCH v6 4/6] vfio: Define vfio based vgpu's dma-buf operations

2017-06-05 Thread Kirti Wankhede
On 6/2/2017 2:08 PM, Gerd Hoffmann wrote: > >> struct vfio_vgpu_surface_info { >> __u64 start; >> __u32 width; >> __u32 height; >> __u32 stride; >> __u32 size; >> __u32 x_pos; >> __u32 y_pos; >> __u32 padding; >> /* Only use

Re: [PATCH v6 4/6] vfio: Define vfio based vgpu's dma-buf operations

2017-06-01 Thread Kirti Wankhede
On 6/1/2017 10:08 PM, Alex Williamson wrote: > On Thu, 1 Jun 2017 03:01:28 + > "Chen, Xiaoguang" wrote: > >> Hi Kirti, >> >>> -----Original Message- >>> From: Kirti Wankhede [mailto:kwankh...@nvidia.com] >>> Sent: Thursday, Jun

Re: [PATCH v6 4/6] vfio: Define vfio based vgpu's dma-buf operations

2017-05-31 Thread Kirti Wankhede
On 5/31/2017 11:48 AM, Chen, Xiaoguang wrote: > Hi, > >> -Original Message- >> From: Gerd Hoffmann [mailto:kra...@redhat.com] >> Sent: Monday, May 29, 2017 3:20 PM >> To: Chen, Xiaoguang ; >> alex.william...@redhat.com; ch...@chris-wilson.co.uk; intel- >> g...@lists.freedesktop.org; linu

Re: [PATCH v5 5/5] drm/i915/gvt: Adding interface so user space can get the dma-buf

2017-05-23 Thread Kirti Wankhede
On 5/23/2017 7:39 PM, Gerd Hoffmann wrote: > Hi, > >> diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h >> index ae46105..285dc16 100644 >> --- a/include/uapi/linux/vfio.h >> +++ b/include/uapi/linux/vfio.h >> @@ -502,10 +502,58 @@ struct vfio_pci_hot_reset { >> >> #define

Re: [PATCH 23/29] vfio-mediated-device.txt: standardize document format

2017-05-22 Thread Kirti Wankhede
> b/Documentation/vfio-mediated-device.txt > index e5e57b40f8af..1b3950346532 100644 > --- a/Documentation/vfio-mediated-device.txt > +++ b/Documentation/vfio-mediated-device.txt > @@ -1,14 +1,17 @@ > -/* > - * VFIO Mediated devices > - * > - * Copyright (c) 2016, NVIDIA C

Re: [PATCH v5 0/3] vfio/type1: Synchronous locked page accounting

2017-04-18 Thread Kirti Wankhede
looks good to me. > > Reviewed-by: Peter Xu > > Thanks! > All three looks good to me too. Reviewed-by: Kirti Wankhede Thanks, Kirti

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-18 Thread Kirti Wankhede
On 4/18/2017 8:24 AM, Peter Xu wrote: > On Mon, Apr 17, 2017 at 03:32:20PM -0600, Alex Williamson wrote: >> On Tue, 18 Apr 2017 01:02:12 +0530 >> Kirti Wankhede wrote: >> >>> On 4/18/2017 12:49 AM, Alex Williamson wrote: >>>> On Tue, 18 Apr 2017

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Kirti Wankhede
On 4/18/2017 12:49 AM, Alex Williamson wrote: > On Tue, 18 Apr 2017 00:35:06 +0530 > Kirti Wankhede wrote: > >> On 4/17/2017 8:02 PM, Alex Williamson wrote: >>> On Mon, 17 Apr 2017 14:47:54 +0800 >>> Peter Xu wrote: >>> >>>> On Sun, A

Re: [PATCH v4 2/2] vfio/type1: Prune vfio_pin_page_external()

2017-04-17 Thread Kirti Wankhede
pinned. > > N.B. vfio_pin_pages_remote() can pin a large contiguous range of pages > before calling vfio_lock_acct(). If we were to similarly remove the > extra test there, a user could temporarily pin far more pages than > they're allowed. > > Suggested-by: Kirti Wan

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Kirti Wankhede
ortunately vfio_pin_pages_remote() needs to know about lock_cap > since it tests whether the user is exceeding their locked memory > limit. The other callers could certainly get away with > vfio_lock_acct() testing the capability itself but that would add a > redundant call for the mos

Re: [PATCH v3] vfio/type1: Remove locked page accounting workqueue

2017-04-14 Thread Kirti Wankhede
On 4/12/2017 12:58 AM, Alex Williamson wrote: > If the mmap_sem is contented then the vfio type1 IOMMU backend will > defer locked page accounting updates to a workqueue task. This has a > few problems and depending on which side the user tries to play, they > might be over-penalized for unmaps

Re: [PATCH v2] vfio/mdev: Use a module softdep for vfio_mdev

2017-02-09 Thread Kirti Wankhede
gt; Looks good to me. Reviewed by: Kirti Wankhede Thanks, Kirti > v2: Remove request_module call as well, update description. > > drivers/vfio/mdev/mdev_core.c | 14 ++ > 1 file changed, 2 insertions(+), 12 deletions(-) > > diff --git a/drivers/vfio/mdev/mdev

Re: [v2 2/2] vfio iommu type1: fix the testing of capability for remote task

2017-01-12 Thread Kirti Wankhede
Looks good to me Reviewed by: Kirti Wankhede On 1/13/2017 3:52 AM, James Morris wrote: > On Thu, 12 Jan 2017, Jike Song wrote: > >> Before the mdev enhancement type1 iommu used capable() to test the >> capability of current task; in the course of mdev development a >>

Re: [PATCH] vfio-mdev: fix non-standard ioctl return val causing i386 build fail

2017-01-04 Thread Kirti Wankhede
‘mdev_fops.ioctl’) > cc1: some warnings being treated as errors > > Use the standard "int" ioctl return value in both the header and > the sample code to fix the issue. > > Fixes: 9d1a546c53b4 ("docs: Sample driver to demonstrate how to use Mediated > device

Re: [PATCH] samples/vfio-mdev: don't return zero on failure paths in mtty_dev_init()

2017-01-04 Thread Kirti Wankhede
Dan Carpenter had sent similar change earlier. https://www.spinics.net/lists/kvm/msg141470.html Alex, Did you pull that change in your tree? Thanks, Kirti On 12/31/2016 4:10 AM, Alexey Khoroshilov wrote: > If class_create() or mdev_register_device() fail, mtty_dev_init() > breaks off initializa

Re: [PATCH v2 0/4] vfio-mdev: Fix remove race, clean namespace and better define ABI

2016-12-25 Thread Kirti Wankhede
ace where we expect out of tree vendor drivers. > Patch 2/4-4/4 looks good to me. Reviewed by: Kirti Wankhede Thanks, Kirti > Additionally in v2, the patch removing the next field from mdev_device > is dropped, instead using it to fix a remove race, my From address is > fixed, and

Re: [PATCH v2 1/4] vfio-mdev: Fix remove race

2016-12-25 Thread Kirti Wankhede
On 12/26/2016 1:10 AM, Alex Williamson wrote: > On Sun, 25 Dec 2016 22:39:47 +0530 > Kirti Wankhede wrote: > >> On 12/23/2016 1:51 AM, Alex Williamson wrote: >>> Using the mtty mdev sample driver we can generate a remove race by >>> starting one shell that cont

Re: [PATCH v2 1/4] vfio-mdev: Fix remove race

2016-12-25 Thread Kirti Wankhede
> Alex, Writing 1 on 'remove' first removes itself, i.e. calls device_remove_file_self(dev, attr). So if the file is removed then device_remove_file_self() should return false, isn't that returns false? kernfs_remove_self() hold the mutex that should handle this condition. Thanks,

Re: [PATCH 2/2] vfio iommu type1: fix the testing of capability for remote task

2016-12-22 Thread Kirti Wankhede
this purpose, however it still > tests current, the only difference is, in a specified namespace. > > Fix it by using has_capability() instead, which tests the cap for > specified task in init_user_ns, the same namespace as capable(). > > Cc: Alex Williamson > Cc: Kirti Wankhe

Re: [PATCH v2] vfio/type1: Restore mapping performance with mdev support

2016-12-20 Thread Kirti Wankhede
: Alex Williamson > --- > > v2: Use (mm == current->mm) test in vfio_lock_acct() as well rather > than passing around is_current. It doesn't make sense to keep it > in vaddr_get_pfn() and not use it elsewhere. > Thanks Alex. This change looks good to me. Re

Re: [PATCH] vfio/type1: Restore mapping performance with mdev support

2016-12-16 Thread Kirti Wankhede
On 12/15/2016 11:57 PM, Alex Williamson wrote: > On Thu, 15 Dec 2016 23:27:54 +0530 > Kirti Wankhede wrote: > >> On 12/15/2016 1:33 PM, Alex Williamson wrote: >>> On Thu, 15 Dec 2016 12:05:35 +0530 >>> Kirti Wankhede wrote: >>> >>>> On

Re: [PATCH] vfio/type1: Restore mapping performance with mdev support

2016-12-15 Thread Kirti Wankhede
On 12/15/2016 1:33 PM, Alex Williamson wrote: > On Thu, 15 Dec 2016 12:05:35 +0530 > Kirti Wankhede wrote: > >> On 12/14/2016 2:28 AM, Alex Williamson wrote: >>> As part of the mdev support, type1 now gets a task reference per >>> vfio_dma and uses that to

Re: [PATCH] vfio-mdev: Fix mtty sample driver building

2016-12-15 Thread Kirti Wankhede
On 12/15/2016 1:42 PM, Alex Williamson wrote: > On Thu, 15 Dec 2016 13:15:34 +0530 > Kirti Wankhede wrote: > >> On 12/15/2016 1:09 AM, Alex Williamson wrote: >>> This sample driver was originally under Documentation/ and was moved >>> to samples, but build s

Re: [PATCH] vfio-mdev: Fix mtty sample driver building

2016-12-14 Thread Kirti Wankhede
On 12/15/2016 1:09 AM, Alex Williamson wrote: > This sample driver was originally under Documentation/ and was moved > to samples, but build support was never adjusted for the new location. > > Signed-off-by: Alex Williamson > --- > samples/Kconfig|7 +++ > samples/Makefile

Re: [PATCH] vfio/type1: Restore mapping performance with mdev support

2016-12-14 Thread Kirti Wankhede
On 12/14/2016 2:28 AM, Alex Williamson wrote: > As part of the mdev support, type1 now gets a task reference per > vfio_dma and uses that to get an mm reference for the task while > working on accounting. That's the correct thing to do for paths > where we can't rely on using current, but there

[PATCH v2 2/2] vfio iommu: Fix size argument to vfio_find_dma() in pin_pages/unpin_pages

2016-12-06 Thread Kirti Wankhede
d-off-by: Kirti Wankhede Signed-off-by: Neo Jia --- drivers/vfio/vfio_iommu_type1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 8e9e94ccb2ff..023fba7b8d5a 100644 --- a/drivers/vfio/vfio_iommu_type1

[PATCH v2 1/2] vfio iommu type1: Fix size argument to vfio_find_dma() during DMA UNMAP.

2016-12-06 Thread Kirti Wankhede
nge with size = 0, but in that case address to be searched is calculated with size - 1 and so it works correctly. Signed-off-by: Kirti Wankhede Signed-off-by: Neo Jia --- drivers/vfio/vfio_iommu_type1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/vfio_iommu_t

Re: [PATCH v2 1/2] vfio iommu type1: Fix size argument to vfio_find_dma() during DMA UNMAP.

2016-12-06 Thread Kirti Wankhede
On 12/6/2016 11:08 PM, Alex Williamson wrote: > On Tue, 6 Dec 2016 22:43:30 +0530 > Kirti Wankhede wrote: > >> vfio_dma keeps track of address range from (dma->iova + 0) to >> (dma->iova + dma->size - 1), while vfio_find_dma() search logic looks for >> rang

[PATCH v2 2/2] vfio iommu: Fix size argument to vfio_find_dma() in pin_pages/unpin_pages

2016-12-06 Thread Kirti Wankhede
set to PAGE_SIZE, as argument to vfio_find_dma. Signed-off-by: Kirti Wankhede Signed-off-by: Neo Jia --- drivers/vfio/vfio_iommu_type1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 8e9e94ccb2ff..023f

[PATCH v2 1/2] vfio iommu type1: Fix size argument to vfio_find_dma() during DMA UNMAP.

2016-12-06 Thread Kirti Wankhede
dma() is also used to verify last address in unmap range with size = 0, but in that case address to be searched is calculated with size - 1 and so it works correctly. Signed-off-by: Kirti Wankhede Signed-off-by: Neo Jia --- drivers/vfio/vfio_iommu_type1.c | 2 +- 1 file changed, 1 insertion(+)

Re: [PATCH 1/1] vfio iommu type1: set size to PAGE_SIZE while looking for iova in dma list

2016-12-05 Thread Kirti Wankhede
On 12/6/2016 4:24 AM, Alex Williamson wrote: > On Tue, 6 Dec 2016 02:38:01 +0530 > Kirti Wankhede wrote: > >> In the functions of pin_pages/unpin_pages from mdev vendor driver, >> vfio_find_dma() should be called with size as PAGE_SIZE instead of 0. >> vfio_find_dma(

Re: [PATCH 1/1] vfio iommu type1: WARN_ON if notifier block is not unregistered

2016-12-05 Thread Kirti Wankhede
On 12/6/2016 4:56 AM, Alex Williamson wrote: > On Tue, 6 Dec 2016 02:38:20 +0530 > Kirti Wankhede wrote: > >> mdev vendor driver should unregister the iommu notifier since the vfio >> iommu can persist beyond the attachment of the mdev group. WARN_ON will >> sh

[PATCH 1/1] vfio iommu type1: set size to PAGE_SIZE while looking for iova in dma list

2016-12-05 Thread Kirti Wankhede
e 1, not 0. Otherwise vfio_find_dma() returns NULL. Signed-off-by: Kirti Wankhede Signed-off-by: Neo Jia Change-Id: Iee6fd45441c342b5e8626087046b2e0075d19a08 --- drivers/vfio/vfio_iommu_type1.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/vfio_iommu_ty

[PATCH 1/1] vfio iommu type1: WARN_ON if notifier block is not unregistered

2016-12-05 Thread Kirti Wankhede
mdev vendor driver should unregister the iommu notifier since the vfio iommu can persist beyond the attachment of the mdev group. WARN_ON will show warning if vendor driver doesn't unregister the notifier and is forced to follow the implementations steps. Signed-off-by: Kirti Wankhede Signe

Re: [PATCH] vfio: Fix handling of error returned by 'vfio_group_get_from_dev()'

2016-11-30 Thread Kirti Wankhede
On 12/1/2016 12:09 AM, Alex Williamson wrote: > On Wed, 30 Nov 2016 21:27:07 +0300 > Dan Carpenter wrote: > >> On Wed, Nov 30, 2016 at 09:36:46AM -0700, Alex Williamson wrote: >>> On Wed, 30 Nov 2016 08:06:12 +0100 >>> Christophe JAILLET wrote: >>> 'vfio_group_get_from_dev()' seems to

Re: [PATCH v14 08/22] vfio iommu type1: Add find_iommu_group() function

2016-11-21 Thread Kirti Wankhede
Hi Eric, Thanks for your reviews. Alex had already pulled this series into his next branch for v4.10. http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1274745.html Thanks, Kirti On 11/21/2016 4:59 PM, Auger Eric wrote: > Hi, > On 16/11/2016 21:46, Kirti Wankhede wrote:

Re: [PATCH v14 00/22] Add Mediated device support

2016-11-17 Thread Kirti Wankhede
On 11/18/2016 3:35 AM, Neo Jia wrote: > On Thu, Nov 17, 2016 at 02:25:15PM -0700, Alex Williamson wrote: >> On Thu, 17 Nov 2016 02:16:12 +0530 >> Kirti Wankhede wrote: >>> >>> Documentation/ABI/testing/sysfs-bus-vfio-mdev | 111 ++ >>> Documentat

Re: [PATCH v14 12/22] vfio: Add notifier callback to parent's ops structure of mdev

2016-11-17 Thread Kirti Wankhede
On 11/17/2016 8:57 PM, Alex Williamson wrote: > On Thu, 17 Nov 2016 20:35:38 +0800 > Jike Song wrote: > >> On 11/17/2016 04:46 AM, Kirti Wankhede wrote: >>> Add a notifier calback to parent's ops structure of mdev device so that per >>> device notifer

Re: [PATCH v14 09/22] vfio iommu type1: Add task structure to vfio_dma

2016-11-16 Thread Kirti Wankhede
On 11/17/2016 11:11 AM, Alexey Kardashevskiy wrote: > On 17/11/16 07:46, Kirti Wankhede wrote: >> Add task structure to vfio_dma structure. Task structure is used for: >> - During DMA_UNMAP, same task who mapped it or other task who shares same >> address space is allowe

  1   2   3   >