[PATCH 1/1] virtio_ccw: introduce device_lost in virtio_ccw_device

2014-04-25 Thread Heinz Graalfs
device_unregister(). This avoids hangs of I/O triggered via the device unregistration callbacks. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com Reviewed-by: Cornelia Huck cornelia.h...@de.ibm.com --- drivers/s390/kvm/virtio_ccw.c | 49 --- 1 file changed, 37

virtio: virtio_break_device() to mark all virtqueues broken.

2014-04-02 Thread Heinz Graalfs
Hello Rusty, the subject patch was part of your original patch series on January 15th. When is that planned to go upstream? Heinz On 01/04/14 04:58, Rusty Russell wrote: The following changes since commit 33807f4f0daec3b00565c2932d95f614f5833adf: Merge branch 'for-next' of

Re: [PATCH v4 RFC 0/3] virtio: add 'device_lost' to virtio_device

2014-02-20 Thread Heinz Graalfs
On 20/02/14 09:03, Rusty Russell wrote: Heinz Graalfs graa...@linux.vnet.ibm.com writes: On 29/01/14 07:31, Rusty Russell wrote: Heinz Graalfs graa...@linux.vnet.ibm.com writes: On 23/01/14 05:51, Rusty Russell wrote: Heinz Graalfs graa...@linux.vnet.ibm.com writes: Hi, here is my v4 patch

Re: [PATCH v4 RFC 0/3] virtio: add 'device_lost' to virtio_device

2014-02-18 Thread Heinz Graalfs
On 29/01/14 07:31, Rusty Russell wrote: Heinz Graalfs graa...@linux.vnet.ibm.com writes: On 23/01/14 05:51, Rusty Russell wrote: Heinz Graalfs graa...@linux.vnet.ibm.com writes: Hi, here is my v4 patch-set update to the v3 RFC submitted on Nov 27th. Hi Heinz, I didn't get

Re: [PATCH 0/3] tools/virtio: build fixes for virtio_test

2014-02-13 Thread Heinz Graalfs
added: Fixes: 53c18c9906441 (virtio_test: verify if virtqueue_kick() succeeded) Cc: Heinz Graalfs graa...@linux.vnet.ibm.com Heinz, you didn't compile test your patch. Insert angry-Torvalds-face here, Rusty. Rusty, yes, I missed to compile the test module. I'm sorry. Heinz

Re: [PATCH v4 RFC 0/3] virtio: add 'device_lost' to virtio_device

2014-01-28 Thread Heinz Graalfs
On 23/01/14 05:51, Rusty Russell wrote: Heinz Graalfs graa...@linux.vnet.ibm.com writes: Hi, here is my v4 patch-set update to the v3 RFC submitted on Nov 27th. Hi Heinz, I didn't get a response on my 'break all the virtqueues' patch series. Could your System Z code work

Fwd: Re: [PATCH v4 RFC 0/3] virtio: add 'device_lost' to virtio_device

2014-01-13 Thread Heinz Graalfs
Rusty, a Happy New Year! how about my answer? What am I missing? Original Message Subject: Re: [PATCH v4 RFC 0/3] virtio: add 'device_lost' to virtio_device Date: Mon, 23 Dec 2013 09:39:13 +0100 From: Heinz Graalfs graa...@linux.vnet.ibm.com To: Rusty Russell ru

Re: [PATCH v4 RFC 0/3] virtio: add 'device_lost' to virtio_device

2013-12-23 Thread Heinz Graalfs
On 19/12/13 01:19, Rusty Russell wrote: Heinz Graalfs graa...@linux.vnet.ibm.com writes: On 17/12/13 04:42, Rusty Russell wrote: Heinz Graalfs graa...@linux.vnet.ibm.com writes: Hi, here is my v4 patch-set update to the v3 RFC submitted on Nov 27th. When an active virtio block device is hot

Re: [PATCH v4 RFC 0/3] virtio: add 'device_lost' to virtio_device

