Re: [RFC v4 11/11] vduse: Support binding irq to the specified cpu

2021-03-03 Thread Jason Wang
On 2021/2/23 7:50 下午, Xie Yongji wrote: Add a parameter for the ioctl VDUSE_INJECT_VQ_IRQ to support injecting virtqueue's interrupt to the specified cpu. How userspace know which CPU is this irq for? It looks to me we need to do it at different level. E.g introduce some API in sys to

Re: [RFC v4 10/11] vduse: Introduce a workqueue for irq injection

2021-03-03 Thread Jason Wang
On 2021/2/23 7:50 下午, Xie Yongji wrote: This patch introduces a workqueue to support injecting virtqueue's interrupt asynchronously. This is mainly for performance considerations which makes sure the push() and pop() for used vring can be asynchronous. Do you have pref numbers for this

Re: [RFC v4 09/11] Documentation: Add documentation for VDUSE

2021-03-03 Thread Jason Wang
On 2021/2/23 7:50 下午, Xie Yongji wrote: VDUSE (vDPA Device in Userspace) is a framework to support implementing software-emulated vDPA devices in userspace. This document is intended to clarify the VDUSE design and usage. Signed-off-by: Xie Yongji --- Documentation/userspace-api/index.rst |

Re: [RFC v4 07/11] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-03-03 Thread Jason Wang
On 2021/2/23 7:50 下午, Xie Yongji wrote: This VDUSE driver enables implementing vDPA devices in userspace. Both control path and data path of vDPA devices will be able to be handled in userspace. In the control path, the VDUSE driver will make use of message mechnism to forward the config

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-03 Thread kernel test robot
Hi Jie, Thank you for the patch! Yet something to improve: [auto build test ERROR on wsa/i2c/for-next] [also build test ERROR on vhost/linux-next linux/master linus/master v5.12-rc1 next-20210303] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch

RE: [PATCH RFC v1 12/15] iommu/virtio: Add support for INVALIDATE request

