<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/vhost/vringh.c, branch linux-6.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-02-03T17:17:42Z</updated>
<entry>
<title>vringh: use bvec_set_page to initialize a bvec</title>
<updated>2023-02-03T17:17:42Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2023-02-03T15:06:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=58dfe14073846e416d5b3595314a4f37e1a89c50'/>
<id>urn:sha1:58dfe14073846e416d5b3595314a4f37e1a89c50</id>
<content type='text'>
Use the bvec_set_page helper to initialize a bvec.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Link: https://lore.kernel.org/r/20230203150634.3199647-23-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>vringh: fix range used in iotlb_translate()</title>
<updated>2022-12-28T10:28:10Z</updated>
<author>
<name>Stefano Garzarella</name>
</author>
<published>2022-11-09T10:25:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f85efa9b0f5381874f727bd98f56787840313f0b'/>
<id>urn:sha1:f85efa9b0f5381874f727bd98f56787840313f0b</id>
<content type='text'>
vhost_iotlb_itree_first() requires `start` and `last` parameters
to search for a mapping that overlaps the range.

In iotlb_translate() we cyclically call vhost_iotlb_itree_first(),
incrementing `addr` by the amount already translated, so rightly
we move the `start` parameter passed to vhost_iotlb_itree_first(),
but we should hold the `last` parameter constant.

Let's fix it by saving the `last` parameter value before incrementing
`addr` in the loop.

Fixes: 9ad9c49cfe97 ("vringh: IOTLB support")
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Message-Id: &lt;20221109102503.18816-2-sgarzare@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>use less confusing names for iov_iter direction initializers</title>
<updated>2022-11-25T18:01:55Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2022-09-16T00:25:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=de4eda9de2d957ef2d6a8365a01e26a435e958cb'/>
<id>urn:sha1:de4eda9de2d957ef2d6a8365a01e26a435e958cb</id>
<content type='text'>
READ/WRITE proved to be actively confusing - the meanings are
"data destination, as used with read(2)" and "data source, as
used with write(2)", but people keep interpreting those as
"we read data from it" and "we write data to it", i.e. exactly
the wrong way.

Call them ITER_DEST and ITER_SOURCE - at least that is harder
to misinterpret...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>[vhost] fix 'direction' argument of iov_iter_{init,bvec}()</title>
<updated>2022-11-25T18:01:21Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2022-09-15T23:09:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e3bf3df824675ea9cadc3cd2c75d08ee83a6ae26'/>
<id>urn:sha1:e3bf3df824675ea9cadc3cd2c75d08ee83a6ae26</id>
<content type='text'>
READ means "data destination", WRITE - "data source".

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>vringh: iterate on iotlb_translate to handle large translations</title>
<updated>2022-08-11T08:06:37Z</updated>
<author>
<name>Stefano Garzarella</name>
</author>
<published>2022-06-24T07:56:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=309bba39c945ac8ab8083ac05cd6cfe5822968e0'/>
<id>urn:sha1:309bba39c945ac8ab8083ac05cd6cfe5822968e0</id>
<content type='text'>
iotlb_translate() can return -ENOBUFS if the bio_vec is not big enough
to contain all the ranges for translation.
This can happen for example if the VMM maps a large bounce buffer,
without using hugepages, that requires more than 16 ranges to translate
the addresses.

To handle this case, let's extend iotlb_translate() to also return the
number of bytes successfully translated.
In copy_from_iotlb()/copy_to_iotlb() loops by calling iotlb_translate()
several times until we complete the translation.

Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Message-Id: &lt;20220624075656.13997-1-sgarzare@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vringh: Fix loop descriptors check in the indirect cases</title>
<updated>2022-06-08T12:56:03Z</updated>
<author>
<name>Xie Yongji</name>
</author>
<published>2022-05-05T10:09:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dbd29e0752286af74243cf891accf472b2f3edd8'/>
<id>urn:sha1:dbd29e0752286af74243cf891accf472b2f3edd8</id>
<content type='text'>
We should use size of descriptor chain to test loop condition
in the indirect case. And another statistical count is also introduced
for indirect descriptors to avoid conflict with the statistical count
of direct descriptors.

