summaryrefslogtreecommitdiffstats
path: root/hw/virtio/virtio-mmio.c
Commit message (Collapse)AuthorAgeFilesLines
* virtio: allow virtio-1 queue layoutCornelia Huck2015-06-101-0/+3
| | | | | | | | | | | | For virtio-1 devices, we allow a more complex queue layout that doesn't require descriptor table and rings on a physically-contigous memory area: add virtio_queue_set_rings() to allow transports to set this up. Signed-off-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> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
* virtio-mmio: ioeventfd supportYing-Shiuan Pan2015-06-011-0/+181
| | | | | | | | | | | | | | | | set_host_notifier and set_guest_notifiers supported by virtio-mmio now. Most code copied from virtio-pci. This makes it possible to use vhost-net with virtio-mmio, improving performance by about 30%. The kvm-arm does not yet support irqfd, need to fix the hard-coded part after kvm-arm gets irqfd support. Signed-off-by: Ying-Shiuan Pan <yingshiuan.pan@gmail.com> Signed-off-by: Pavel Fedin <p.fedin@samsung.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* virtio: rename VIRTIO_PCI_QUEUE_MAX to VIRTIO_QUEUE_MAXJason Wang2015-05-311-2/+2
| | | | | | | | | | VIRTIO_PCI_QUEUE_MAX is not only used for pci, so rename it be generic. Cc: Amit Shah <amit.shah@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> 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>
* virtio: move VIRTIO_F_NOTIFY_ON_EMPTY into coreCornelia Huck2015-05-311-10/+0
| | | | | | | | | | | | | | Nearly all transports have been offering VIRTIO_F_NOTIFY_ON_EMPTY, s390-virtio being the exception. There's no reason why it shouldn't offer it as well, though (handling is done in core anyway), so let's move it to the common virtio features. While we're changing it anyway, fix the indentation for the DEFINE_VIRTIO_COMMON_FEATURES macro. Signed-off-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>
* virtio: move host_featuresCornelia Huck2015-05-311-19/+3
| | | | | | | | | | | | | | Move host_features from the individual transport proxies into the virtio device. Transports may continue to add feature bits during device plugging. This should it make easier to offer different sets of host features for virtio-1/transitional support. Tested-by: Shannon Zhao <shannon.zhao@linaro.org> Signed-off-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>
* virtio: feature bit manipulation helpersCornelia Huck2015-02-261-1/+1
| | | | | | | | | | | | | | Add virtio_{add,clear}_feature helper functions for manipulating a feature bits variable. This has some benefits over open coding: - add check that the bit is in a sane range - make it obvious at a glance what is going on - have a central point to change when we want to extend feature bits Convert existing code manipulating features to use the new helpers. Signed-off-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>
* virtio-mmio: Drop useless bus->allow_hotplug = 0Igor Mammedov2014-10-151-15/+2
| | | | | | | | | | | | Bus by default is not hotpluggable. virtio-mmio-bus and its parent types do not set allow_hotplug anywhere explicitly, so remove not needed field access and wrapper along with it. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* hw/virtio: enable common virtio feature for mmio deviceMing Lei2014-07-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both 'indirect_desc' and 'event_idx' are bus independent features, and they should be enabled for mmio devices too. On arm64 quad core VM(qemu-kvm), the patch can increase block I/O performance a lot with latest linux tree: - without the patch: 14K IOPS - with the patch: 34K IOPS fio script: [global] direct=1 bsrange=4k-4k timeout=10 numjobs=4 ioengine=libaio iodepth=64 filename=/dev/vdc group_reporting=1 [f1] rw=randread Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Ming Lei <ming.lei@canonical.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* virtio-bus: remove vdev fieldPaolo Bonzini2013-12-091-4/+5
| | | | | | | | | The vdev field is complicated to synchronize. Just access the BusState's list of children. Cc: qemu-stable@nongnu.org Acked-by: Andreas Faerber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qdev: Pass size to qbus_create_inplace()Andreas Färber2013-08-301-1/+1
| | | | | | | | | | To be passed to object_initialize(). Since commit 39355c3826f5d9a2eb1ce3dc9b4cdd68893769d6 the argument is void*, so drop some superfluous (BusState *) casts or direct parent field usages. Signed-off-by: Andreas Färber <afaerber@suse.de>
* virtio-mmio: Pass size to virtio_mmio_bus_new()Andreas Färber2013-08-301-3/+5
| | | | | | | To be passed to qbus_create_initialize(). Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* hw/virtio/virtio-mmio: Make QueueNumMax read 0 for unavailable queuesPeter Maydell2013-08-121-0/+3
| | | | | | | | | | The virtio-mmio spec says that QueueNumMax must read zero for queues which are unavailable; implement this, rather than always returning VIRTQUEUE_MAX_SIZE. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1374853288-9912-3-git-send-email-peter.maydell@linaro.org Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
* devices: Associate devices to their logical categoryMarcel Apfelbaum2013-07-291-0/+1
| | | | | | | | | The category will be used to sort the devices displayed in the command line help. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Message-id: 1375107465-25767-4-git-send-email-marcel.a@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio: Implement MMIO based virtio transportPeter Maydell2013-07-191-0/+421
Add support for the generic MMIO based virtio transport. This patch includes some fixes for bugs spotted by Ying-Shiuan Pan <yspan@itri.org.tw>. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Message-id: 1373977512-28932-6-git-send-email-peter.maydell@linaro.org [Fred changes: updated to new virtio-bus mechanisms] Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> [PMM changes: * fixed trivial makefile conflict * removed unused int_enable * host_features doesn't need migrating * reset guest accessible state in the reset function * minor style fixes like extra blank lines * RAZ/WI if there's no backend * made transport size 0x200, in line with kvmtool * set has_variable_vring_alignment ]
OpenPOWER on IntegriCloud