2013-12-17 Thread Heinz Graalfs
On 17/12/13 04:42, Rusty Russell wrote: Heinz Graalfs graa...@linux.vnet.ibm.com writes: Hi, here is my v4 patch-set update to the v3 RFC submitted on Nov 27th. When an active virtio block device is hot-unplugged from a KVM guest, affected guest user applications are not aware of any errors

[PATCH v4 RFC 2/3] virtio: introduce 'device_lost' flag in virtio_device

2013-12-13 Thread Heinz Graalfs
blk_cleanup_queue() when the device_lost flag is set due to a disappeared device. It avoid hangs due to incomplete requests (e.g. in-flight requests). Such requests must be considered as lost. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com Acked-by: Cornelia Huck cornelia.h...@de.ibm.com

[PATCH v4 RFC 1/3] virtio_ccw: fix vcdev pointer handling issues

2013-12-13 Thread Heinz Graalfs
memory removes a critical path. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com Acked-by: Cornelia Huck cornelia.h...@de.ibm.com --- drivers/s390/kvm/virtio_ccw.c | 35 --- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/drivers/s390/kvm

[PATCH v4 RFC 0/3] virtio: add 'device_lost' to virtio_device

2013-12-13 Thread Heinz Graalfs
Heinz Graalfs (3): virtio_ccw: fix vcdev pointer handling issues virtio: introduce 'device_lost' flag in virtio_device virtio_ccw: set 'device_lost' on CIO_GONE notification drivers/block/virtio_blk.c| 14 ++- drivers/s390/kvm/virtio_ccw.c | 58

[PATCH v4 RFC 3/3] virtio_ccw: set 'device_lost' on CIO_GONE notification

2013-12-13 Thread Heinz Graalfs
running. The virtio_device pointer might point to freed memory in that case. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com Acked-by: Cornelia Huck cornelia.h...@de.ibm.com --- drivers/s390/kvm/virtio_ccw.c | 23 +-- 1 file changed, 21 insertions(+), 2 deletions

Re: [PATCH v2 RFC 3/3] virtio_ccw: invoke virtio_driver's notify() on CIO_GONE notification

2013-11-27 Thread Heinz Graalfs
On 21/11/13 19:31, Michael S. Tsirkin wrote: On Thu, Nov 21, 2013 at 06:12:21PM +0100, Heinz Graalfs wrote: On 21/11/13 16:15, Michael S. Tsirkin wrote: On Thu, Nov 21, 2013 at 03:45:33PM +0100, Heinz Graalfs wrote: virtio_ccw's notify() callback for the common IO layer invokes

[PATCH v3 RFC 4/4] virtio_ccw: set surprize_removal in virtio_device if a device was lost

2013-11-27 Thread Heinz Graalfs
Code is added to the notify handler to set the 'surprize_removal' flag in virtio_device in case a CIO_GONE notification occurs. The remove callback of the backend driver must check this flag in order to perform special processing for a lost device. Signed-off-by: Heinz Graalfs graa

[PATCH v3 RFC 2/4] virtio_blk: avoid further request queueing on device loss

2013-11-27 Thread Heinz Graalfs
resulting in a hang. This is a weird situation, and most likely not 'serializable'. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/block/virtio_blk.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 2d43be4

[PATCH v3 RFC 0/4] virtio: add 'surprize_removal' to virtio_device

2013-11-27 Thread Heinz Graalfs
a device is lost v1-v2 changes: - add include of linux/notifier.h (I also added it to the 3rd patch) - get queue lock in order to be able to use safe queue_flag_set() functions in virtblk_notify() handler Heinz Graalfs (4): virtio: add surprize_removal to virtio_device virtio_blk: avoid

[PATCH v3 RFC 1/4] virtio: add surprize_removal to virtio_device

2013-11-27 Thread Heinz Graalfs
-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/virtio/virtio.c | 1 + include/linux/virtio.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index ee59b74..290d1e2 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c

[PATCH v3 RFC 3/4] virtio_blk: avoid calling blk_cleanup_queue() on device loss

2013-11-27 Thread Heinz Graalfs
likely not 'serializable'. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/block/virtio_blk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 0f64282..8c05001 100644 --- a/drivers/block/virtio_blk.c

