#
f8693c2c |
| 03-Mar-2016 |
Ladi Prosek <lprosek@redhat.com> |
virtio-rng: ask for more data if queue is not fully drained
This commit effectively reverts:
commit 4621c1768ef5d12171cca2aa1473595ecb9f1c9e Author: Amit Shah <amit.shah@redhat.com> Date: W
virtio-rng: ask for more data if queue is not fully drained
This commit effectively reverts:
commit 4621c1768ef5d12171cca2aa1473595ecb9f1c9e Author: Amit Shah <amit.shah@redhat.com> Date: Wed Nov 21 11:21:19 2012 +0530
virtio-rng: remove extra request for entropy
but instead of calling virtio_rng_process unconditionally, it first checks to see if the queue is empty as a little bit of optimization.
Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Message-Id: <1456998514-19271-1-git-send-email-lprosek@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
show more ...
|
#
51b19ebe |
| 04-Feb-2016 |
Paolo Bonzini <pbonzini@redhat.com> |
virtio: move allocation to virtqueue_pop/vring_pop
The return code of virtqueue_pop/vring_pop is unused except to check for errors or 0. We can thus easily move allocation inside the functions and
virtio: move allocation to virtqueue_pop/vring_pop
The return code of virtqueue_pop/vring_pop is unused except to check for errors or 0. We can thus easily move allocation inside the functions and just return a pointer to the VirtQueueElement.
The advantage is that we will be able to allocate only the space that is needed for the actual size of the s/g list instead of the full VIRTQUEUE_MAX_SIZE items. Currently VirtQueueElement takes about 48K of memory, and this kind of allocation puts a lot of stress on malloc. By cutting the size by two or three orders of magnitude, malloc can use much more efficient algorithms.
The patch is pretty large, but changes to each device are testable more or less independently. Splitting it would mostly add churn.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
show more ...
|
#
9b8bfe21 |
| 26-Jan-2016 |
Peter Maydell <peter.maydell@linaro.org> |
virtio: Clean up includes
Clean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
Signed-of
virtio: Clean up includes
Clean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1453832250-766-15-git-send-email-peter.maydell@linaro.org
show more ...
|
#
9d5b731d |
| 27-Jul-2015 |
Jason Wang <jasowang@redhat.com> |
virtio: get_features() can fail
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> Acked-by: Paolo Bo
virtio: get_features() can fail
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> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
621a20e0 |
| 15-Jul-2015 |
Pankaj Gupta <pagupta@redhat.com> |
virtio-rng: trigger timer only when guest requests for entropy
This patch triggers timer only when guest requests for entropy. As soon as first request from guest for entropy comes we set the timer.
virtio-rng: trigger timer only when guest requests for entropy
This patch triggers timer only when guest requests for entropy. As soon as first request from guest for entropy comes we set the timer. Timer bumps up the quota value when it gets triggered.
Signed-off-by: Pankaj Gupta <pagupta@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Message-Id: <1436962608-9961-2-git-send-email-pagupta@redhat.com>
[Re-worded patch subject, removed extra whitespace -- Amit]
Signed-off-by: Amit Shah <amit.shah@redhat.com>
show more ...
|
#
cc7a8ea7 |
| 17-Mar-2015 |
Markus Armbruster <armbru@redhat.com> |
Include qapi/qmp/qerror.h exactly where needed
In particular, don't include it into headers.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Include qapi/qmp/qerror.h exactly where needed
In particular, don't include it into headers.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
show more ...
|
#
fe704809 |
| 10-Jun-2015 |
Shannon Zhao <shannon.zhao@linaro.org> |
virtio-rng: move qdev properties into virtio-rng.c
As only one place in virtio-rng.c uses DEFINE_VIRTIO_RNG_PROPERTIES, there is no need to expose it. Inline it into virtio-rng.c to avoid wrongly us
virtio-rng: move qdev properties into virtio-rng.c
As only one place in virtio-rng.c uses DEFINE_VIRTIO_RNG_PROPERTIES, there is no need to expose it. Inline it into virtio-rng.c to avoid wrongly use.
Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
show more ...
|
#
019a3edb |
| 01-Jun-2015 |
Gerd Hoffmann <kraxel@redhat.com> |
virtio: make features 64bit wide
Make features 64bit wide everywhere.
On migration a full 64bit guest_features field is sent if one of the high bits is set, in addition to the lower 32bit guest_fea
virtio: make features 64bit wide
Make features 64bit wide everywhere.
On migration a full 64bit guest_features field is sent if one of the high bits is set, in addition to the lower 32bit guest_features field which must stay for compatibility reasons. That way we send the lower 32 feature bits twice, but the code is simpler because we don't have to split and compose the 64bit features into two 32bit fields.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
show more ...
|
#
a3a292c4 |
| 11-Dec-2014 |
Amit Shah <amit.shah@redhat.com> |
virtio-rng: fix check for period_ms validity
This was reported for this warning:
hw/virtio/virtio-rng.c:150:31: warning: logical not is only applied to the left hand side of comparison [-Wlogical-n
virtio-rng: fix check for period_ms validity
This was reported for this warning:
hw/virtio/virtio-rng.c:150:31: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
Reported-by: dcb Suggested-by: dcb Bug: https://bugs.launchpad.net/qemu/+bug/1393486 Reviewed-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Amos Kong <akong@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
show more ...
|
#
db12451d |
| 27-Nov-2014 |
David Gibson <david@gibson.dropbear.id.au> |
Fix for crash after migration in virtio-rng on bi-endian targets
VirtIO devices now remember which endianness they're operating in in order to support targets which may have guests of either endiann
Fix for crash after migration in virtio-rng on bi-endian targets
VirtIO devices now remember which endianness they're operating in in order to support targets which may have guests of either endianness, such as powerpc. This endianness state is transferred in a subsection of the virtio device's information.
With virtio-rng this can lead to an abort after a loadvm hitting the assert() in virtio_is_big_endian(). This can be reproduced by doing a migrate and load from file on a bi-endian target with a virtio-rng device. The actual guest state isn't particularly important to triggering this.
The cause is that virtio_rng_load_device() calls virtio_rng_process() which accesses the ring and thus needs the endianness. However, virtio_rng_process() is called via virtio_load() before it loads the subsections. Essentially the ->load callback in VirtioDeviceClass should only be used for actually reading the device state from the stream, not for post-load re-initialization.
This patch fixes the bug by moving the virtio_rng_process() after the call to virtio_load(). Better yet would be to convert virtio to use vmsd and have the virtio_rng_process() as a post_load callback, but that's a bigger project for another day.
This is bugfix, and should be considered for the 2.2 branch.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Message-id: 1417067290-20715-1-git-send-email-david@gibson.dropbear.id.au Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
4ac44580 |
| 04-Aug-2014 |
Amit Shah <amit.shah@redhat.com> |
virtio-rng: add some trace events
Add some trace events to virtio-rng for easier debugging
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com> Signed-off-by:
virtio-rng: add some trace events
Add some trace events to virtio-rng for easier debugging
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
c617dd3b |
| 29-Jul-2014 |
John Snow <jsnow@redhat.com> |
virtio-rng: replace error_set calls with error_setg
Under recommendation from Luiz Capitulino, we are changing the error_set calls to error_setg while we are fixing up the error handling pathways of
virtio-rng: replace error_set calls with error_setg
Under recommendation from Luiz Capitulino, we are changing the error_set calls to error_setg while we are fixing up the error handling pathways of virtio-rng.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
show more ...
|
#
1efd6e07 |
| 29-Jul-2014 |
John Snow <jsnow@redhat.com> |
virtio-rng: Move error-checking forward to prevent memory leak
This patch pushes the error-checking forward and the virtio initialization backward in the device realization function in order to prev
virtio-rng: Move error-checking forward to prevent memory leak
This patch pushes the error-checking forward and the virtio initialization backward in the device realization function in order to prevent memory leaks for hot plug scenarios.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
show more ...
|
#
713e8a10 |
| 21-Jul-2014 |
John Snow <jsnow@redhat.com> |
virtio-rng: Add human-readable error message for negative max-bytes parameter
If a negative integer is used for the max_bytes parameter, QEMU currently calls abort() and leaves behind a core dump. T
virtio-rng: Add human-readable error message for negative max-bytes parameter
If a negative integer is used for the max_bytes parameter, QEMU currently calls abort() and leaves behind a core dump. This patch replaces the abort with a simple error message to make the reason for the termination clearer. This also ensures device-hotplug with invalid input doesn't cause qemu to quit.
There is an underlying insufficiency in the parameter parsing code of QEMU that renders it unable to reject negative values for unsigned properties, thus the error message "a non-negative integer below 2^63" is the most user-friendly and correct message we can give until the underlying insufficiency is corrected.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
show more ...
|
#
3902d49e |
| 24-Jun-2014 |
Greg Kurz <gkurz@linux.vnet.ibm.com> |
virtio-rng: implement per-device migration calls
While we are here, we also check virtio_load() return value.
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@
virtio-rng: implement per-device migration calls
While we are here, we also check virtio_load() return value.
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
show more ...
|
#
1b5fc0de |
| 24-Jun-2014 |
Greg Kurz <gkurz@linux.vnet.ibm.com> |
virtio: introduce device specific migration calls
In order to migrate virtio subsections, they should be streamed after the device itself. We need the device specific code to be called from the comm
virtio: introduce device specific migration calls
In order to migrate virtio subsections, they should be streamed after the device itself. We need the device specific code to be called from the common migration code to achieve this. This patch introduces load and save methods for this purpose.
Suggested-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
show more ...
|
#
abdffd1f |
| 19-Mar-2014 |
Stefan Hajnoczi <stefanha@redhat.com> |
virtio-rng: Avoid default_backend refcount leak
QOM child properties take a reference to the object and release it when the property is deleted. Therefore we should unref the default_backend after
virtio-rng: Avoid default_backend refcount leak
QOM child properties take a reference to the object and release it when the property is deleted. Therefore we should unref the default_backend after we have added it as a child property.
Cc: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
show more ...
|
#
39f72ef9 |
| 19-Mar-2014 |
Stefan Hajnoczi <stefanha@redhat.com> |
qom: Add check() argument to object_property_add_link()
There are currently three types of object_property_add_link() callers:
1. The link property may be set at any time. 2. The link property of a
qom: Add check() argument to object_property_add_link()
There are currently three types of object_property_add_link() callers:
1. The link property may be set at any time. 2. The link property of a DeviceState instance may only be set before realize. 3. The link property may never be set, it is read-only.
Something similar can already be achieved with object_property_add_str()'s set() argument. Follow its example and add a check() argument to object_property_add_link().
Also provide default check() functions for case #1 and #2. Case #3 is covered by passing a NULL function pointer.
Cc: Peter Crosthwaite <peter.crosthwaite@petalogix.com> Cc: Alexander Graf <agraf@suse.de> Cc: Anthony Liguori <aliguori@amazon.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> [AF: Tweaked documentation comment] Signed-off-by: Andreas Färber <afaerber@suse.de>
show more ...
|
#
9561fda8 |
| 19-Mar-2014 |
Stefan Hajnoczi <stefanha@redhat.com> |
qom: Make QOM link property unref optional
Some object_property_add_link() callers expect property deletion to unref the link property object. Other callers expect to manage the refcount themselves
qom: Make QOM link property unref optional
Some object_property_add_link() callers expect property deletion to unref the link property object. Other callers expect to manage the refcount themselves. The former are currently broken and therefore leak the link property object.
This patch adds a flags argument to object_property_add_link() so the caller can specify which refcount behavior they require. The new OBJ_PROP_LINK_UNREF_ON_RELEASE flag causes the link pointer to be unreferenced when the property is deleted.
This fixes refcount leaks in qdev.c, xilinx_axidma.c, xilinx_axienet.c, s390-virtio-bus.c, virtio-pci.c, virtio-rng.c, and ui/console.c.
Rationale for refcount behavior:
* hw/core/qdev.c - bus children are explicitly unreferenced, don't interfere - parent_bus is essentially a read-only property that doesn't hold a refcount, don't unref - hotplug_handler is leaked, do unref
* hw/dma/xilinx_axidma.c - rx stream "dma" links are set using set_link, therefore they need unref - tx streams are set using set_link, therefore they need unref
* hw/net/xilinx_axienet.c - same reasoning as hw/dma/xilinx_axidma.c
* hw/pcmcia/pxa2xx.c - pxa2xx bypasses set_link and therefore does not use refcounts
* hw/s390x/s390-virtio-bus.c * hw/virtio/virtio-pci.c * hw/virtio/virtio-rng.c * ui/console.c - set_link is used and there is no explicit unref, do unref
Cc: Peter Crosthwaite <peter.crosthwaite@petalogix.com> Cc: Alexander Graf <agraf@suse.de> Cc: Anthony Liguori <aliguori@amazon.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
show more ...
|
#
57d3e1b3 |
| 16-Jan-2014 |
Igor Mammedov <imammedo@redhat.com> |
virtio_rng: replace custom backend API with UserCreatable.complete() callback
in addition fix default backend leak by releasing it if its initialization failed.
Signed-off-by: Igor Mammedov <imamme
virtio_rng: replace custom backend API with UserCreatable.complete() callback
in addition fix default backend leak by releasing it if its initialization failed.
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
show more ...
|
#
306ec6c3 |
| 30-Jul-2013 |
Andreas Färber <afaerber@suse.de> |
virtio: Convert exit to unrealize
Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
a8d57dfb |
| 30-Jul-2013 |
Andreas Färber <afaerber@suse.de> |
virtio-rng: Convert to QOM realize
Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
af7671fd |
| 30-Jul-2013 |
Andreas Färber <afaerber@suse.de> |
virtio-rng: QOM realize preparations
Rename qdev -> dev because that's what realize's argument is called by convention. No need to keep more "qdev" around than necessary.
Signed-off-by: Andreas Fär
virtio-rng: QOM realize preparations
Rename qdev -> dev because that's what realize's argument is called by convention. No need to keep more "qdev" around than necessary.
Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
7bb6edb0 |
| 20-Sep-2013 |
Paolo Bonzini <pbonzini@redhat.com> |
virtio-rng: switch exit callback to VirtioDeviceClass
This ensures hot-unplug is handled properly by the proxy, and avoids leaking bus_name which is freed by virtio_device_exit.
Cc: qemu-stable@non
virtio-rng: switch exit callback to VirtioDeviceClass
This ensures hot-unplug is handled properly by the proxy, and avoids leaking bus_name which is freed by virtio_device_exit.
Cc: qemu-stable@nongnu.org Acked-by: Andreas Faerber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
d44bb860 |
| 21-Nov-2013 |
Amos Kong <akong@redhat.com> |
virtio-rng: add check of period
If period is assigned to 0, limit timer will expire immediately. It causes a qemu warning:
"main-loop: WARNING: I/O thread spun for 1000 iterations"
This limit is m
virtio-rng: add check of period
If period is assigned to 0, limit timer will expire immediately. It causes a qemu warning:
"main-loop: WARNING: I/O thread spun for 1000 iterations"
This limit is meaningless. This patch forbids to assign 0 to period.
Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Message-id: 1385031203-23790-1-git-send-email-akong@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
show more ...
|