mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
virtio: event index support
Add support for event_idx feature, and utilize it to reduce the number of interrupts and exits for the guest. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
01731cfb39
commit
bcbabae8ff
3 changed files with 97 additions and 10 deletions
|
@ -46,6 +46,11 @@
|
|||
#define VIRTIO_F_NOTIFY_ON_EMPTY 24
|
||||
/* We support indirect buffer descriptors */
|
||||
#define VIRTIO_RING_F_INDIRECT_DESC 28
|
||||
/* The Guest publishes the used index for which it expects an interrupt
|
||||
* at the end of the avail ring. Host should ignore the avail->flags field. */
|
||||
/* The Host publishes the avail index for which it expects a kick
|
||||
* at the end of the used ring. Guest should ignore the used->flags field. */
|
||||
#define VIRTIO_RING_F_EVENT_IDX 29
|
||||
/* A guest should never accept this. It implies negotiation is broken. */
|
||||
#define VIRTIO_F_BAD_FEATURE 30
|
||||
|
||||
|
@ -210,7 +215,9 @@ void virtio_serial_exit(VirtIODevice *vdev);
|
|||
|
||||
#define DEFINE_VIRTIO_COMMON_FEATURES(_state, _field) \
|
||||
DEFINE_PROP_BIT("indirect_desc", _state, _field, \
|
||||
VIRTIO_RING_F_INDIRECT_DESC, true)
|
||||
VIRTIO_RING_F_INDIRECT_DESC, true), \
|
||||
DEFINE_PROP_BIT("event_idx", _state, _field, \
|
||||
VIRTIO_RING_F_EVENT_IDX, true)
|
||||
|
||||
target_phys_addr_t virtio_queue_get_desc_addr(VirtIODevice *vdev, int n);
|
||||
target_phys_addr_t virtio_queue_get_avail_addr(VirtIODevice *vdev, int n);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue