<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/virtio, branch v5.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.6</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-03-08T09:35:24Z</updated>
<entry>
<title>virtio_balloon: Adjust label in virtballoon_probe</title>
<updated>2020-03-08T09:35:24Z</updated>
<author>
<name>Nathan Chancellor</name>
<email>natechancellor@gmail.com</email>
</author>
<published>2020-02-16T00:40:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6ae4edab2fbf86ec92fbf0a8f0c60b857d90d50f'/>
<id>urn:sha1:6ae4edab2fbf86ec92fbf0a8f0c60b857d90d50f</id>
<content type='text'>
Clang warns when CONFIG_BALLOON_COMPACTION is unset:

../drivers/virtio/virtio_balloon.c:963:1: warning: unused label
'out_del_vqs' [-Wunused-label]
out_del_vqs:
^~~~~~~~~~~~
1 warning generated.

Move the label within the preprocessor block since it is only used when
CONFIG_BALLOON_COMPACTION is set.

Fixes: 1ad6f58ea936 ("virtio_balloon: Fix memory leaks on errors in virtballoon_probe()")
Link: https://github.com/ClangBuiltLinux/linux/issues/886
Signed-off-by: Nathan Chancellor &lt;natechancellor@gmail.com&gt;
Link: https://lore.kernel.org/r/20200216004039.23464-1-natechancellor@gmail.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_ring: Fix mem leak with vring_new_virtqueue()</title>
<updated>2020-03-08T09:35:23Z</updated>
<author>
<name>Suman Anna</name>
<email>s-anna@ti.com</email>
</author>
<published>2020-02-24T21:26:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f13f09a12cbd0c7b776e083c5d008b6c6a9c4e0b'/>
<id>urn:sha1:f13f09a12cbd0c7b776e083c5d008b6c6a9c4e0b</id>
<content type='text'>
The functions vring_new_virtqueue() and __vring_new_virtqueue() are used
with split rings, and any allocations within these functions are managed
outside of the .we_own_ring flag. The commit cbeedb72b97a ("virtio_ring:
allocate desc state for split ring separately") allocates the desc state
within the __vring_new_virtqueue() but frees it only when the .we_own_ring
flag is set. This leads to a memory leak when freeing such allocated
virtqueues with the vring_del_virtqueue() function.

Fix this by moving the desc_state free code outside the flag and only
for split rings. Issue was discovered during testing with remoteproc
and virtio_rpmsg.

Fixes: cbeedb72b97a ("virtio_ring: allocate desc state for split ring separately")
Signed-off-by: Suman Anna &lt;s-anna@ti.com&gt;
Link: https://lore.kernel.org/r/20200224212643.30672-1-s-anna@ti.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_balloon: Fix memory leaks on errors in virtballoon_probe()</title>
<updated>2020-02-06T08:40:27Z</updated>
<author>
<name>David Hildenbrand</name>
<email>david@redhat.com</email>
</author>
<published>2020-02-05T16:34:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1ad6f58ea9364b0a5d8ae06249653ac9304a8578'/>
<id>urn:sha1:1ad6f58ea9364b0a5d8ae06249653ac9304a8578</id>
<content type='text'>
We forget to put the inode and unmount the kernfs used for compaction.

Fixes: 71994620bb25 ("virtio_balloon: replace oom notifier with shrinker")
Cc: "Michael S. Tsirkin" &lt;mst@redhat.com&gt;
Cc: Jason Wang &lt;jasowang@redhat.com&gt;
Cc: Wei Wang &lt;wei.w.wang@intel.com&gt;
Cc: Liang Li &lt;liang.z.li@intel.com&gt;
Signed-off-by: David Hildenbrand &lt;david@redhat.com&gt;
Link: https://lore.kernel.org/r/20200205163402.42627-3-david@redhat.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio-balloon: Fix memory leak when unloading while hinting is in progress</title>
<updated>2020-02-06T08:40:26Z</updated>
<author>
<name>David Hildenbrand</name>
<email>david@redhat.com</email>
</author>
<published>2020-02-05T16:34:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6c22dc61c76b7e7d355f1697ba0ecf26d1334ba6'/>
<id>urn:sha1:6c22dc61c76b7e7d355f1697ba0ecf26d1334ba6</id>
<content type='text'>
When unloading the driver while hinting is in progress, we will not
release the free page blocks back to MM, resulting in a memory leak.

Fixes: 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
Cc: "Michael S. Tsirkin" &lt;mst@redhat.com&gt;
Cc: Jason Wang &lt;jasowang@redhat.com&gt;
Cc: Wei Wang &lt;wei.w.wang@intel.com&gt;
Cc: Liang Li &lt;liang.z.li@intel.com&gt;
Signed-off-by: David Hildenbrand &lt;david@redhat.com&gt;
Link: https://lore.kernel.org/r/20200205163402.42627-2-david@redhat.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_balloon: prevent pfn array overflow</title>
<updated>2020-02-06T08:40:26Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2020-02-06T07:40:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6e9826e77249355c09db6ba41cd3f84e89f4b614'/>
<id>urn:sha1:6e9826e77249355c09db6ba41cd3f84e89f4b614</id>
<content type='text'>
Make sure, at build time, that pfn array is big enough to hold a single
page.  It happens to be true since the PAGE_SHIFT value at the moment is
20, which is 1M - exactly 256 4K balloon pages.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio-pci: check name when counting MSI-X vectors</title>
<updated>2020-02-06T08:40:26Z</updated>
<author>
<name>Daniel Verkamp</name>
<email>dverkamp@chromium.org</email>
</author>
<published>2020-01-03T18:40:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=303090b513fd1ee45aa1536b71a3838dc054bc05'/>
<id>urn:sha1:303090b513fd1ee45aa1536b71a3838dc054bc05</id>
<content type='text'>
VQs without a name specified are not valid; they are skipped in the
later loop that assigns MSI-X vectors to queues, but the per_vq_vectors
loop above that counts the required number of vectors previously still
counted any queue with a non-NULL callback as needing a vector.

Add a check to the per_vq_vectors loop so that vectors with no name are
not counted to make the two loops consistent.  This prevents
over-counting unnecessary vectors (e.g. for features which were not
negotiated with the device).

Cc: stable@vger.kernel.org
Fixes: 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
Signed-off-by: Daniel Verkamp &lt;dverkamp@chromium.org&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Wang, Wei W &lt;wei.w.wang@intel.com&gt;
</content>
</entry>
<entry>
<title>virtio-balloon: initialize all vq callbacks</title>
<updated>2020-02-06T08:40:26Z</updated>
<author>
<name>Daniel Verkamp</name>
<email>dverkamp@chromium.org</email>
</author>
<published>2020-01-03T18:40:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5790b53390e18fdd21e70776e46d058c05eda2f2'/>
<id>urn:sha1:5790b53390e18fdd21e70776e46d058c05eda2f2</id>
<content type='text'>
Ensure that elements of the callbacks array that correspond to
unavailable features are set to NULL; previously, they would be left
uninitialized.

Since the corresponding names array elements were explicitly set to
NULL, the uninitialized callback pointers would not actually be
dereferenced; however, the uninitialized callbacks elements would still
be read in vp_find_vqs_msix() and used to calculate the number of MSI-X
vectors required.

Cc: stable@vger.kernel.org
Fixes: 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
Signed-off-by: Daniel Verkamp &lt;dverkamp@chromium.org&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio-mmio: convert to devm_platform_ioremap_resource</title>
<updated>2020-02-06T08:40:26Z</updated>
<author>
<name>Yangtao Li</name>
<email>tiny.windzz@gmail.com</email>
</author>
<published>2019-12-22T19:08:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c64eb62cfce242a57a7276ca8280ae0baab29d05'/>
<id>urn:sha1:c64eb62cfce242a57a7276ca8280ae0baab29d05</id>
<content type='text'>
Use devm_platform_ioremap_resource() to simplify code, which
contains platform_get_resource, devm_request_mem_region and
devm_ioremap.

Signed-off-by: Yangtao Li &lt;tiny.windzz@gmail.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_balloon: divide/multiply instead of shifts</title>
<updated>2019-12-11T13:14:07Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2019-11-19T10:25:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=63b9b80e9f5b2c463d98d6e550e0d0e3ace66033'/>
<id>urn:sha1:63b9b80e9f5b2c463d98d6e550e0d0e3ace66033</id>
<content type='text'>
We managed to get confused about the shift direction at least once.
Let's switch to division/multiplcation instead. Add a number of pages
macro for this purpose.  We still keep the order macro around too since
this is what alloc/free pages want.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Wei Wang &lt;wei.w.wang@intel.com&gt;
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_balloon: name cleanups</title>
<updated>2019-12-11T13:14:06Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2019-11-19T10:21:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2a946fa1c8bc26df03bacebb6811b656d5e0cf1c'/>
<id>urn:sha1:2a946fa1c8bc26df03bacebb6811b656d5e0cf1c</id>
<content type='text'>
free_page_order is a confusing name. It's not a page order
actually, it's the order of the block of memory we are hinting.
Rename to hint_block_order. Also, rename SIZE to BYTES
to make it clear it's the block size in bytes.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Wei Wang &lt;wei.w.wang@intel.com&gt;
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
</content>
</entry>
</feed>
