Re: [PATCH] virtio_balloon: prevent uninitialized variable use

2017-03-28 Thread Ladi Prosek
On Tue, Mar 28, 2017 at 6:18 PM, Michael S. Tsirkin wrote: > On Mon, Mar 27, 2017 at 12:02:33PM +0200, Ladi Prosek wrote: >> On Fri, Mar 24, 2017 at 9:59 PM, Michael S. Tsirkin wrote: >> > On Fri, Mar 24, 2017 at 09:40:07PM +0100, Arnd Bergmann wrote: >> >> On Fri,

[PATCH v3 3/3] virtio_balloon: prevent uninitialized variable use

2017-03-28 Thread Ladi Prosek
b1f6 ("virtio: Add memory statistics reporting to the balloon driver (V4)") Signed-off-by: Arnd Bergmann Signed-off-by: Ladi Prosek --- drivers/virtio/virtio_balloon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virt

[PATCH v3 2/3] virtio-balloon: use actual number of stats for stats queue buffers

2017-03-28 Thread Ladi Prosek
when pushing buffers to the stats virtqueue. Note that it is still out of spec to change the number of counters at run-time. "Driver MUST supply the same subset of statistics in all buffers submitted to the statsq." Suggested-by: Arnd Bergmann Signed-off-by: Ladi Prosek --- driv

[PATCH v3 1/3] virtio_balloon: don't push uninitialized buffers to stats virtqueue

2017-03-28 Thread Ladi Prosek
-off-by: Ladi Prosek --- drivers/virtio/virtio_balloon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 4e11915..fcd06e1 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -429,6 +429,8

[PATCH v3 0/3] virtio_balloon: don't push uninitialized buffers to stats virtqueue

2017-03-28 Thread Ladi Prosek
on: prevent uninitialized variable use Ladi Prosek (2): virtio_balloon: don't push uninitialized buffers to stats virtqueue virtio-balloon: use actual number of stats for stats queue buffers drivers/virtio/virtio_balloon.c | 19 +-- 1 file changed, 13 insertions

Re: [PATCH] virtio_balloon: prevent uninitialized variable use

2017-03-27 Thread Ladi Prosek
On Fri, Mar 24, 2017 at 9:59 PM, Michael S. Tsirkin wrote: > On Fri, Mar 24, 2017 at 09:40:07PM +0100, Arnd Bergmann wrote: >> On Fri, Mar 24, 2017 at 9:11 PM, Ladi Prosek wrote: >> > On Fri, Mar 24, 2017 at 7:38 PM, David Hildenbrand >> > wrote: >> >> O

Re: [PATCH] virtio_balloon: prevent uninitialized variable use

2017-03-24 Thread Ladi Prosek
On Fri, Mar 24, 2017 at 7:38 PM, David Hildenbrand wrote: > On 23.03.2017 16:17, Arnd Bergmann wrote: >> The latest gcc-7.0.1 snapshot reports a new warning: >> >> virtio/virtio_balloon.c: In function 'update_balloon_stats': >> virtio/virtio_balloon.c:258:26: error: 'events[2]' is used uninitializ

[PATCH v2] virtio_balloon: don't push uninitialized buffers to stats virtqueue

2017-03-23 Thread Ladi Prosek
ffers submitted to the statsq". * Push a buffer with invalid tags in init_vqs. Violates the same spec clause, plus "invalid tag" is not really defined. Signed-off-by: Ladi Prosek --- v1->v2: * Call update_balloon_stats instead of filling the buffer with invali

Re: [PATCH] virtio_balloon: don't push uninitialized buffers to stats virtqueue

2017-03-22 Thread Ladi Prosek
On Wed, Mar 22, 2017 at 6:15 PM, Michael S. Tsirkin wrote: > On Wed, Mar 22, 2017 at 06:05:39PM +0100, Ladi Prosek wrote: >> On Wed, Mar 22, 2017 at 5:14 PM, Michael S. Tsirkin wrote: >> > On Wed, Mar 22, 2017 at 04:10:27PM +0100, Ladi Prosek wrote: >> >> When init_

Re: [PATCH] virtio_balloon: don't push uninitialized buffers to stats virtqueue

2017-03-22 Thread Ladi Prosek
On Wed, Mar 22, 2017 at 5:14 PM, Michael S. Tsirkin wrote: > On Wed, Mar 22, 2017 at 04:10:27PM +0100, Ladi Prosek wrote: >> When init_vqs runs, virtio_balloon.stats is either uninitialized or >> contains stale values. The host updates its state with garbage data >> bec

[PATCH] virtio_balloon: don't push uninitialized buffers to stats virtqueue

2017-03-22 Thread Ladi Prosek
ignored by the host. The alternative fix would be to push an empty buffer in init_vqs but that's not easily done with the current virtio implementation and would still not eliminate the invariant that update_balloon_stats has to update all VIRTIO_BALLOON_S_NR fields. Signed-off-by: Ladi P

[PATCH v2] virtio_ring: Make interrupt suppression spec compliant

2016-09-06 Thread Ladi Prosek
field (vring_used_event) are still unconditional. Cc: Michael S. Tsirkin Cc: # f277ec4 virtio_ring: shadow available Cc: Signed-off-by: Ladi Prosek --- v1->v2: * fixed coding style * perf measurement results added to commit message * patch sent to virtualization@lists.linux-foundation.org (