GSoC project: VIRTIO_F_IN_ORDER support for virtio devices

2022-05-27 Thread Guo Zhi
Hi everyone, I'm Zhi Guo, a student from GSoC 2022. My project is VIRTIO_F_IN_ORDER support for virtio devices. VIRTIO_F_IN_ORDER is a new feature presented in VIRTIO 1.1. As mentioned on the project description

Re: [PATCH] virtio_balloon: check virtqueue_add_outbuf() return value

2022-05-27 Thread Michael S. Tsirkin
On Fri, May 27, 2022 at 10:43:30AM +, Bo Liu (刘波)-浪潮信息 wrote: > The purpose of this patch is, virtqueue_add_outbuf() adding data to > virtqueue may succeed or fail. If successful, it will call virtqueue_kick() > to notifie the host backend driver, but if the virtqueue_add_outbuf() fails, > the

Re: [PATCH v4 0/4] Implement vdpasim stop operation

2022-05-27 Thread Michael S. Tsirkin
On Thu, May 26, 2022 at 12:54:32PM +, Parav Pandit wrote: > > > > From: Eugenio Pérez > > Sent: Thursday, May 26, 2022 8:44 AM > > > Implement stop operation for vdpa_sim devices, so vhost-vdpa will offer > > > > that backend feature and userspace can effectively stop the device. > > > >

Re: [PATCH V6 9/9] virtio: use WARN_ON() to warning illegal status value

2022-05-27 Thread Michael S. Tsirkin
At a minimum, I don't see why it's part of the series. Host can always crash the guest if it wants to ... The point of BUG_ON is device or driver is already corrupted so we should not try to drive it. If you still want this in pls come up with a better commit log explaining the why. On Fri, May

Re: [PATCH V6 3/9] virtio: introduce config op to synchronize vring callbacks

2022-05-27 Thread Stefano Garzarella
On Fri, May 27, 2022 at 02:01:14PM +0800, Jason Wang wrote: This patch introduces new virtio config op to vring callbacks. Transport specific method is required to make sure the write before this function is visible to the vring_interrupt() that is called after the return of this function. For

Re: [PATCH V6 9/9] virtio: use WARN_ON() to warning illegal status value

2022-05-27 Thread Stefano Garzarella
On Fri, May 27, 2022 at 02:01:20PM +0800, Jason Wang wrote: We used to use BUG_ON() in virtio_device_ready() to detect illegal status value, this seems sub-optimal since the value is under the control of the device. Switch to use WARN_ON() instead. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc:

Re: [PATCH V6 2/9] virtio: use virtio_reset_device() when possible

2022-05-27 Thread Stefano Garzarella
On Fri, May 27, 2022 at 02:01:13PM +0800, Jason Wang wrote: This allows us to do common extension without duplicating code. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc:

Re: [PATCH] virtio: Directly use ida_alloc()/free()

2022-05-27 Thread Michael S. Tsirkin
On Fri, May 27, 2022 at 07:33:02AM +, keliu wrote: > Use ida_alloc()/ida_free() instead of deprecated > ida_simple_get()/ida_simple_remove() . > > Signed-off-by: keliu Please Cc people that commented on the original patch. thanks! > --- > drivers/virtio/virtio.c | 6 +++--- > 1 file

Re: [PATCH] virtio_balloon: check virtqueue_add_outbuf() return value

2022-05-27 Thread Michael S. Tsirkin
On Thu, May 26, 2022 at 09:34:01PM -0400, Bo Liu wrote: > virtqueue_add_outbuf() can fail, when it fails, there is no need > to call the funciont virtqueue_kick(). > Signed-off-by: Bo Liu Sorry don't get it. What's the point of this patch really? > --- > drivers/virtio/virtio_balloon.c | 18

Re: [PATCH 4/4] virtio-blk: remove deprecated ida_simple_XXX()

2022-05-27 Thread Michael S. Tsirkin
On Fri, May 27, 2022 at 10:04:46AM +0200, Christophe JAILLET wrote: > (Resend, my email client sent it as HTML. So sorry for the duplicate) > > > Hi, > > > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c > > index 74c3a48cd1e5..e05748337dd1 100644 > > ---

