<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/virtio/virtio_ring.c, branch linux-5.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-03-28T20:52:58Z</updated>
<entry>
<title>virtio_ring: remove flags check for unmap packed indirect desc</title>
<updated>2022-03-28T20:52:58Z</updated>
<author>
<name>Xuan Zhuo</name>
</author>
<published>2022-02-24T11:03:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=920379a465da775ae0bf84d44c16f5432b5be575'/>
<id>urn:sha1:920379a465da775ae0bf84d44c16f5432b5be575</id>
<content type='text'>
When calling vring_unmap_desc_packed(), it will not encounter the
situation that the flags contains VRING_DESC_F_INDIRECT. So remove this
logic.

Signed-off-by: Xuan Zhuo &lt;xuanzhuo@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/20220224110402.108161-4-xuanzhuo@linux.alibaba.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_ring: remove flags check for unmap split indirect desc</title>
<updated>2022-03-28T20:52:58Z</updated>
<author>
<name>Xuan Zhuo</name>
</author>
<published>2022-02-24T11:03:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b4282ebc71aacfa69fc998173ca93b09235ce71f'/>
<id>urn:sha1:b4282ebc71aacfa69fc998173ca93b09235ce71f</id>
<content type='text'>
When calling vring_unmap_one_split_indirect(), it will not encounter the
situation that the flags contains VRING_DESC_F_INDIRECT. So remove this
logic.

Signed-off-by: Xuan Zhuo &lt;xuanzhuo@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/20220224110402.108161-3-xuanzhuo@linux.alibaba.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_ring: rename vring_unmap_state_packed() to vring_unmap_extra_packed()</title>
<updated>2022-03-28T20:52:58Z</updated>
<author>
<name>Xuan Zhuo</name>
</author>
<published>2022-02-24T11:03:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d80dc15bb6e76a6c6b838f683361ceb68950dbbd'/>
<id>urn:sha1:d80dc15bb6e76a6c6b838f683361ceb68950dbbd</id>
<content type='text'>
The actual parameter handled by vring_unmap_state_packed() is that
vring_desc_extra, so this function should use "extra" instead of "state".

Signed-off-by: Xuan Zhuo &lt;xuanzhuo@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/20220224110402.108161-2-xuanzhuo@linux.alibaba.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_ring: mark ring unused on error</title>
<updated>2022-01-14T23:50:53Z</updated>
<author>
<name>Michael S. Tsirkin</name>
</author>
<published>2022-01-06T12:57:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1861ba626ae9b98136f3e504208cdef6b29cd3ec'/>
<id>urn:sha1:1861ba626ae9b98136f3e504208cdef6b29cd3ec</id>
<content type='text'>
A recently added error path does not mark ring unused when exiting on
OOM, which will lead to BUG on the next entry in debug builds.

TODO: refactor code so we have START_USE and END_USE in the same function.

Fixes: fc6d70f40b3d ("virtio_ring: check desc == NULL when using indirect with packed")
Cc: "Xuan Zhuo" &lt;xuanzhuo@linux.alibaba.com&gt;
Cc: Jiasheng Jiang &lt;jiasheng@iscas.ac.cn&gt;
Reviewed-by: Xuan Zhuo &lt;xuanzhuo@linux.alibaba.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_ring: Fix querying of maximum DMA mapping size for virtio device</title>
<updated>2021-12-08T20:04:06Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2021-12-01T11:20:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=817fc978b5a29b039db0418a91072b31c9aab152'/>
<id>urn:sha1:817fc978b5a29b039db0418a91072b31c9aab152</id>
<content type='text'>
virtio_max_dma_size() returns the maximum DMA mapping size of the virtio
device by querying dma_max_mapping_size() for the device when the DMA
API is in use for the vring. Unfortunately, the device passed is
initialised by register_virtio_device() and does not inherit the DMA
configuration from its parent, resulting in SWIOTLB errors when bouncing
is enabled and the default 256K mapping limit (IO_TLB_SEGSIZE) is not
respected:

  | virtio-pci 0000:00:01.0: swiotlb buffer is full (sz: 294912 bytes), total 1024 (slots), used 725 (slots)

Follow the pattern used elsewhere in the virtio_ring code when calling
into the DMA layer and pass the parent device to dma_max_mapping_size()
instead.

