search for: cpu_to_virtio64

Displaying 20 results from an estimated 296 matches for "cpu_to_virtio64".

Did you mean: cpu_to_virtio16
2020 Aug 05
0
[PATCH v3 25/38] virtio_config: disallow native type fields (again)
...+-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 7fa000f02721..441fd6dd42ab 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -304,13 +304,7 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) __u8: (x), \ __le16: virtio16_to_cpu((vdev), (__force __virtio16)(x)), \ __le32: virtio32_to_cpu((vdev), (__force __virtio32)(x)), \ - __le64: virtio64_to_cpu((vdev), (__force __virtio64)(x)), \ - default: _Generic((x), \ - __u8:...
2020 Aug 05
0
[PATCH v3 37/38] virtio_config: drop LE option from config space
...--------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index cc7a2b1fd7b2..ecb166c824bb 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -293,19 +293,7 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) __u8: (x), \ __virtio16: virtio16_to_cpu((vdev), (x)), \ __virtio32: virtio32_to_cpu((vdev), (x)), \ - __virtio64: virtio64_to_cpu((vdev), (x)), \ - /* - * Why define a default? checker can distinguish between - * e.g. __u16, __le16 and __virtio16...
2016 Jul 27
2
[PATCH v2 repost 7/7] virtio-balloon: tell host vm's free page info
..._len); > + ret = get_free_pages(pfn, pfn + vb->pfn_limit, > + vb->page_bitmap, vb->bmap_len * BITS_PER_BYTE); > + hdr->cmd = cpu_to_virtio16(vb->vdev, BALLOON_GET_FREE_PAGES); > + hdr->page_shift = cpu_to_virtio16(vb->vdev, PAGE_SHIFT); > + hdr->req_id = cpu_to_virtio64(vb->vdev, req_id); > + hdr->start_pfn = cpu_to_virtio64(vb->vdev, pfn); > + bmap_len = vb->pfn_limit / BITS_PER_BYTE; > + if (!ret) { > + hdr->flag = cpu_to_virtio16(vb->vdev, > + BALLOON_FLAG_DONE); > + if (pfn + vb->pfn_limit > max_pfn) >...
2016 Jul 27
2
[PATCH v2 repost 7/7] virtio-balloon: tell host vm's free page info
..._len); > + ret = get_free_pages(pfn, pfn + vb->pfn_limit, > + vb->page_bitmap, vb->bmap_len * BITS_PER_BYTE); > + hdr->cmd = cpu_to_virtio16(vb->vdev, BALLOON_GET_FREE_PAGES); > + hdr->page_shift = cpu_to_virtio16(vb->vdev, PAGE_SHIFT); > + hdr->req_id = cpu_to_virtio64(vb->vdev, req_id); > + hdr->start_pfn = cpu_to_virtio64(vb->vdev, pfn); > + bmap_len = vb->pfn_limit / BITS_PER_BYTE; > + if (!ret) { > + hdr->flag = cpu_to_virtio16(vb->vdev, > + BALLOON_FLAG_DONE); > + if (pfn + vb->pfn_limit > max_pfn) >...
2014 Oct 22
1
[PATCH RFC 04/11] virtio_ring: implement endian reversal based on VERSION_1 feature.
...> > - desc[i].flags = VRING_DESC_F_NEXT; > > - desc[i].addr = sg_phys(sg); > > - desc[i].len = sg->length; > > - desc[i].next = i+1; > > + desc[i].flags = cpu_to_virtio16(vq->vq.vdev, > > + VRING_DESC_F_NEXT); > > + desc[i].addr = cpu_to_virtio64(vq->vq.vdev, > > + sg_phys(sg)); > > + desc[i].len = cpu_to_virtio32(vq->vq.vdev, > > + sg->length); > > + desc[i].next = cpu_to_virtio16(vq->vq.vdev, > > + i+1); > > i++; > > } > > } > > for (; n &...
2014 Oct 22
1
[PATCH RFC 04/11] virtio_ring: implement endian reversal based on VERSION_1 feature.
...> > - desc[i].flags = VRING_DESC_F_NEXT; > > - desc[i].addr = sg_phys(sg); > > - desc[i].len = sg->length; > > - desc[i].next = i+1; > > + desc[i].flags = cpu_to_virtio16(vq->vq.vdev, > > + VRING_DESC_F_NEXT); > > + desc[i].addr = cpu_to_virtio64(vq->vq.vdev, > > + sg_phys(sg)); > > + desc[i].len = cpu_to_virtio32(vq->vq.vdev, > > + sg->length); > > + desc[i].next = cpu_to_virtio16(vq->vq.vdev, > > + i+1); > > i++; > > } > > } > > for (; n &...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...it the helpers to packed/split version like other helpers? >>>> (Consider the caller has already known the type of vq). >>> Okay. >>> >> [...] >> >>>>> + desc[i].flags = flags; >>>>> + >>>>> + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); >>>>> + desc[i].len = cpu_to_virtio32(_vq->vdev, sg->length); >>>>> + desc[i].id = cpu_to_virtio32(_vq->vdev, head); >>>> If it's a part of chain, we only need to do this for last buffer I think. >>> I'm no...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...it the helpers to packed/split version like other helpers? >>>> (Consider the caller has already known the type of vq). >>> Okay. >>> >> [...] >> >>>>> + desc[i].flags = flags; >>>>> + >>>>> + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); >>>>> + desc[i].len = cpu_to_virtio32(_vq->vdev, sg->length); >>>>> + desc[i].id = cpu_to_virtio32(_vq->vdev, head); >>>> If it's a part of chain, we only need to do this for last buffer I think. >>> I'm no...
2020 Aug 05
0
[PATCH v3 24/38] virtio_config: rewrite using _Generic
...----------- 1 file changed, 77 insertions(+), 86 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 5c3b02245ecd..7fa000f02721 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -288,112 +288,103 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) return __cpu_to_virtio64(virtio_is_little_endian(vdev), val); } -/* - * Only the checker differentiates between __virtioXX and __uXX types. But we - * try to share as much code as we can with the regular GCC build. - */ -#if !defined(CONFIG_CC_IS_GCC) &...
2015 Dec 07
0
[PATCH RFC 3/3] xen/virtio_ring: introduce cpu_to_virtio_addr and virtio_addr_to_cpu
...n running on Xen inside as virtual machine (nested virt scenario), addresses need to be translated from phys to machine to get the actual guest pseudo-physical address. Introduce a new pair of functions, cpu_to_virtio_addr and virtio_addr_to_cpu, which call the appriopriate __virtio64_to_cpu and __cpu_to_virtio64 functions after doing the phys_to_bus and bus_to_phys translations for Xen. No changes in behavior for the non-Xen case. Signed-off-by: Stefano Stabellini <stefano.stabellini at eu.citrix.com> --- I realize that this patch is not very nice, but at least it is easy to understand. I welcome...
2016 Feb 03
0
[PATCH v7 5/9] virtio_ring: Support DMA APIs
...nt head; bool indirect; @@ -201,21 +280,15 @@ static inline int virtqueue_add(struct virtqueue *_vq, if (desc) { /* Use a single buffer which doesn't continue */ - vq->vring.desc[head].flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_INDIRECT); - vq->vring.desc[head].addr = cpu_to_virtio64(_vq->vdev, virt_to_phys(desc)); - /* avoid kmemleak false positive (hidden by virt_to_phys) */ - kmemleak_ignore(desc); - vq->vring.desc[head].len = cpu_to_virtio32(_vq->vdev, total_sg * sizeof(struct vring_desc)); - + indirect = true; /* Set up rest to use this indirect table. */...
2016 Jul 28
0
[PATCH v2 repost 7/7] virtio-balloon: tell host vm's free page info
...free_pages(pfn, pfn + vb->pfn_limit, > > + vb->page_bitmap, vb->bmap_len * BITS_PER_BYTE); > > + hdr->cmd = cpu_to_virtio16(vb->vdev, > BALLOON_GET_FREE_PAGES); > > + hdr->page_shift = cpu_to_virtio16(vb->vdev, PAGE_SHIFT); > > + hdr->req_id = cpu_to_virtio64(vb->vdev, req_id); > > + hdr->start_pfn = cpu_to_virtio64(vb->vdev, pfn); > > + bmap_len = vb->pfn_limit / BITS_PER_BYTE; > > + if (!ret) { > > + hdr->flag = cpu_to_virtio16(vb->vdev, > > + > BALLOON_FLAG_DONE); > > + if (pfn + vb-&gt...
2018 Mar 16
0
[PATCH RFC 2/2] virtio_ring: support packed ring
...> > > > (Consider the caller has already known the type of vq). > > > > Okay. > > > > > > > [...] > > > > > > > > > + desc[i].flags = flags; > > > > > > + > > > > > > + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); > > > > > > + desc[i].len = cpu_to_virtio32(_vq->vdev, sg->length); > > > > > > + desc[i].id = cpu_to_virtio32(_vq->vdev, head); > > > > > If it's a part of chain, we only need to do this for last buffer I thin...
2020 Aug 05
2
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
...nclude <linux/bug.h> > #include <linux/virtio.h> > #include <linux/virtio_byteorder.h> > +#include <linux/compiler_types.h> > #include <uapi/linux/virtio_config.h> > > struct irq_affinity; > @@ -287,12 +288,57 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) > return __cpu_to_virtio64(virtio_is_little_endian(vdev), val); > } > > +/* > + * Only the checker differentiates between __virtioXX and __uXX types. But we > + * try to share as much code as we can with the regular GCC build. > + */...
2020 Aug 05
2
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
...nclude <linux/bug.h> > #include <linux/virtio.h> > #include <linux/virtio_byteorder.h> > +#include <linux/compiler_types.h> > #include <uapi/linux/virtio_config.h> > > struct irq_affinity; > @@ -287,12 +288,57 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) > return __cpu_to_virtio64(virtio_is_little_endian(vdev), val); > } > > +/* > + * Only the checker differentiates between __virtioXX and __uXX types. But we > + * try to share as much code as we can with the regular GCC build. > + */...
2016 Feb 03
1
[PATCH v7 5/9] virtio_ring: Support DMA APIs
...t; @@ -201,21 +280,15 @@ static inline int virtqueue_add(struct virtqueue *_vq, > > if (desc) { > /* Use a single buffer which doesn't continue */ > - vq->vring.desc[head].flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_INDIRECT); > - vq->vring.desc[head].addr = cpu_to_virtio64(_vq->vdev, virt_to_phys(desc)); > - /* avoid kmemleak false positive (hidden by virt_to_phys) */ > - kmemleak_ignore(desc); > - vq->vring.desc[head].len = cpu_to_virtio32(_vq->vdev, total_sg * sizeof(struct vring_desc)); > - > + indirect = true; > /* Set up rest to...
2016 Feb 03
1
[PATCH v7 5/9] virtio_ring: Support DMA APIs
...t; @@ -201,21 +280,15 @@ static inline int virtqueue_add(struct virtqueue *_vq, > > if (desc) { > /* Use a single buffer which doesn't continue */ > - vq->vring.desc[head].flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_INDIRECT); > - vq->vring.desc[head].addr = cpu_to_virtio64(_vq->vdev, virt_to_phys(desc)); > - /* avoid kmemleak false positive (hidden by virt_to_phys) */ > - kmemleak_ignore(desc); > - vq->vring.desc[head].len = cpu_to_virtio32(_vq->vdev, total_sg * sizeof(struct vring_desc)); > - > + indirect = true; > /* Set up rest to...
2015 Oct 30
1
[PATCH v4 2/6] virtio_ring: Support DMA APIs
...nt head; bool indirect; @@ -171,21 +238,15 @@ static inline int virtqueue_add(struct virtqueue *_vq, if (desc) { /* Use a single buffer which doesn't continue */ - vq->vring.desc[head].flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_INDIRECT); - vq->vring.desc[head].addr = cpu_to_virtio64(_vq->vdev, virt_to_phys(desc)); - /* avoid kmemleak false positive (hidden by virt_to_phys) */ - kmemleak_ignore(desc); - vq->vring.desc[head].len = cpu_to_virtio32(_vq->vdev, total_sg * sizeof(struct vring_desc)); - + indirect = true; /* Set up rest to use this indirect table. */...
2014 Oct 22
0
[PATCH RFC 04/11] virtio_ring: implement endian reversal based on VERSION_1 feature.
...g; sg = next(sg, &total_out)) { > - desc[i].flags = VRING_DESC_F_NEXT; > - desc[i].addr = sg_phys(sg); > - desc[i].len = sg->length; > - desc[i].next = i+1; > + desc[i].flags = cpu_to_virtio16(vq->vq.vdev, > + VRING_DESC_F_NEXT); > + desc[i].addr = cpu_to_virtio64(vq->vq.vdev, > + sg_phys(sg)); > + desc[i].len = cpu_to_virtio32(vq->vq.vdev, > + sg->length); > + desc[i].next = cpu_to_virtio16(vq->vq.vdev, > + i+1); > i++; > } > } > for (; n < (out_sgs + in_sgs); n++) { > for (s...
2015 Apr 14
2
[PATCH v3 0/6] virtio_balloon: virtio 1 support
...[idx].val = cpu_to_le64(val); > - } else { > - vb->legacy_stats[idx].tag = tag; > - vb->legacy_stats[idx].val = val; > - } > + vb->stats[idx].tag = cpu_to_virtio16(vb->vdev, tag); Seems that nobody seemed to care much about statistics... > + vb->stats[idx].val = cpu_to_virtio64(vb->vdev, val); > } > > #define pages_to_bytes(x) ((u64)(x) << PAGE_SHIFT) > With these changes merged in: Acked-by: Cornelia Huck <cornelia.huck at de.ibm.com>