[PATCH v8 1/1] crypto: Introduce RSA algorithm

2022-05-27 Thread zhenwei pi
There are two parts in this patch: 1, support akcipher service by cryptodev-builtin driver 2, virtio-crypto driver supports akcipher service In principle, we should separate this into two patches, to avoid compiling error, merge them into one. Then virtio-crypto gets request from guest side, and

Introduce akcipher service for virtio-crypto

2022-05-27 Thread zhenwei pi
v7 - v8: - The changes of QEMU crypto has been reviewed & merged by Daniel, remove this part from this series. Thanks to Daniel! - virtio_crypto.h is updated by e4082063e47e ("linux-headers: Update to v5.18-rc6"), remove from this series. - Minor fixes reviewed by Gonglei. Thanks to Gonglei!

Re: [PATCH V6 9/9] virtio: use WARN_ON() to warning illegal status value

2022-05-27 Thread Xuan Zhuo
On Fri, 27 May 2022 14:01:20 +0800, Jason Wang wrote: > We used to use BUG_ON() in virtio_device_ready() to detect illegal > status value, this seems sub-optimal since the value is under the > control of the device. Switch to use WARN_ON() instead. > > Cc: Thomas Gleixner > Cc: Peter Zijlstra >

Re: [PATCH V6 8/9] virtio: harden vring IRQ

2022-05-27 Thread Xuan Zhuo
On Fri, 27 May 2022 14:01:19 +0800, Jason Wang wrote: > This is a rework on the previous IRQ hardening that is done for > virtio-pci where several drawbacks were found and were reverted: > > 1) try to use IRQF_NO_AUTOEN which is not friendly to affinity managed IRQ >that is used by some

Re: [PATCH v3 2/4] vhost-vdpa: introduce STOP backend feature bit

2022-05-27 Thread Dan Carpenter
On Fri, May 27, 2022 at 08:50:16AM +0200, Eugenio Perez Martin wrote: > On Thu, May 26, 2022 at 9:07 PM Dan Carpenter > wrote: > > > > On Thu, May 26, 2022 at 07:00:06PM +0200, Eugenio Perez Martin wrote: > > > > It feels like returning any literal that isn't 1 or 0 should trigger a > > > >

Re: [PATCH V6 7/9] virtio: allow to unbreak virtqueue

2022-05-27 Thread Xuan Zhuo
On Fri, 27 May 2022 14:01:18 +0800, Jason Wang wrote: > This patch allows the new introduced __virtio_break_device() to > unbreak the virtqueue. > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Marc Zyngier > Cc: Halil Pasic > Cc: Cornelia Huck > Cc: Vineeth

Re: [PATCH V6 5/9] virtio-mmio: implement synchronize_cbs()

2022-05-27 Thread Xuan Zhuo
On Fri, 27 May 2022 14:01:16 +0800, Jason Wang wrote: > Simply synchronize the platform irq that is used by us. > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Marc Zyngier > Cc: Halil Pasic > Cc: Cornelia Huck > Cc: Vineeth Vijayan > Cc: Peter Oberparleiter >

Re: [PATCH V6 4/9] virtio-pci: implement synchronize_cbs()

2022-05-27 Thread Xuan Zhuo
On Fri, 27 May 2022 14:01:15 +0800, Jason Wang wrote: > We can simply reuse vp_synchronize_vectors() for .synchronize_cbs(). > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Marc Zyngier > Cc: Halil Pasic > Cc: Cornelia Huck > Cc: Vineeth Vijayan > Cc: Peter

Re: [PATCH V6 3/9] virtio: introduce config op to synchronize vring callbacks

2022-05-27 Thread Xuan Zhuo
On Fri, 27 May 2022 14:01:14 +0800, Jason Wang wrote: > This patch introduces new virtio config op to vring > callbacks. Transport specific method is required to make sure the > write before this function is visible to the vring_interrupt() that is > called after the return of this function. For

Re: [PATCH V6 2/9] virtio: use virtio_reset_device() when possible