Re: [PATCH v3 RFC 3/4] virtio_blk: avoid calling blk_cleanup_queue() on device loss

2013-11-27 Thread Heinz Graalfs
On 27/11/13 11:47, Michael S. Tsirkin wrote: On Wed, Nov 27, 2013 at 11:32:39AM +0100, Heinz Graalfs wrote: Code is added to avoid calling blk_cleanup_queue() when the surprize_removal flag is set due to a disappeared device. It avoid hangs due to incomplete requests (e.g. in-flight requests

Re: [PATCH v3 RFC 3/4] virtio_blk: avoid calling blk_cleanup_queue() on device loss

2013-11-27 Thread Heinz Graalfs
On 27/11/13 13:49, Michael S. Tsirkin wrote: On Wed, Nov 27, 2013 at 12:37:02PM +0100, Heinz Graalfs wrote: On 27/11/13 11:47, Michael S. Tsirkin wrote: On Wed, Nov 27, 2013 at 11:32:39AM +0100, Heinz Graalfs wrote: Code is added to avoid calling blk_cleanup_queue() when the surprize_removal

[PATCH v2 RFC 0/3] virtio: add new notify() callback to virtio_driver

2013-11-21 Thread Heinz Graalfs
modifies the CIO notify handler in virtio_ccw's transport layer to pass on the lost device info to virtio's backend driver virtio_blk. Heinz Graalfs (3): virtio: add notify() callback to virtio_driver virtio_blk: add virtblk_notify() as virtio_driver's notify() callback virtio_ccw: invoke

[PATCH v2 RFC 1/3] virtio: add notify() callback to virtio_driver

2013-11-21 Thread Heinz Graalfs
in include/linux/notifier.h. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/virtio/virtio.c | 9 + include/linux/virtio.h | 10 ++ 2 files changed, 19 insertions(+) diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index ee59b74..a7f4302 100644

[PATCH v2 RFC 2/3] virtio_blk: add virtblk_notify() as virtio_driver's notify() callback

2013-11-21 Thread Heinz Graalfs
errors. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/block/virtio_blk.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 2d43be4..04fd635 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers

Re: [PATCH v2 RFC 3/3] virtio_ccw: invoke virtio_driver's notify() on CIO_GONE notification

2013-11-21 Thread Heinz Graalfs
On 21/11/13 16:15, Michael S. Tsirkin wrote: On Thu, Nov 21, 2013 at 03:45:33PM +0100, Heinz Graalfs wrote: virtio_ccw's notify() callback for the common IO layer invokes virtio_driver's notify() callback to pass-on information to a backend driver if an online device disappeared. Signed-off

Re: [PATCH RFC 0/3] virtio: add new notify() callback to virtio_driver

2013-11-21 Thread Heinz Graalfs
On 21/11/13 07:47, Michael S. Tsirkin wrote: On Wed, Nov 20, 2013 at 04:22:00PM +0100, Heinz Graalfs wrote: Hi, when an active virtio block device is hot-unplugged from a KVM guest, running affected guest user applications are not aware of any errors that occur due to the lost device

Re: [PATCH RFC 0/3] virtio: add new notify() callback to virtio_driver

2013-11-21 Thread Heinz Graalfs
On 21/11/13 15:58, Michael S. Tsirkin wrote: On Thu, Nov 21, 2013 at 03:43:51PM +0100, Heinz Graalfs wrote: On 21/11/13 07:47, Michael S. Tsirkin wrote: On Wed, Nov 20, 2013 at 04:22:00PM +0100, Heinz Graalfs wrote: Hi, when an active virtio block device is hot-unplugged from a KVM guest

[PATCH RFC 0/3] virtio: add new notify() callback to virtio_driver

2013-11-20 Thread Heinz Graalfs
request queueing. Patch 3 modifies the CIO notify handler in virtio_ccw's transport layer to pass on the lost device info to virtio's backend driver virtio_blk. Heinz Graalfs (3): virtio: add notify() callback to virtio_driver virtio_blk: add virtblk_notify() as virtio_driver's notify() callback

[PATCH RFC 1/3] virtio: add notify() callback to virtio_driver

2013-11-20 Thread Heinz Graalfs
in include/linux/notifier.h. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/virtio/virtio.c | 8 include/linux/virtio.h | 10 ++ 2 files changed, 18 insertions(+) diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index ee59b74..a09abb4 100644

[PATCH RFC 2/3] virtio_blk: add virtblk_notify() as virtio_driver's notify() callback

2013-11-20 Thread Heinz Graalfs
errors. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/block/virtio_blk.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 2d43be4..7fc1d62 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block

[PATCH RFC 3/3] virtio_ccw: invoke virtio_driver's notify() on CIO_GONE notification

2013-11-20 Thread Heinz Graalfs
virtio_ccw's notify() callback for the common IO layer invokes virtio_driver's notify() callback to pass-on information to a backend driver if an online device disappeared. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/s390/kvm/virtio_ccw.c | 14 -- 1 file

[PATCH V2 RFC 9/9] virtio_scsi: verify if queue is broken after virtqueue_get_buf()

2013-11-04 Thread Heinz Graalfs
If virtqueue_get_buf() returned with a NULL pointer avoid a possibly endless loop by checking for a broken virtqueue. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/scsi/virtio_scsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers

[PATCH V2 RFC 9/9] virtio_scsi: verify if queue is broken after virtqueue_get_buf()

2013-11-04 Thread Heinz Graalfs
Rusty, and here is patch 9 as you suggested. Thanks. Heinz Graalfs (9): virtio_ring: change host notification API virtio_ring: let virtqueue_{kick()/notify()} return a bool virtio_net: verify if virtqueue_kick() succeeded virtio_test: verify if virtqueue_kick() succeeded virtio_ring

[PATCH V2 RFC 1/9] virtio_ring: change host notification API

2013-10-28 Thread Heinz Graalfs
Rusty, here is just patch 1 (using bool as return value in notify API). Thanks. Heinz Graalfs (9): virtio_ring: change host notification API virtio_ring: let virtqueue_{kick()/notify()} return a bool virtio_net: verify if virtqueue_kick() succeeded virtio_test: verify if virtqueue_kick

[PATCH V2 RFC 1/9] virtio_ring: change host notification API

2013-10-28 Thread Heinz Graalfs
changes the notify API. The notify function must return a bool return value. It returns false if the host notification failed. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/lguest/lguest_device.c | 3 ++- drivers/remoteproc/remoteproc_virtio.c | 3 ++- drivers/s390/kvm

[PATCH V2 RFC 8/9] virtio_net: verify if queue is broken after virtqueue_get_buf()

2013-10-24 Thread Heinz Graalfs
If a virtqueue_get_buf() call returns a NULL pointer a possibly endless while loop should be avoided by checking for a broken virtqueue. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/net/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH V2 RFC 4/9] virtio_test: verify if virtqueue_kick() succeeded

