search for: iov_to_buf

Displaying 20 results from an estimated 59 matches for "iov_to_buf".

2013 Jan 19
8
[QEMU PATCH v4 0/3] virtio-net: fix of ctrl commands
From: Amos Kong <akong at redhat.com> Currently virtio-net code relys on the layout of descriptor, this patchset removed the assumptions and introduced a control command to set mac address. Last patch is a trivial renaming. V2: check guest's iov_len V3: fix of migration compatibility make mac field in config space read-only when new feature is acked V4: add fix of descriptor layout
2013 Jan 19
8
[QEMU PATCH v4 0/3] virtio-net: fix of ctrl commands
From: Amos Kong <akong at redhat.com> Currently virtio-net code relys on the layout of descriptor, this patchset removed the assumptions and introduced a control command to set mac address. Last patch is a trivial renaming. V2: check guest's iov_len V3: fix of migration compatibility make mac field in config space read-only when new feature is acked V4: add fix of descriptor layout
2013 Jan 22
5
[QEMU PATCH v5 0/3] virtio-net: fix of ctrl commands
...uced a control command to set mac address. Last patch is a trivial renaming. V2: check guest's iov_len V3: fix of migration compatibility make mac field in config space read-only when new feature is acked V4: add fix of descriptor layout assumptions, trivial rename V5: fix endianness after iov_to_buf copy Amos Kong (2): virtio-net: introduce a new macaddr control virtio-net: rename ctrl rx commands Michael S. Tsirkin (1): virtio-net: remove layout assumptions for ctrl vq hw/pc_piix.c | 4 ++ hw/virtio-net.c | 142 +++++++++++++++++++++++++++++++++--------------------- hw/virtio...
2013 Jan 22
5
[QEMU PATCH v5 0/3] virtio-net: fix of ctrl commands
...uced a control command to set mac address. Last patch is a trivial renaming. V2: check guest's iov_len V3: fix of migration compatibility make mac field in config space read-only when new feature is acked V4: add fix of descriptor layout assumptions, trivial rename V5: fix endianness after iov_to_buf copy Amos Kong (2): virtio-net: introduce a new macaddr control virtio-net: rename ctrl rx commands Michael S. Tsirkin (1): virtio-net: remove layout assumptions for ctrl vq hw/pc_piix.c | 4 ++ hw/virtio-net.c | 142 +++++++++++++++++++++++++++++++++--------------------- hw/virtio...
2015 Apr 12
2
[PATCH 1/2] virtio_balloon: header update for virtio 1
add modern header. This patch is for virtio 1.0 branch, doesn't apply to master. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- include/hw/virtio/virtio-balloon.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h index f863bfe..79eca67 100644 --- a/include/hw/virtio/virtio-balloon.h +++
2015 Apr 12
2
[PATCH 1/2] virtio_balloon: header update for virtio 1
add modern header. This patch is for virtio 1.0 branch, doesn't apply to master. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- include/hw/virtio/virtio-balloon.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h index f863bfe..79eca67 100644 --- a/include/hw/virtio/virtio-balloon.h +++
2015 Apr 13
3
[PATCH 2/2] virtio-balloon: virtio 1 support
...BalloonStat legacy_stat; > + VirtIOBalloonStatModern modern_stat; > size_t offset = 0; > qemu_timeval tv; > > @@ -253,14 +254,28 @@ static void virtio_balloon_receive_stats(VirtIODevice *vdev, VirtQueue *vq) > */ > reset_stats(s); > > - while (iov_to_buf(elem->out_sg, elem->out_num, offset, &stat, sizeof(stat)) > - == sizeof(stat)) { > - uint16_t tag = virtio_tswap16(vdev, stat.tag); > - uint64_t val = virtio_tswap64(vdev, stat.val); > + if (virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) { > +...
2015 Apr 13
3
[PATCH 2/2] virtio-balloon: virtio 1 support
...BalloonStat legacy_stat; > + VirtIOBalloonStatModern modern_stat; > size_t offset = 0; > qemu_timeval tv; > > @@ -253,14 +254,28 @@ static void virtio_balloon_receive_stats(VirtIODevice *vdev, VirtQueue *vq) > */ > reset_stats(s); > > - while (iov_to_buf(elem->out_sg, elem->out_num, offset, &stat, sizeof(stat)) > - == sizeof(stat)) { > - uint16_t tag = virtio_tswap16(vdev, stat.tag); > - uint64_t val = virtio_tswap64(vdev, stat.val); > + if (virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) { > +...
2015 Apr 12
0
[PATCH 2/2] virtio-balloon: virtio 1 support
...m; - VirtIOBalloonStat stat; + VirtIOBalloonStat legacy_stat; + VirtIOBalloonStatModern modern_stat; size_t offset = 0; qemu_timeval tv; @@ -253,14 +254,28 @@ static void virtio_balloon_receive_stats(VirtIODevice *vdev, VirtQueue *vq) */ reset_stats(s); - while (iov_to_buf(elem->out_sg, elem->out_num, offset, &stat, sizeof(stat)) - == sizeof(stat)) { - uint16_t tag = virtio_tswap16(vdev, stat.tag); - uint64_t val = virtio_tswap64(vdev, stat.val); + if (virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) { + while (iov_to_buf(elem...
2015 Apr 13
0
[PATCH 2/2] virtio-balloon: virtio 1 support
...OBalloonStatModern modern_stat; > > size_t offset = 0; > > qemu_timeval tv; > > > > @@ -253,14 +254,28 @@ static void virtio_balloon_receive_stats(VirtIODevice *vdev, VirtQueue *vq) > > */ > > reset_stats(s); > > > > - while (iov_to_buf(elem->out_sg, elem->out_num, offset, &stat, sizeof(stat)) > > - == sizeof(stat)) { > > - uint16_t tag = virtio_tswap16(vdev, stat.tag); > > - uint64_t val = virtio_tswap64(vdev, stat.val); > > + if (virtio_has_feature(vdev, VIRTIO_F_VERSI...
2016 Jul 19
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...v_base; > > + if (elem->out_sg[0].iov_len != sizeof(*hdr)) { > > + error_report("invalid header size: %u", > > + (unsigned)elem->out_sg[0].iov_len); > > + exit(1); > > + } > > Please use iov_to_buf() instead of directly accessing out_sg[]. Virtio > devices are not supposed to assume a particular iovec layout. In other > words, virtio_pstore_hdr could be split across multiple out_sg[] iovecs. > > You must also copy in data (similar to Linux syscall implementations) to > preve...
2016 Jul 19
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...v_base; > > + if (elem->out_sg[0].iov_len != sizeof(*hdr)) { > > + error_report("invalid header size: %u", > > + (unsigned)elem->out_sg[0].iov_len); > > + exit(1); > > + } > > Please use iov_to_buf() instead of directly accessing out_sg[]. Virtio > devices are not supposed to assume a particular iovec layout. In other > words, virtio_pstore_hdr could be split across multiple out_sg[] iovecs. > > You must also copy in data (similar to Linux syscall implementations) to > preve...
2019 Apr 11
1
[RFC 2/3] hw/virtio-rdma: VirtIO rdma device
...OK : + VIRTIO_RDMA_CTRL_ERR; +} + +int virtio_rdma_query_port(VirtIORdma *rdev, struct iovec *in, + struct iovec *out) +{ + struct ibv_port_attr attr = {}; + struct cmd_query_port cmd = {}; + int offs; + size_t s; + + s = iov_to_buf(in, 1, 0, &cmd, sizeof(cmd)); + if (s != sizeof(cmd)) { + return VIRTIO_RDMA_CTRL_ERR; + } + + if (cmd.port != 1) { + return VIRTIO_RDMA_CTRL_ERR; + } + + attr.state = IBV_PORT_ACTIVE; + attr.max_mtu = attr.active_mtu = IBV_MTU_1024; + attr.gid_tbl_len = 256;...
2016 Mar 03
0
[RFC qemu 2/4] virtio-balloon: Add a new feature to balloon device
...tmap_bytes = 0, free_pages_count = 0; > + > + elem = virtqueue_pop(vq, sizeof(VirtQueueElement)); > + if (!elem) { > + return; > + } > + s->free_pages_vq_elem = elem; > + > + if (!elem->out_num) { > + return; > + } > + > + iov_to_buf(elem->out_sg, elem->out_num, offset, > + &free_pages_count, sizeof(uint64_t)); > + > + offset += sizeof(uint64_t); > + iov_to_buf(elem->out_sg, elem->out_num, offset, > + &bitmap_bytes, sizeof(uint64_t)); > + > + offset +...
2016 Mar 03
2
[RFC qemu 2/4] virtio-balloon: Add a new feature to balloon device
...QueueElement *elem; + size_t offset = 0; + uint64_t bitmap_bytes = 0, free_pages_count = 0; + + elem = virtqueue_pop(vq, sizeof(VirtQueueElement)); + if (!elem) { + return; + } + s->free_pages_vq_elem = elem; + + if (!elem->out_num) { + return; + } + + iov_to_buf(elem->out_sg, elem->out_num, offset, + &free_pages_count, sizeof(uint64_t)); + + offset += sizeof(uint64_t); + iov_to_buf(elem->out_sg, elem->out_num, offset, + &bitmap_bytes, sizeof(uint64_t)); + + offset += sizeof(uint64_t); + iov_to_buf...
2016 Mar 03
16
[RFC qemu 0/4] A PV solution for live migration optimization
The current QEMU live migration implementation mark the all the guest's RAM pages as dirtied in the ram bulk stage, all these pages will be processed and that takes quit a lot of CPU cycles. >From guest's point of view, it doesn't care about the content in free pages. We can make use of this fact and skip processing the free pages in the ram bulk stage, it can save a lot CPU cycles
2016 Mar 03
16
[RFC qemu 0/4] A PV solution for live migration optimization
The current QEMU live migration implementation mark the all the guest's RAM pages as dirtied in the ram bulk stage, all these pages will be processed and that takes quit a lot of CPU cycles. >From guest's point of view, it doesn't care about the content in free pages. We can make use of this fact and skip processing the free pages in the ram bulk stage, it can save a lot CPU cycles
2016 Jul 20
0
[PATCH 2/3] qemu: Implement virtio-pstore device
...(elem->out_sg[0].iov_len != sizeof(*hdr)) { > > > + error_report("invalid header size: %u", > > > + (unsigned)elem->out_sg[0].iov_len); > > > + exit(1); > > > + } > > > > Please use iov_to_buf() instead of directly accessing out_sg[]. Virtio > > devices are not supposed to assume a particular iovec layout. In other > > words, virtio_pstore_hdr could be split across multiple out_sg[] iovecs. > > > > You must also copy in data (similar to Linux syscall implementa...
2020 Jul 16
0
[RFC for qemu v4 2/2] virtio_balloon: Add dcvq to deflate continuous pages
...vdev, VirtQueue *vq) > pa = (hwaddr) p << VIRTIO_BALLOON_PFN_SHIFT; > offset += 4; > > - if (vq == s->icvq) { > + if (vq == s->icvq || vq == s->dcvq) { > uint32_t psize_ptr; > if (iov_to_buf(elem->out_sg, elem->out_num, offset, &psize_ptr, 4) != 4) { > break; > @@ -383,8 +385,9 @@ static void virtio_balloon_handle_output(VirtIODevice *vdev, VirtQueue *vq) > balloon_inflate_page(s, section.mr, >...
2016 Mar 04
2
[Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization
...s exactly the suggested optimization point: skip unmapped > pages. > > > > > > > You'd better check the live migration code. > > What's there to check in migration code? > Here's the extent of what balloon does on output: > > > while (iov_to_buf(elem->out_sg, elem->out_num, offset, &pfn, 4) == 4) > { > ram_addr_t pa; > ram_addr_t addr; > int p = virtio_ldl_p(vdev, &pfn); > > pa = (ram_addr_t) p << VIRTIO_BALLOON_PFN_SHIFT; > offset += 4; &...