qemu-patch-raspberry4/contrib/libvhost-user
Marc Hartmayer 2ffc547080 libvhost-user: handle endianness as mandated by the spec
Since virtio existed even before it got standardized, the virtio
standard defines the following types of virtio devices:

 + legacy device (pre-virtio 1.0)
 + non-legacy or VIRTIO 1.0 device
 + transitional device (which can act both as legacy and non-legacy)

Virtio 1.0 defines the fields of the virtqueues as little endian,
while legacy uses guest's native endian [1]. Currently libvhost-user
does not handle virtio endianness at all, i.e. it works only if the
native endianness matches with whatever is actually needed. That means
things break spectacularly on big-endian targets. Let us handle virtio
endianness for non-legacy as required by the virtio specification [1]
and fence legacy virtio, as there is no safe way to figure out the
needed endianness conversions for all cases. The fencing of legacy
virtio devices is done in `vu_set_features_exec`.

[1] https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.html#x1-210003

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Message-id: 20200901150019.29229-3-mhartmay@linux.ibm.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-09-23 13:41:58 +01:00
..
libvhost-user-glib.c libvhost-user-glib: use g_main_context_get_thread_default() 2020-02-27 03:46:10 -05:00
libvhost-user-glib.h libvhost-user-glib: fix VugDev main fd cleanup 2020-02-27 03:46:10 -05:00
libvhost-user.c libvhost-user: handle endianness as mandated by the spec 2020-09-23 13:41:58 +01:00
libvhost-user.h contrib/: fix some comment spelling errors 2020-09-17 20:41:44 +02:00
meson.build contrib/libvhost-user: convert to Meson 2020-08-21 06:30:08 -04:00