2013-10-24 Thread Heinz Graalfs
Verify if a host kick succeeded by checking return value of virtqueue_kick(). Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- tools/virtio/virtio_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c index

[PATCH V2 RFC 3/9] virtio_net: verify if virtqueue_kick() succeeded

2013-10-24 Thread Heinz Graalfs
Verify if a host kick succeeded by checking return value of virtqueue_kick(). Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/net/virtio_net.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c

[PATCH V2 RFC 0/9] virtio: fix hang(loop) after hot-unplug vlan

2013-10-24 Thread Heinz Graalfs
(). This function should be used to verify the state of a virtqueue when a previous virtqueue_get_buf() returned a NULL pointer. Patch [6,7,8,9] add virtqueue_is_broken() calls to handle potential errors when a virtqueue_bet_buf() doesn't deliver any more buffers. Heinz Graalfs (9): virtio_ring

[PATCH V2 RFC 1/9] virtio_ring: change host notification API

2013-10-24 Thread Heinz Graalfs
changes the notify API. The notify function must return a negative int return value in case the host notification failed. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/lguest/lguest_device.c | 3 ++- drivers/remoteproc/remoteproc_virtio.c | 3 ++- drivers/s390/kvm

[PATCH V2 RFC 2/9] virtio_ring: let virtqueue_{kick()/notify()} return a bool