2021-03-03 Thread Tian, Kevin
> From: Jacob Pan > Sent: Thursday, March 4, 2021 2:29 AM > > Hi Vivek, > > On Fri, 15 Jan 2021 17:43:39 +0530, Vivek Gautam > wrote: > > > From: Jean-Philippe Brucker > > > > Add support for tlb invalidation ops that can send invalidation > > requests to back-end virtio-iommu when stage-1

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-03 Thread kernel test robot
Hi Jie, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on wsa/i2c/for-next] [also build test WARNING on vhost/linux-next linux/master linus/master v5.12-rc1 next-20210303] [If your patch is applied to the wrong git tree, kindly drop us a note. And when

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-03 Thread kernel test robot
Hi Jie, Thank you for the patch! Yet something to improve: [auto build test ERROR on wsa/i2c/for-next] [also build test ERROR on vhost/linux-next linux/master linus/master v5.12-rc1 next-20210303] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch

Re: [RFC v4 06/11] vduse: Implement an MMU-based IOMMU driver

2021-03-03 Thread Jason Wang
On 2021/2/23 7:50 下午, Xie Yongji wrote: This implements a MMU-based IOMMU driver to support mapping kernel dma buffer into userspace. The basic idea behind it is treating MMU (VA->PA) as IOMMU (IOVA->PA). The driver will set up MMU mapping instead of IOMMU mapping for the DMA transfer so that

Re: [PATCH RFC v1 15/15] iommu/virtio: Update fault type and reason info for viommu fault

2021-03-03 Thread Jean-Philippe Brucker
On Fri, Jan 15, 2021 at 05:43:42PM +0530, Vivek Gautam wrote: > Fault type information can tell about a page request fault or > an unreceoverable fault, and further additions to fault reasons > and the related PASID information can help in handling faults > efficiently. > > Signed-off-by: Vivek

Re: [RFC v4 05/11] vdpa: Support transferring virtual addressing during DMA mapping

2021-03-03 Thread Jason Wang
On 2021/2/23 7:50 下午, Xie Yongji wrote: This patch introduces an attribute for vDPA device to indicate whether virtual address can be used. If vDPA device driver set it, vhost-vdpa bus driver will not pin user page and transfer userspace virtual address instead of physical address during DMA

[PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-03 Thread Jie Deng
Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. The device specification can be found on https://lists.oasis-open.org/archives/virtio-comment/202101/msg8.html. By

Re: [PATCH v5] i2c: virtio: add a virtio i2c frontend driver

2021-03-03 Thread Jie Deng
On 2021/3/3 17:38, Viresh Kumar wrote: On 03-03-21, 16:46, Jie Deng wrote: This is not a problem. My original proposal was to mirror the struct i2c_msg. The code you looked at was based on that. However, the virtio TC prefer not to mirror it. They have some concerns. For example, there is a

Re: [PATCH RFC v1 13/15] iommu/virtio: Attach Arm PASID tables when available

2021-03-03 Thread Jean-Philippe Brucker
On Fri, Jan 15, 2021 at 05:43:40PM +0530, Vivek Gautam wrote: [...] > +static int viommu_setup_pgtable(struct viommu_endpoint *vdev, > + struct viommu_domain *vdomain) > +{ > + int ret, id; > + u32 asid; > + enum io_pgtable_fmt fmt; > + struct

Re: [PATCH RFC v1 08/15] iommu: Add asid_bits to arm smmu-v3 stage1 table info

2021-03-03 Thread Jean-Philippe Brucker
On Fri, Jan 15, 2021 at 05:43:35PM +0530, Vivek Gautam wrote: > aisd_bits data is required to prepare stage-1 tables for arm-smmu-v3. > > Signed-off-by: Vivek Gautam > Cc: Joerg Roedel > Cc: Will Deacon > Cc: Robin Murphy > Cc: Jean-Philippe Brucker > Cc: Eric Auger > Cc: Alex Williamson >

Re: [PATCH RFC v1 05/15] iommu/arm-smmu-v3: Set sync op from consumer driver of cd-lib

2021-03-03 Thread Jean-Philippe Brucker
On Fri, Jan 15, 2021 at 05:43:32PM +0530, Vivek Gautam wrote: > Te change allows different consumers of arm-smmu-v3-cd-lib to set > their respective sync op for pasid entries. > > Signed-off-by: Vivek Gautam > Cc: Joerg Roedel > Cc: Will Deacon > Cc: Robin Murphy > Cc: Jean-Philippe Brucker

Re: [PATCH v5] i2c: virtio: add a virtio i2c frontend driver

2021-03-03 Thread Stefan Hajnoczi
On Tue, Mar 02, 2021 at 11:54:02AM +0100, Arnd Bergmann wrote: > On Tue, Mar 2, 2021 at 10:51 AM Stefan Hajnoczi wrote: > > On Tue, Mar 02, 2021 at 10:42:06AM +0800, Jie Deng wrote: > > > > > +/* > > > > > + * Definitions for virtio I2C Adpter > > > > > + * > > > > > + * Copyright (c) 2021 Intel

Re: [PATCH RFC v1 09/15] iommu/virtio: Update table format probing header

2021-03-03 Thread Jean-Philippe Brucker
On Fri, Jan 15, 2021 at 05:43:36PM +0530, Vivek Gautam wrote: > Add info about asid_bits and additional flags to table format > probing header. > > Signed-off-by: Vivek Gautam > Cc: Joerg Roedel > Cc: Will Deacon > Cc: Michael S. Tsirkin > Cc: Robin Murphy > Cc: Jean-Philippe Brucker > Cc:

Re: [PATCH RFC v1 02/15] iommu: Add a simple PASID table library

2021-03-03 Thread Jean-Philippe Brucker
Hi Vivek, Thanks again for working on this. I have a few comments but it looks sensible overall. Regarding the overall design, I was initially assigning page directories instead of whole PASID tables, which would simplify the driver and host implementation. A major complication, however, is

Re: [PATCH RFC v1 04/15] iommu/arm-smmu-v3: Update CD base address info for user-space

2021-03-03 Thread Jean-Philippe Brucker
On Fri, Jan 15, 2021 at 05:43:31PM +0530, Vivek Gautam wrote: > Update base address information in vendor pasid table info to pass that > to user-space for stage1 table management. > > Signed-off-by: Vivek Gautam > Cc: Joerg Roedel > Cc: Will Deacon > Cc: Robin Murphy > Cc: Jean-Philippe

Re: [PATCH RFC v1 06/15] iommu/virtio: Add headers for table format probing

2021-03-03 Thread Jean-Philippe Brucker
On Fri, Jan 15, 2021 at 05:43:33PM +0530, Vivek Gautam wrote: > From: Jean-Philippe Brucker > > Add required UAPI defines for probing table format for underlying > iommu hardware. The device may provide information about hardware > tables and additional capabilities for each device. > This

Re: [virtio-comment] [RFC PATCH v1 1/1] virtio-vsock: add SOCK_SEQPACKET description

2021-03-03 Thread Cornelia Huck
On Wed, 3 Mar 2021 11:52:43 -0500 "Michael S. Tsirkin" wrote: > On Wed, Mar 03, 2021 at 01:08:43PM +0100, Cornelia Huck wrote: > > On Wed, 24 Feb 2021 10:32:00 +0100 > > Stefano Garzarella wrote: > > > > > On Thu, Feb 18, 2021 at 09:08:23AM +0300, Arseny Krasnov wrote: > > >

Re: [virtio-comment] [RFC PATCH v1 1/1] virtio-vsock: add SOCK_SEQPACKET description

2021-03-03 Thread Michael S. Tsirkin
On Wed, Mar 03, 2021 at 01:08:43PM +0100, Cornelia Huck wrote: > On Wed, 24 Feb 2021 10:32:00 +0100 > Stefano Garzarella wrote: > > > On Thu, Feb 18, 2021 at 09:08:23AM +0300, Arseny Krasnov wrote: > > >Signed-off-by: Arseny Krasnov > > >--- > > > virtio-vsock.tex | 40

[PATCH 1/5] x86/sev-es: Introduce ip_within_syscall_gap() helper

2021-03-03 Thread Joerg Roedel
From: Joerg Roedel Introduce a helper to check whether an exception came from the syscall gap and use it in the SEV-ES code. Extend the check to also cover the compatibility SYSCALL entry path. Fixes: 315562c9af3d5 ("x86/sev-es: Adjust #VC IST Stack on entering NMI handler") Cc:

[PATCH 2/5] x86/sev-es: Check if regs->sp is trusted before adjusting #VC IST stack

2021-03-03 Thread Joerg Roedel
From: Joerg Roedel The code in the NMI handler to adjust the #VC handler IST stack is needed in case an NMI hits when the #VC handler is still using its IST stack. But the check for this condition also needs to look if the regs->sp value is trusted, meaning it was not set by user-space. Extend

[PATCH 5/5] x86/sev-es: Use __copy_from_user_inatomic()

2021-03-03 Thread Joerg Roedel
From: Joerg Roedel The #VC handler must run atomic and can not be put to sleep. This is a problem when it tries to fetch instruction bytes from user-space via copy_from_user. Introduce a insn_fetch_from_user_inatomic() helper which uses __copy_from_user_inatomic() to safely copy the instruction

[PATCH 3/5] x86/sev-es: Optimize __sev_es_ist_enter() for better readability

2021-03-03 Thread Joerg Roedel
From: Joerg Roedel Reorganize the code and improve the comments to make the function more readable and easier to understand. Signed-off-by: Joerg Roedel --- arch/x86/kernel/sev-es.c | 36 1 file changed, 24 insertions(+), 12 deletions(-) diff --git

[PATCH 0/5 v2] x86/sev-es: SEV-ES Fixes for v5.12

2021-03-03 Thread Joerg Roedel
From: Joerg Roedel Hi, here are a couple of fixes for 5.12 in the SEV-ES guest support code. Patches 1-3 have in a similar form already been posted, so this is v2. The last two patches are new an arose from me running an SEV-ES guest with more debugging features and instrumentation enabled. I

[PATCH 4/5] x86/sev-es: Correctly track IRQ states in runtime #VC handler

2021-03-03 Thread Joerg Roedel
From: Joerg Roedel Call irqentry_nmi_enter()/irqentry_nmi_exit() in the #VC handler to correctly track the IRQ state during its execution. Reported-by: Andy Lutomirski Fixes: 0786138c78e79 ("x86/sev-es: Add a Runtime #VC Exception Handler") Cc: sta...@vger.kernel.org # v5.10+ Signed-off-by:

[PATCH] scsi: target: vhost-scsi: remove redundant initialization of variable ret

2021-03-03 Thread Colin King
From: Colin Ian King The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/vhost/scsi.c | 2 +- 1

Re: [virtio-comment] [RFC PATCH v1 1/1] virtio-vsock: add SOCK_SEQPACKET description

2021-03-03 Thread Stefano Garzarella
On Wed, Mar 03, 2021 at 01:08:43PM +0100, Cornelia Huck wrote: On Wed, 24 Feb 2021 10:32:00 +0100 Stefano Garzarella wrote: On Thu, Feb 18, 2021 at 09:08:23AM +0300, Arseny Krasnov wrote: >Signed-off-by: Arseny Krasnov >--- > virtio-vsock.tex | 40 +--- > 1

Re: [virtio-comment] [RFC PATCH v1 1/1] virtio-vsock: add SOCK_SEQPACKET description

2021-03-03 Thread Cornelia Huck
On Wed, 24 Feb 2021 10:32:00 +0100 Stefano Garzarella wrote: > On Thu, Feb 18, 2021 at 09:08:23AM +0300, Arseny Krasnov wrote: > >Signed-off-by: Arseny Krasnov > >--- > > virtio-vsock.tex | 40 +--- > > 1 file changed, 37 insertions(+), 3 deletions(-) > > >

RE: [PATCH linux-next 7/9] vdpa/mlx5: Provide device generated random MAC address

2021-03-03 Thread Parav Pandit
> From: Michael S. Tsirkin > Sent: Wednesday, March 3, 2021 2:59 PM > > On Wed, Mar 03, 2021 at 08:33:50AM +0200, Eli Cohen wrote: > > On Wed, Mar 03, 2021 at 05:59:50AM +0200, Parav Pandit wrote: > > > Hi Eli, > > > > > > > From: Eli Cohen > > > > Sent: Tuesday, March 2, 2021 11:09 AM > > >

Re: [PATCH linux-next 7/9] vdpa/mlx5: Provide device generated random MAC address

2021-03-03 Thread Michael S. Tsirkin
On Wed, Mar 03, 2021 at 03:59:50AM +, Parav Pandit wrote: > Hi Eli, > > > From: Eli Cohen > > Sent: Tuesday, March 2, 2021 11:09 AM > > > > On Mon, Mar 01, 2021 at 11:12:33AM -0500, Michael S. Tsirkin wrote: > > > On Mon, Mar 01, 2021 at 03:19:51PM +0200, Eli Cohen wrote: > > > > On Mon,

Re: [PATCH linux-next 7/9] vdpa/mlx5: Provide device generated random MAC address

2021-03-03 Thread Michael S. Tsirkin
On Wed, Mar 03, 2021 at 08:33:50AM +0200, Eli Cohen wrote: > On Wed, Mar 03, 2021 at 05:59:50AM +0200, Parav Pandit wrote: > > Hi Eli, > > > > > From: Eli Cohen > > > Sent: Tuesday, March 2, 2021 11:09 AM > > > > > > On Mon, Mar 01, 2021 at 11:12:33AM -0500, Michael S. Tsirkin wrote: > > > > On

Re: [PATCH linux-next 2/9] vdpa: Introduce query of device config layout

2021-03-03 Thread Adrian Moreno
On 3/2/21 5:25 AM, Jason Wang wrote: > > On 2021/3/1 8:06 下午, Sean Mooney wrote: >> On Mon, 2021-03-01 at 11:28 +0100, Adrian Moreno wrote: >>> On 3/1/21 8:50 AM, Jason Wang wrote: On 2021/3/1 3:29 下午, Parav Pandit wrote: >> From: Jason Wang >> Sent: Monday, March 1, 2021 9:29 AM

Re: [PATCH v5] i2c: virtio: add a virtio i2c frontend driver

2021-03-03 Thread Jie Deng
On 2021/3/3 15:54, Viresh Kumar wrote: On 01-03-21, 14:41, Jie Deng wrote: diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c +static int virtio_i2c_send_reqs(struct virtqueue *vq, + struct virtio_i2c_req *reqs, +

Re: [virtio-dev] Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-03-03 Thread Cornelia Huck
On Wed, 3 Mar 2021 12:01:01 +0800 Jason Wang wrote: > On 2021/3/2 8:08 下午, Cornelia Huck wrote: > > On Mon, 1 Mar 2021 11:51:08 +0800 > > Jason Wang wrote: > > > >> On 2021/3/1 5:25 上午, Michael S. Tsirkin wrote: > >>> On Fri, Feb 26, 2021 at 04:19:16PM +0800, Jason Wang wrote: > On