Fixes: f87d0fbb5798 ("vringh: host-side implementation of virtio rings.")
Signed-off-by: Xie Yongji &lt;xieyongji@bytedance.com&gt;
Signed-off-by: Fam Zheng &lt;fam.zheng@bytedance.com&gt;
Message-Id: &lt;20220505100910.137-1-xieyongji@bytedance.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vringh: Use wiov-&gt;used to check for read/write desc order</title>
<updated>2021-08-11T10:44:24Z</updated>
<author>
<name>Neeraj Upadhyay</name>
</author>
<published>2021-06-25T03:25:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e74cfa91f42c50f7f649b0eca46aa049754ccdbd'/>
<id>urn:sha1:e74cfa91f42c50f7f649b0eca46aa049754ccdbd</id>
<content type='text'>
As __vringh_iov() traverses a descriptor chain, it populates
each descriptor entry into either read or write vring iov
and increments that iov's -&gt;used member. So, as we iterate
over a descriptor chain, at any point, (riov/wriov)-&gt;used
value gives the number of descriptor enteries available,
which are to be read or written by the device. As all read
iovs must precede the write iovs, wiov-&gt;used should be zero
when we are traversing a read descriptor. Current code checks
for wiov-&gt;i, to figure out whether any previous entry in the
current descriptor chain was a write descriptor. However,
iov-&gt;i is only incremented, when these vring iovs are consumed,
at a later point, and remain 0 in __vringh_iov(). So, correct
the check for read and write descriptor order, to use
wiov-&gt;used.

Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: Neeraj Upadhyay &lt;neeraju@codeaurora.org&gt;
Link: https://lore.kernel.org/r/1624591502-4827-1-git-send-email-neeraju@codeaurora.org
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vringh: implement vringh_kiov_advance()</title>
<updated>2021-05-03T08:55:53Z</updated>
<author>
<name>Stefano Garzarella</name>
</author>
<published>2021-03-15T16:34:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b8c06ad4d67db56ed6bdfb685c134da74e92a2c7'/>
<id>urn:sha1:b8c06ad4d67db56ed6bdfb685c134da74e92a2c7</id>
<content type='text'>
In some cases, it may be useful to provide a way to skip a number
of bytes in a vringh_kiov.

Let's implement vringh_kiov_advance() for this purpose, reusing the
code from vringh_iov_xfer().
We replace that code calling the new vringh_kiov_advance().

Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Link: https://lore.kernel.org/r/20210315163450.254396-6-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vringh: explain more about cleaning riov and wiov</title>
<updated>2021-05-03T08:55:53Z</updated>
<author>
<name>Stefano Garzarella</name>
</author>
<published>2021-03-15T16:34:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=69c13c58bd10f036d6e697e664948952e61acfb1'/>
<id>urn:sha1:69c13c58bd10f036d6e697e664948952e61acfb1</id>
<content type='text'>
riov and wiov can be reused with subsequent calls of vringh_getdesc_*().

Let's add a paragraph in the documentation of these functions to better
explain when riov and wiov need to be cleaned up.

Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Link: https://lore.kernel.org/r/20210315163450.254396-5-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vringh: reset kiov 'consumed' field in __vringh_iov()</title>
<updated>2021-05-03T08:55:53Z</updated>
<author>
<name>Stefano Garzarella</name>
</author>
<published>2021-03-15T16:34:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bbc2c372a83d74d5499ad21d0ade2b71f5bde620'/>
<id>urn:sha1:bbc2c372a83d74d5499ad21d0ade2b71f5bde620</id>
<content type='text'>
__vringh_iov() overwrites the contents of riov and wiov, in fact it
resets the 'i' and 'used' fields, but also the 'consumed' field should
be reset to avoid an inconsistent state.

Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Link: https://lore.kernel.org/r/20210315163450.254396-4-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
</feed>
