aboutsummaryrefslogtreecommitdiff
path: root/lib/libvirtio/virtio-internal.h
AgeCommit message (Collapse)AuthorFilesLines
2019-12-05virtio: Store queue descriptors in virtio_deviceAlexey Kardashevskiy1-6/+6
At the moment desc/avail/used pointers are read from the device every time we need them. This works for now unless iommu_platform=on is used, desc/avail/used stored in the config space are bus addresses while SLOF should keep using the guest physical addresses. virtio-net stores queue descriptors already, virtio-serial does it in global statics, move them into virtio_device. The next patch will use this to allow IOMMU. While at this, move repeating avail->flags/idx setup into virtio_queue_init_vq() except virtio-serial which vq_rx->avail->idx is setup differently. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> --- Changes: v4: * removed vqs::id as it is not really used * replaced vq_size with vq->size in virtio-serial.c
2016-02-08virtio: 1.0 helper to read 16/32/64 bit valueNikunj A Dadhania1-0/+48
To avoid cluttering the driver code with modern/legacy code introduce virtio_cpu_to_modern{16,32,64} and virtio_modern{16,32,64}_to_cpu in a separate header file virtio-internal.h. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Suggested-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>