Re: [PATCH 1/2] vfio/fsl-mc: return -EFAULT if copy_to_user() fails

2020-11-03 Thread Diana Craciun OSS
On 11/2/2020 11:45 PM, Alex Williamson wrote: Thanks, Dan. Diana, can I get an ack for this? Thanks, Yes, sure, I apologize for not doing it earlier. Thanks, Diana Alex On Fri, 23 Oct 2020 14:34:50 +0300 Dan Carpenter wrote: The copy_to_user() function returns the number of bytes

Re: drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c:16:5: warning: no previous prototype for function 'vfio_fsl_mc_irqs_allocate'

2020-11-03 Thread Diana Craciun OSS
Hi, The warning is fixed by this patch: https://www.spinics.net/lists/kvm/msg227575.html The errors are caused by the fact that the vfio fsl-mc patches have a dependency on the fsl-mc bus series. For this particular error the missing patch is: bus/fsl-mc: Export IRQ pool handling functions

Re: [PATCH 2/2] vfio/fsl-mc: prevent underflow in vfio_fsl_mc_mmap()

2020-11-03 Thread Diana Craciun OSS
Acked-by: Diana Craciun On 10/23/2020 2:29 PM, Dan Carpenter wrote: My static analsysis tool complains that the "index" can be negative. There are some checks in do_mmap() which try to prevent underflows but I don't know if they are sufficient for this situation. Either way, making "index"

Re: [PATCH 1/2] vfio/fsl-mc: return -EFAULT if copy_to_user() fails

2020-11-03 Thread Diana Craciun OSS
Acked-by: Diana Craciun On 10/23/2020 2:34 PM, Dan Carpenter wrote: The copy_to_user() function returns the number of bytes remaining to be copied, but this code should return -EFAULT. Fixes: df747bcd5b21 ("vfio/fsl-mc: Implement VFIO_DEVICE_GET_REGION_INFO ioctl call") Signed-off-by: Dan

Re: [PATCH] vfio/fsl-mc: fix the return of the uninitialized variable ret

2020-10-16 Thread Diana Craciun OSS
On 10/15/2020 9:52 PM, Alex Williamson wrote: On Thu, 15 Oct 2020 13:22:26 +0100 Colin King wrote: From: Colin Ian King Currently the success path in function vfio_fsl_mc_reflck_attach is returning an uninitialized value in variable ret. Fix this by setting this to zero to indicate success.

Re: linux-next: build failure after merge of the vfio tree

2020-10-14 Thread Diana Craciun OSS
/14/2020 1:16 AM, Stephen Rothwell wrote: Hi Diana, On Tue, 13 Oct 2020 18:56:07 +0300 Diana Craciun OSS wrote: Hi, How does it fail? What's the error? Sorry about that: drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c: In function 'vfio_fsl_mc_set_irq_trigger': drivers/vfio/fsl-mc

Re: linux-next: build failure after merge of the vfio tree

2020-10-13 Thread Diana Craciun OSS
Hi, How does it fail? What's the error? Thanks, Diana On 10/13/2020 6:07 AM, Stephen Rothwell wrote: Hi all, After merging the vfio tree, today's linux-next build (x86_64 allmodconfig) failed like this: Caused by commit cc0ee20bd969 ("vfio/fsl-mc: trigger an interrupt via eventfd")

Re: [PATCH v5 09/10] vfio/fsl-mc: Add read/write support for fsl-mc devices

2020-10-05 Thread Diana Craciun OSS
On 10/2/2020 11:50 PM, Alex Williamson wrote: On Tue, 29 Sep 2020 12:03:38 +0300 Diana Craciun wrote: The software uses a memory-mapped I/O command interface (MC portals) to communicate with the MC hardware. This command interface is used to discover, enumerate, configure and remove DPAA2

Re: [PATCH v5 02/10] vfio/fsl-mc: Scan DPRC objects on vfio-fsl-mc driver bind

2020-10-05 Thread Diana Craciun OSS
On 10/2/2020 8:24 PM, Alex Williamson wrote: On Tue, 29 Sep 2020 12:03:31 +0300 Diana Craciun wrote: The DPRC (Data Path Resource Container) device is a bus device and has child devices attached to it. When the vfio-fsl-mc driver is probed the DPRC is scanned and the child devices discovered

Re: [PATCH v4 09/10] vfio/fsl-mc: Add read/write support for fsl-mc devices

2020-09-11 Thread Diana Craciun OSS
Hi Eric, On 9/10/2020 11:20 AM, Auger Eric wrote: Hi Diana, On 9/7/20 4:34 PM, Diana Craciun OSS wrote: Hi Eric, On 9/4/2020 11:18 AM, Auger Eric wrote: Hi Diana, On 8/26/20 11:33 AM, Diana Craciun wrote: The software uses a memory-mapped I/O command interface (MC portals) to communicate

Re: [PATCH v4 07/10] vfio/fsl-mc: Add irq infrastructure for fsl-mc devices

2020-09-07 Thread Diana Craciun OSS
Hi Eric, On 9/3/2020 11:15 PM, Auger Eric wrote: Hi Diana, On 8/26/20 11:33 AM, Diana Craciun wrote: This patch adds the skeleton for interrupt support for fsl-mc devices. The interrupts are not yet functional, the functionality will be added by subsequent patches. Signed-off-by: Bharat

Re: [PATCH v4 08/10] vfio/fsl-mc: trigger an interrupt via eventfd

2020-09-07 Thread Diana Craciun OSS
Hi Eric, On 9/4/2020 11:02 AM, Auger Eric wrote: Hi Diana, On 8/26/20 11:33 AM, Diana Craciun wrote: This patch allows to set an eventfd for fsl-mc device interrupts and also to trigger the interrupt eventfd from userspace for testing. All fsl-mc device interrupts are MSIs. The MSIs are

Re: [PATCH v4 10/10] vfio/fsl-mc: Add support for device reset

2020-09-07 Thread Diana Craciun OSS
Hi Eric, On 9/4/2020 11:21 AM, Auger Eric wrote: Hi Diana, On 8/26/20 11:33 AM, Diana Craciun wrote: Currently only resetting the DPRC container is supported which will reset all the objects inside it. Resetting individual objects is possible from the userspace by issueing commands towards MC

Re: [PATCH v4 02/10] vfio/fsl-mc: Scan DPRC objects on vfio-fsl-mc driver bind

2020-09-07 Thread Diana Craciun OSS
Hi Eric, On 9/3/2020 5:06 PM, Auger Eric wrote: Hi Diana, On 8/26/20 11:33 AM, Diana Craciun wrote: The DPRC (Data Path Resource Container) device is a bus device and has child devices attached to it. When the vfio-fsl-mc driver is probed the DPRC is scanned and the child devices discovered

Re: [PATCH v4 09/10] vfio/fsl-mc: Add read/write support for fsl-mc devices

2020-09-07 Thread Diana Craciun OSS
Hi Eric, On 9/4/2020 11:18 AM, Auger Eric wrote: Hi Diana, On 8/26/20 11:33 AM, Diana Craciun wrote: The software uses a memory-mapped I/O command interface (MC portals) to communicate with the MC hardware. This command interface is used to discover, enumerate, configure and remove DPAA2

Re: [PATCH v4 05/10] vfio/fsl-mc: Allow userspace to MMAP fsl-mc device MMIO regions

2020-09-07 Thread Diana Craciun OSS
Hi Eric, On 9/3/2020 7:05 PM, Auger Eric wrote: Hi Diana, On 8/26/20 11:33 AM, Diana Craciun wrote: Allow userspace to mmap device regions for direct access of fsl-mc devices. Signed-off-by: Bharat Bhushan Signed-off-by: Diana Craciun --- drivers/vfio/fsl-mc/vfio_fsl_mc.c | 60

Re: [PATCH v4 01/10] vfio/fsl-mc: Add VFIO framework skeleton for fsl-mc devices

2020-09-04 Thread Diana Craciun OSS
Hi Eric, On 9/3/2020 5:06 PM, Auger Eric wrote: Hi Diana, On 8/26/20 11:33 AM, Diana Craciun wrote: From: Bharat Bhushan DPAA2 (Data Path Acceleration Architecture) consists in mechanisms for processing Ethernet packets, queue management, accelerators, etc. The Management Complex (mc) is a

Re: [PATCH v4 00/10] vfio/fsl-mc: VFIO support for FSL-MC device

2020-09-04 Thread Diana Craciun OSS
Hi Eric, On 9/3/2020 4:40 PM, Auger Eric wrote: The patches are dependent on some changes in the mc-bus (bus/fsl-mc) driver. The changes were needed in order to re-use code and to export some more functions that are needed by the VFIO driver. Currenlty the mc-bus patches are under review:

Re: [PATCH v3 03/13] bus/fsl-mc: add support for 'driver_override' in the mc-bus

2020-07-06 Thread Diana Craciun OSS
Hi Andrew, I apologize, I somehow missed you previous comment. OK, I see that there are a number of drivers using the same code. In case we share the code, probably we need to store the driver_override value in the struct device (not in the particular driver device structure as it is done

Re: [PATCH v3 13/13] bus/fsl-mc: Add a new version for dprc_get_obj_region command

2020-07-06 Thread Diana Craciun OSS
On 7/6/2020 4:14 PM, Laurentiu Tudor wrote: On 7/6/2020 3:42 PM, Diana Craciun wrote: From: Diana Craciun The region size reported by the firmware for mc and software portals was less than allocated by the hardware. This may be problematic when mmapping the region in user space because the

Re: [PATCH v2 4/9] vfio/fsl-mc: Implement VFIO_DEVICE_GET_REGION_INFO ioctl call

2020-06-04 Thread Diana Craciun OSS
On 6/2/2020 7:12 AM, Alex Williamson wrote: On Fri, 8 May 2020 10:20:34 +0300 Diana Craciun wrote: Expose to userspace information about the memory regions. Signed-off-by: Bharat Bhushan Signed-off-by: Diana Craciun --- drivers/vfio/fsl-mc/vfio_fsl_mc.c | 77

Re: [PATCH v2 5/9] vfio/fsl-mc: Allow userspace to MMAP fsl-mc device MMIO regions

2020-06-04 Thread Diana Craciun OSS
On 6/2/2020 7:12 AM, Alex Williamson wrote: On Fri, 8 May 2020 10:20:35 +0300 Diana Craciun wrote: Allow userspace to mmap device regions for direct access of fsl-mc devices. Signed-off-by: Bharat Bhushan Signed-off-by: Diana Craciun --- drivers/vfio/fsl-mc/vfio_fsl_mc.c | 60