qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vhost_net: init acked_features to backend_features
@ 2014-09-03  8:57 Michael S. Tsirkin
  2014-09-03  9:16 ` Jason Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2014-09-03  8:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jason Wang, Andrey Korolyov, qemu-stable, Nikolay Nikolaev

commit 2e6d46d77ed328d34a94688da8371bcbe243479b (vhost: add
vhost_get_features and vhost_ack_features) removes the step that
initializes the acked_features to backend_features.

As this field is now uninitialized, vhost initialization will sometimes
fail.

To fix, initialize field in core vhost code.

As the next step, cleanup vhost scsi code as well.

Reported-by: Jason Wang <jasowang@redhat.com>
Reported-by: Andrey Korolyov <andrey@xdel.ru>
Cc: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/vhost.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 5d7c40a..e42e51f 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -873,6 +873,9 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
     hdev->memory_changed = false;
     memory_listener_register(&hdev->memory_listener, &address_space_memory);
     hdev->force = force;
+    /* Set minimal required set of features. */
+    hdev->acked_features = hdev->backend_features;
+
     return 0;
 fail_vq:
     while (--i >= 0) {
-- 
MST

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] vhost_net: init acked_features to backend_features
  2014-09-03  8:57 [Qemu-devel] [PATCH] vhost_net: init acked_features to backend_features Michael S. Tsirkin
@ 2014-09-03  9:16 ` Jason Wang
  2014-09-03  9:29   ` Andrey Korolyov
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Wang @ 2014-09-03  9:16 UTC (permalink / raw)
  To: Michael S. Tsirkin, qemu-devel
  Cc: Andrey Korolyov, qemu-stable, Nikolay Nikolaev

On 09/03/2014 04:57 PM, Michael S. Tsirkin wrote:
> commit 2e6d46d77ed328d34a94688da8371bcbe243479b (vhost: add
> vhost_get_features and vhost_ack_features) removes the step that
> initializes the acked_features to backend_features.
>
> As this field is now uninitialized, vhost initialization will sometimes
> fail.
>
> To fix, initialize field in core vhost code.
>
> As the next step, cleanup vhost scsi code as well.
>
> Reported-by: Jason Wang <jasowang@redhat.com>
> Reported-by: Andrey Korolyov <andrey@xdel.ru>
> Cc: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  hw/virtio/vhost.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index 5d7c40a..e42e51f 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -873,6 +873,9 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
>      hdev->memory_changed = false;
>      memory_listener_register(&hdev->memory_listener, &address_space_memory);
>      hdev->force = force;
> +    /* Set minimal required set of features. */
> +    hdev->acked_features = hdev->backend_features;
> +
>      return 0;
>  fail_vq:
>      while (--i >= 0) {

Since vhost_ack_features() never clear a bit, if rebooting from a guest
w/ mrg rx buffer to a guest w/o it, network is broken?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] vhost_net: init acked_features to backend_features
  2014-09-03  9:16 ` Jason Wang
@ 2014-09-03  9:29   ` Andrey Korolyov
  0 siblings, 0 replies; 3+ messages in thread
From: Andrey Korolyov @ 2014-09-03  9:29 UTC (permalink / raw)
  To: Jason Wang
  Cc: qemu-stable, qemu-devel@nongnu.org, Nikolay Nikolaev,
	Michael S. Tsirkin

On Wed, Sep 3, 2014 at 1:16 PM, Jason Wang <jasowang@redhat.com> wrote:
> On 09/03/2014 04:57 PM, Michael S. Tsirkin wrote:
>> commit 2e6d46d77ed328d34a94688da8371bcbe243479b (vhost: add
>> vhost_get_features and vhost_ack_features) removes the step that
>> initializes the acked_features to backend_features.
>>
>> As this field is now uninitialized, vhost initialization will sometimes
>> fail.
>>
>> To fix, initialize field in core vhost code.
>>
>> As the next step, cleanup vhost scsi code as well.
>>
>> Reported-by: Jason Wang <jasowang@redhat.com>
>> Reported-by: Andrey Korolyov <andrey@xdel.ru>
>> Cc: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
>> Cc: qemu-stable@nongnu.org
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>> ---
>>  hw/virtio/vhost.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
>> index 5d7c40a..e42e51f 100644
>> --- a/hw/virtio/vhost.c
>> +++ b/hw/virtio/vhost.c
>> @@ -873,6 +873,9 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
>>      hdev->memory_changed = false;
>>      memory_listener_register(&hdev->memory_listener, &address_space_memory);
>>      hdev->force = force;
>> +    /* Set minimal required set of features. */
>> +    hdev->acked_features = hdev->backend_features;
>> +
>>      return 0;
>>  fail_vq:
>>      while (--i >= 0) {
>
> Since vhost_ack_features() never clear a bit, if rebooting from a guest
> w/ mrg rx buffer to a guest w/o it, network is broken?

Networking is broken just after start, and buffer memory getting
corrupted at reset:

qemu-system-x86_64: /tmp/buildd/qemu-2.1.0+f1/memory.c:1614:
memory_region_del_eventfd: Assertion `i != mr->ioeventfd_nb' failed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-03  9:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-03  8:57 [Qemu-devel] [PATCH] vhost_net: init acked_features to backend_features Michael S. Tsirkin
2014-09-03  9:16 ` Jason Wang
2014-09-03  9:29   ` Andrey Korolyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).