2022-05-27 Thread Xuan Zhuo
On Fri, 27 May 2022 14:01:13 +0800, Jason Wang wrote: > This allows us to do common extension without duplicating code. > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Marc Zyngier > Cc: Halil Pasic > Cc: Cornelia Huck > Cc: Vineeth Vijayan > Cc: Peter

Re: [PATCH V6 1/9] virtio: use virtio_device_ready() in virtio_device_restore()

2022-05-27 Thread Xuan Zhuo
On Fri, 27 May 2022 14:01:12 +0800, Jason Wang wrote: > From: Stefano Garzarella > > It will allow us to do extension on virtio_device_ready() without > duplicating code. > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Marc Zyngier > Cc: Halil Pasic > Cc:

Re: Re: [PATCH 0/3] recover hardware corrupted page by virtio balloon

2022-05-27 Thread zhenwei pi
On 5/27/22 02:37, Peter Xu wrote: On Wed, May 25, 2022 at 01:16:34PM -0700, Jue Wang wrote: The hypervisor _must_ emulate poisons identified in guest physical address space (could be transported from the source VM), this is to prevent silent data corruption in the guest. With a paravirtual

[PATCH V6 9/9] virtio: use WARN_ON() to warning illegal status value

2022-05-27 Thread Jason Wang
We used to use BUG_ON() in virtio_device_ready() to detect illegal status value, this seems sub-optimal since the value is under the control of the device. Switch to use WARN_ON() instead. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc:

[PATCH V6 8/9] virtio: harden vring IRQ

2022-05-27 Thread Jason Wang
This is a rework on the previous IRQ hardening that is done for virtio-pci where several drawbacks were found and were reverted: 1) try to use IRQF_NO_AUTOEN which is not friendly to affinity managed IRQ that is used by some device such as virtio-blk 2) done only for PCI transport The

[PATCH V6 7/9] virtio: allow to unbreak virtqueue

2022-05-27 Thread Jason Wang
This patch allows the new introduced __virtio_break_device() to unbreak the virtqueue. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s...@vger.kernel.org Signed-off-by:

[PATCH V6 6/9] virtio-ccw: implement synchronize_cbs()

2022-05-27 Thread Jason Wang
This patch tries to implement the synchronize_cbs() for ccw. For the vring_interrupt() that is called via virtio_airq_handler(), the synchronization is simply done via the airq_info's lock. For the vring_interrupt() that is called via virtio_ccw_int_handler(), a per device rwlock is introduced and

[PATCH V6 5/9] virtio-mmio: implement synchronize_cbs()

2022-05-27 Thread Jason Wang
Simply synchronize the platform irq that is used by us. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s...@vger.kernel.org Reviewed-by: Cornelia Huck Signed-off-by:

[PATCH V6 4/9] virtio-pci: implement synchronize_cbs()

2022-05-27 Thread Jason Wang
We can simply reuse vp_synchronize_vectors() for .synchronize_cbs(). Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s...@vger.kernel.org Reviewed-by: Cornelia Huck

[PATCH V6 3/9] virtio: introduce config op to synchronize vring callbacks

2022-05-27 Thread Jason Wang
This patch introduces new virtio config op to vring callbacks. Transport specific method is required to make sure the write before this function is visible to the vring_interrupt() that is called after the return of this function. For the transport that doesn't provide synchronize_vqs(), use

[PATCH V6 2/9] virtio: use virtio_reset_device() when possible

2022-05-27 Thread Jason Wang
This allows us to do common extension without duplicating code. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s...@vger.kernel.org Reviewed-by: Cornelia Huck

[PATCH V6 1/9] virtio: use virtio_device_ready() in virtio_device_restore()

2022-05-27 Thread Jason Wang
From: Stefano Garzarella It will allow us to do extension on virtio_device_ready() without duplicating code. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc:

[PATCH V6 0/9] rework on the IRQ hardening of virtio

2022-05-27 Thread Jason Wang
Hi All: This is a rework on the IRQ hardening for virtio which is done previously by the following commits are reverted: 9e35276a5344 ("virtio_pci: harden MSI-X interrupts") 080cd7c3ac87 ("virtio-pci: harden INTX interrupts") The reason is that it depends on the IRQF_NO_AUTOEN which may