[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v2 3/3] libvhost-user: fence legacy virtio devices
From: |
Stefan Hajnoczi |
Subject: |
Re: [RFC v2 3/3] libvhost-user: fence legacy virtio devices |
Date: |
Tue, 21 Jul 2020 14:47:29 +0100 |
On Fri, Jul 17, 2020 at 11:29:29AM +0200, Marc Hartmayer wrote:
> libvhost-user has no support for legacy virtio devices therefore
> let's fence them.
>
> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
> ---
> contrib/libvhost-user/libvhost-access.h | 10 ++++++++++
> contrib/libvhost-user/libvhost-user.c | 6 ++++++
> 2 files changed, 16 insertions(+)
>
> diff --git a/contrib/libvhost-user/libvhost-access.h
> b/contrib/libvhost-user/libvhost-access.h
> index 868ba3e7bfb8..aa505ea1ec02 100644
> --- a/contrib/libvhost-user/libvhost-access.h
> +++ b/contrib/libvhost-user/libvhost-access.h
> @@ -1,11 +1,21 @@
> #ifndef LIBVHOST_ACCESS_H
>
> +#include <assert.h>
> +
> #include "qemu/bswap.h"
>
> #include "libvhost-user.h"
>
> +static inline bool vu_has_feature(VuDev *dev, unsigned int fbit);
> +
> static inline bool vu_access_is_big_endian(VuDev *dev)
> {
> + /*
> + * TODO: can probably be removed as the fencing is already done in
> + * `vu_set_features_exec`
> + */
> + assert(vu_has_feature(dev, VIRTIO_F_VERSION_1));
Great, please drop it since the memory accesses are called from
performance-critical code paths.
signature.asc
Description: PGP signature
- [RFC v2 0/3] Enable virtio-fs on s390x, Marc Hartmayer, 2020/07/17
- [RFC v2 1/3] virtio: add vhost-user-fs-ccw device, Marc Hartmayer, 2020/07/17
- [RFC v2 2/3] libvhost-user: handle endianness as mandated by the spec, Marc Hartmayer, 2020/07/17
- [RFC v2 3/3] libvhost-user: fence legacy virtio devices, Marc Hartmayer, 2020/07/17
- Re: [RFC v2 3/3] libvhost-user: fence legacy virtio devices,
Stefan Hajnoczi <=
- Re: [RFC v2 0/3] Enable virtio-fs on s390x, no-reply, 2020/07/17
- Re: [RFC v2 0/3] Enable virtio-fs on s390x, no-reply, 2020/07/17