Cc: Marc Zyngier &lt;maz@kernel.org&gt;
Cc: Quentin Perret &lt;qperret@google.com&gt;
Cc: "Michael S. Tsirkin" &lt;mst@redhat.com&gt;
Cc: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
Link: https://lore.kernel.org/r/20211201112018.25276-1-will@kernel.org
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Tested-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Fixes: e6d6dd6c875e ("virtio: Introduce virtio_max_dma_size()")
Cc: Joerg Roedel &lt;jroedel@suse.de&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Signed-off-by: Steven Price &lt;steven.price@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>Revert "virtio_ring: validate used buffer length"</title>
<updated>2021-11-24T23:47:27Z</updated>
<author>
<name>Michael S. Tsirkin</name>
</author>
<published>2021-11-24T23:44:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f124034faa911ed534bf8c4881ad98dbbde2a966'/>
<id>urn:sha1:f124034faa911ed534bf8c4881ad98dbbde2a966</id>
<content type='text'>
This reverts commit 939779f5152d161b34f612af29e7dc1ac4472fcf.

Attempts to validate length in the core did not work out: there turn out
to exist multiple broken devices, and in particular legacy devices are
known to be broken in this respect.

We have ideas for handling this better in the next version but for now
let's revert to a known good state to make sure drivers work for people.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_ring: validate used buffer length</title>
<updated>2021-11-01T09:26:48Z</updated>
<author>
<name>Jason Wang</name>
</author>
<published>2021-10-27T02:21:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=939779f5152d161b34f612af29e7dc1ac4472fcf'/>
<id>urn:sha1:939779f5152d161b34f612af29e7dc1ac4472fcf</id>
<content type='text'>
This patch validate the used buffer length provided by the device
before trying to use it. This is done by record the in buffer length
in a new field in desc_state structure during virtqueue_add(), then we
can fail the virtqueue_get_buf() when we find the device is trying to
give us a used buffer length which is greater than the in buffer
length.

Since some drivers have already done the validation by themselves,
this patch tries to makes the core validation optional. For the driver
that doesn't want the validation, it can set the
suppress_used_validation to be true (which could be overridden by
force_used_validation module parameter). To be more efficient, a
dedicate array is used for storing the validate used length, this
helps to eliminate the cache stress if validation is done by the
driver.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Link: https://lore.kernel.org/r/20211027022107.14357-2-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_ring: fix typos in vring_desc_extra</title>
<updated>2021-11-01T09:26:48Z</updated>
<author>
<name>Jason Wang</name>
</author>
<published>2021-10-19T07:01:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ef5c366fea30f64d52bb1c4c1e2959a5e6b66e88'/>
<id>urn:sha1:ef5c366fea30f64d52bb1c4c1e2959a5e6b66e88</id>
<content type='text'>
We're actually tracking descriptor address and length instead of the
buffer.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Link: https://lore.kernel.org/r/20211019070152.8236-7-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_ring: check desc == NULL when using indirect with packed</title>
<updated>2021-11-01T09:26:47Z</updated>
<author>
<name>Xuan Zhuo</name>
</author>
<published>2021-10-20T11:23:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fc6d70f40b3d0b3219e2026d05be0409695f620d'/>
<id>urn:sha1:fc6d70f40b3d0b3219e2026d05be0409695f620d</id>
<content type='text'>
When using indirect with packed, we don't check for allocation failures.
This patch checks that and fall back on direct.

Fixes: 1ce9e6055fa0 ("virtio_ring: introduce packed ring support")
Signed-off-by: Xuan Zhuo &lt;xuanzhuo@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/20211020112323.67466-3-xuanzhuo@linux.alibaba.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_ring: make virtqueue_add_indirect_packed prettier</title>
<updated>2021-11-01T09:26:47Z</updated>
<author>
<name>Xuan Zhuo</name>
</author>
<published>2021-10-20T11:23:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8d7670f3734eed45bb9d00d8fd1201f662bc667f'/>
<id>urn:sha1:8d7670f3734eed45bb9d00d8fd1201f662bc667f</id>
<content type='text'>
Align the arguments of virtqueue_add_indirect_packed() to the open ( to
make it look prettier.

Signed-off-by: Xuan Zhuo &lt;xuanzhuo@linux.alibaba.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Link: https://lore.kernel.org/r/20211020112323.67466-2-xuanzhuo@linux.alibaba.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
</feed>