2013-10-24 Thread Heinz Graalfs
-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/virtio/virtio_ring.c | 20 include/linux/virtio.h | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index aa40f6c..a7e0eec

[PATCH V2 RFC 7/9] virtio_console: verify if queue is broken after virtqueue_get_buf()

2013-10-24 Thread Heinz Graalfs
If virtqueue_get_buf() returns with a NULL pointer it should be verified if the virtqueue is broken, in order to avoid loop calling cpu_relax(). Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/char/virtio_console.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions

[PATCH V2 RFC 5/9] virtio_ring: add new function virtqueue_is_broken()

2013-10-24 Thread Heinz Graalfs
Add new function virtqueue_is_broken(). Callers of virtqueue_get_buf() should check for a broken queue. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/virtio/virtio_ring.c | 8 include/linux/virtio.h | 2 ++ 2 files changed, 10 insertions(+) diff --git

[PATCH V2 RFC 6/9] virtio_blk: verify if queue is broken after virtqueue_get_buf()

2013-10-24 Thread Heinz Graalfs
In case virtqueue_get_buf() returned with a NULL pointer verify if the virtqueue is broken in order to leave while loop. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/block/virtio_blk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/block/virtio_blk.c b

[PATCH V2 RFC 9/9] virtio_scsi: verify if queue is broken after virtqueue_get_buf()

2013-10-24 Thread Heinz Graalfs
If virtqueue_get_buf() returned with a NULL pointer avoid a possibly endless loop by checking for a broken virtqueue. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/scsi/virtio_scsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi

[PATCH RFC 4/7] virtio_blk: use dummy virtqueue_notify() to detect host kick error

2013-10-22 Thread Heinz Graalfs
host kick failed blk_cleanup_queue() should be invoked prior to del_gendisk(). Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/block/virtio_blk.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c

[PATCH RFC 0/7] virtio: avoid various hang situations during hot-unplug

2013-10-22 Thread Heinz Graalfs
device removal when virtblk_remove() invokes del_gendisk() to synch dirty inode pages (invalidate_partition()). The below patches [4,5,6,7] also exploit a 'broken' virtqueue in order to trigger IO errors as well as to prevent final hanging IO operations. Heinz Graalfs (7): virtio_ring: add new

[PATCH RFC 7/7] virtio_blk: trigger IO errors in case virtqueue is broken

2013-10-22 Thread Heinz Graalfs
In case the virtqueue is flagged as broken, IO errors are triggered for current request queue entries. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/block/virtio_blk.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/block/virtio_blk.c b/drivers

[PATCH RFC 6/7] virtio_blk: set request queue as dying in case virtqueue is broken

2013-10-22 Thread Heinz Graalfs
The request queue should be flagged as QUEUE_FLAG_DYING in case the host kick failed for a new virtqueue request. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/block/virtio_blk.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/block

[PATCH RFC 2/7] s390/virtio_ccw: set virtqueue as broken if host notify failed

2013-10-22 Thread Heinz Graalfs
Set the current virtqueue as broken if the appropriate host kick failed (e.g. if the device was hot-unplugged via host means). This error info can be exploited at various other places where a host kick is triggered. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/s390/kvm

[PATCH RFC 1/7] virtio_ring: add new functions virtqueue{_set_broken()/_is_broken()}

2013-10-22 Thread Heinz Graalfs
This patch adds 2 new functions: virtqueue_set_broken(): to be called when a virtqueue kick operation fails. virtqueue_is_broken(): can be called to query the virtqueue state after a host was kicked. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/virtio/virtio_ring.c | 16

[PATCH RFC 3/7] virtio_net: avoid cpu_relax() call loop in case virtqueue is broken

2013-10-22 Thread Heinz Graalfs
is flagged as broken. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/net/virtio_net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index ab2e5d0..57f5f13 100644 --- a/drivers/net/virtio_net.c +++ b/drivers