search for: virtio_is_little_endian

Displaying 20 results from an estimated 65 matches for "virtio_is_little_endian".

2015 Apr 23
0
[PATCH v5 1/8] virtio: introduce virtio_is_little_endian() helper
...s(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index ca3ed78..bd1a582 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -205,35 +205,40 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu) return 0; } +static inline bool virtio_is_little_endian(struct virtio_device *vdev) +{ + return virtio_has_feature(vdev, VIRTIO_F_VERSION_1); +} + /* Memory accessors */ static inline u16 virtio16_to_cpu(struct virtio_device *vdev, __virtio16 val) { - return __virtio16_to_cpu(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); + return __virtio16_to_...
2015 Apr 24
0
[PATCH v6 1/8] virtio: introduce virtio_is_little_endian() helper
...s(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index ca3ed78..bd1a582 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -205,35 +205,40 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu) return 0; } +static inline bool virtio_is_little_endian(struct virtio_device *vdev) +{ + return virtio_has_feature(vdev, VIRTIO_F_VERSION_1); +} + /* Memory accessors */ static inline u16 virtio16_to_cpu(struct virtio_device *vdev, __virtio16 val) { - return __virtio16_to_cpu(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); + return __virtio16_to_...
2015 Dec 04
0
[PATCH] tools/virtio: fix byteswap logic
On Mon, Nov 30, 2015 at 10:33:34AM +0200, Michael S. Tsirkin wrote: > commit cf561f0d2eb74574ad9985a2feab134267a9d298 ("virtio: introduce > virtio_is_little_endian() helper") changed byteswap logic to > skip feature bit checks for LE platforms, but didn't > update tools/virtio, so vring_bench started failing. > > Update the copy under tools/virtio/ (TODO: find a way to avoid this code > duplication). > > Cc: Greg Kurz <gkurz...
2015 Dec 04
0
[PATCH] tools/virtio: fix byteswap logic
On Mon, Nov 30, 2015 at 10:33:34AM +0200, Michael S. Tsirkin wrote: > commit cf561f0d2eb74574ad9985a2feab134267a9d298 ("virtio: introduce > virtio_is_little_endian() helper") changed byteswap logic to > skip feature bit checks for LE platforms, but didn't > update tools/virtio, so vring_bench started failing. > > Update the copy under tools/virtio/ (TODO: find a way to avoid this code > duplication). > > Cc: Greg Kurz <gkurz...
2015 Apr 23
1
[PATCH v5 1/8] virtio: introduce virtio_is_little_endian() helper
...config.h b/include/linux/virtio_config.h > index ca3ed78..bd1a582 100644 > --- a/include/linux/virtio_config.h > +++ b/include/linux/virtio_config.h > @@ -205,35 +205,40 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu) > return 0; > } > > +static inline bool virtio_is_little_endian(struct virtio_device *vdev) > +{ > + return virtio_has_feature(vdev, VIRTIO_F_VERSION_1); > +} So this function returns false when _not_ using version 1, but running on a little endian host + guest? Sounds confusing. Maybe you could name it "virtio_is_v1()" or so instead? Thom...
2015 Apr 23
1
[PATCH v5 1/8] virtio: introduce virtio_is_little_endian() helper
...config.h b/include/linux/virtio_config.h > index ca3ed78..bd1a582 100644 > --- a/include/linux/virtio_config.h > +++ b/include/linux/virtio_config.h > @@ -205,35 +205,40 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu) > return 0; > } > > +static inline bool virtio_is_little_endian(struct virtio_device *vdev) > +{ > + return virtio_has_feature(vdev, VIRTIO_F_VERSION_1); > +} So this function returns false when _not_ using version 1, but running on a little endian host + guest? Sounds confusing. Maybe you could name it "virtio_is_v1()" or so instead? Thom...
2017 Jan 20
4
[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
....c b/drivers/net/virtio_net.c index 4a10500..3474243 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1104,7 +1104,7 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff *skb) hdr = skb_vnet_hdr(skb); if (virtio_net_hdr_from_skb(skb, &hdr->hdr, - virtio_is_little_endian(vi->vdev))) + virtio_is_little_endian(vi->vdev), false)) BUG(); if (vi->mergeable_rx_bufs) diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 5643647..5209b5e 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -56,7 +56,8 @@ st...
2017 Jan 20
4
[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
....c b/drivers/net/virtio_net.c index 4a10500..3474243 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1104,7 +1104,7 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff *skb) hdr = skb_vnet_hdr(skb); if (virtio_net_hdr_from_skb(skb, &hdr->hdr, - virtio_is_little_endian(vi->vdev))) + virtio_is_little_endian(vi->vdev), false)) BUG(); if (vi->mergeable_rx_bufs) diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 5643647..5209b5e 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -56,7 +56,8 @@ st...
2017 Jan 22
2
[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
...t; --- a/drivers/net/virtio_net.c >> +++ b/drivers/net/virtio_net.c >> @@ -1104,7 +1104,7 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff *skb) >> hdr = skb_vnet_hdr(skb); >> >> if (virtio_net_hdr_from_skb(skb, &hdr->hdr, >> - virtio_is_little_endian(vi->vdev))) >> + virtio_is_little_endian(vi->vdev), false)) >> BUG(); >> >> if (vi->mergeable_rx_bufs) >> diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h >> index 5643647..5209b5e 100644 >> --- a/include/linux/...
2017 Jan 22
2
[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
...t; --- a/drivers/net/virtio_net.c >> +++ b/drivers/net/virtio_net.c >> @@ -1104,7 +1104,7 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff *skb) >> hdr = skb_vnet_hdr(skb); >> >> if (virtio_net_hdr_from_skb(skb, &hdr->hdr, >> - virtio_is_little_endian(vi->vdev))) >> + virtio_is_little_endian(vi->vdev), false)) >> BUG(); >> >> if (vi->mergeable_rx_bufs) >> diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h >> index 5643647..5209b5e 100644 >> --- a/include/linux/...
2015 Dec 07
0
[PATCH RFC 3/3] xen/virtio_ring: introduce cpu_to_virtio_addr and virtio_addr_to_cpu
...<uapi/linux/virtio_config.h> +#include <xen/xen.h> +#include <xen/swiotlb-xen.h> /** * virtio_config_ops - operations for configuring a virtio device @@ -237,11 +239,23 @@ static inline u64 virtio64_to_cpu(struct virtio_device *vdev, __virtio64 val) return __virtio64_to_cpu(virtio_is_little_endian(vdev), val); } +static inline u64 virtio_addr_to_cpu(struct virtio_device *vdev, __virtio64 val) +{ + val = xen_pv_domain() ? xen_bus_to_phys(val) : val; + return __virtio64_to_cpu(virtio_is_little_endian(vdev), val); +} + static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64...
2015 Apr 23
16
[PATCH v5 0/8] vhost: support for cross endian guests
...back. I could also migrate from a ppc64 to a ppc64le host and back. No regressions on x86 as expected. My experimental QEMU tree is here: https://github.com/gkurz/qemu.git vhost/cross-endian I'd be glad if this series could make it to 4.1. Cheers. --- Greg Kurz (8): virtio: introduce virtio_is_little_endian() helper tun: add tun_is_little_endian() helper macvtap: introduce macvtap_is_little_endian() helper vringh: introduce vringh_is_little_endian() helper vhost: introduce vhost_is_little_endian() helper virtio: add explicit big-endian support to memory accessors vh...
2015 Apr 23
16
[PATCH v5 0/8] vhost: support for cross endian guests
...back. I could also migrate from a ppc64 to a ppc64le host and back. No regressions on x86 as expected. My experimental QEMU tree is here: https://github.com/gkurz/qemu.git vhost/cross-endian I'd be glad if this series could make it to 4.1. Cheers. --- Greg Kurz (8): virtio: introduce virtio_is_little_endian() helper tun: add tun_is_little_endian() helper macvtap: introduce macvtap_is_little_endian() helper vringh: introduce vringh_is_little_endian() helper vhost: introduce vhost_is_little_endian() helper virtio: add explicit big-endian support to memory accessors vh...
2015 Apr 02
9
[PATCH v2 0/7] vhost: support for cross endian guests
...a new vhost feature to advertise cross-endian to userspace The tentative to fix vnet headers was dropped for the moment. As a consequnce, vhost_net still fails to work with cross-endian. It will be fixed in another patchset I'm currently working on. --- Greg Kurz (7): virtio: introduce virtio_is_little_endian() helper tun: add tun_is_little_endian() helper macvtap: introduce macvtap_is_little_endian() helper vringh: introduce vringh_is_little_endian() helper vhost: introduce vhost_is_little_endian() helper virtio: add explicit big-endian support to memory accessors vh...
2015 Apr 02
9
[PATCH v2 0/7] vhost: support for cross endian guests
...a new vhost feature to advertise cross-endian to userspace The tentative to fix vnet headers was dropped for the moment. As a consequnce, vhost_net still fails to work with cross-endian. It will be fixed in another patchset I'm currently working on. --- Greg Kurz (7): virtio: introduce virtio_is_little_endian() helper tun: add tun_is_little_endian() helper macvtap: introduce macvtap_is_little_endian() helper vringh: introduce vringh_is_little_endian() helper vhost: introduce vhost_is_little_endian() helper virtio: add explicit big-endian support to memory accessors vh...
2015 Apr 07
13
[PATCH v3 0/7] vhost: support for cross endian guests
Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. Patches 1-6 remain the same as the previous post. Patch 7 was heavily changed according to MST's comments. --- Greg Kurz (7): virtio: introduce virtio_is_little_endian() helper tun: add tun_is_little_endian() helper macvtap: introduce macvtap_is_little_endian() helper vringh: introduce vringh_is_little_endian() helper vhost: introduce vhost_is_little_endian() helper virtio: add explicit big-endian support to memory accessors vh...
2015 Apr 07
13
[PATCH v3 0/7] vhost: support for cross endian guests
Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. Patches 1-6 remain the same as the previous post. Patch 7 was heavily changed according to MST's comments. --- Greg Kurz (7): virtio: introduce virtio_is_little_endian() helper tun: add tun_is_little_endian() helper macvtap: introduce macvtap_is_little_endian() helper vringh: introduce vringh_is_little_endian() helper vhost: introduce vhost_is_little_endian() helper virtio: add explicit big-endian support to memory accessors vh...
2015 May 12
2
[PATCH v6 0/8] vhost: support for cross endian guests
...s sane to me. I plan to review and apply next week. > Hi Michael, I realize you just got back and have tons of things to do... Do you still plan to apply shortly ? Would you also have time to comment the QEMU part ? Thanks. -- Greg > > Greg Kurz (8): > > virtio: introduce virtio_is_little_endian() helper > > tun: add tun_is_little_endian() helper > > macvtap: introduce macvtap_is_little_endian() helper > > vringh: introduce vringh_is_little_endian() helper > > vhost: introduce vhost_is_little_endian() helper > > virtio: add explic...
2015 May 12
2
[PATCH v6 0/8] vhost: support for cross endian guests
...s sane to me. I plan to review and apply next week. > Hi Michael, I realize you just got back and have tons of things to do... Do you still plan to apply shortly ? Would you also have time to comment the QEMU part ? Thanks. -- Greg > > Greg Kurz (8): > > virtio: introduce virtio_is_little_endian() helper > > tun: add tun_is_little_endian() helper > > macvtap: introduce macvtap_is_little_endian() helper > > vringh: introduce vringh_is_little_endian() helper > > vhost: introduce vhost_is_little_endian() helper > > virtio: add explic...
2015 Apr 24
27
[PATCH v6 0/8] vhost: support for cross endian guests
Only cosmetic and documentation changes since v5. --- Greg Kurz (8): virtio: introduce virtio_is_little_endian() helper tun: add tun_is_little_endian() helper macvtap: introduce macvtap_is_little_endian() helper vringh: introduce vringh_is_little_endian() helper vhost: introduce vhost_is_little_endian() helper virtio: add explicit big-endian support to memory accessors vh...