<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/virtio, branch v4.16.1</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.16.1</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.16.1'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2018-03-01T16:53:38Z</updated>
<entry>
<title>virtio_ring: fix num_free handling in error case</title>
<updated>2018-03-01T16:53:38Z</updated>
<author>
<name>Tiwei Bie</name>
<email>tiwei.bie@intel.com</email>
</author>
<published>2018-02-23T11:41:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e82df670235138575b37ff0ec24412a471efd97f'/>
<id>urn:sha1:e82df670235138575b37ff0ec24412a471efd97f</id>
<content type='text'>
The vq-&gt;vq.num_free hasn't been changed when error happens,
so it shouldn't be changed when handling the error.

Fixes: 780bc7903a32 ("virtio_ring: Support DMA APIs")
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Tiwei Bie &lt;tiwei.bie@intel.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_pci: don't kfree device on register failure</title>
<updated>2018-02-01T14:26:45Z</updated>
<author>
<name>weiping zhang</name>
<email>zhangweiping@didichuxing.com</email>
</author>
<published>2017-12-21T12:40:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=33635bd976fb4c3ccf0cfbb81a8d29bb87760607'/>
<id>urn:sha1:33635bd976fb4c3ccf0cfbb81a8d29bb87760607</id>
<content type='text'>
As mentioned at drivers/base/core.c:
/*
 * NOTE: _Never_ directly free @dev after calling this function, even
 * if it returned an error! Always use put_device() to give up the
 * reference initialized in this function instead.
 */
so we don't free vp_dev until vp_dev-&gt;vdev.dev.release be called.

Signed-off-by: weiping zhang &lt;zhangweiping@didichuxing.com&gt;
Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio: split device_register into device_initialize and device_add</title>
<updated>2018-02-01T14:26:45Z</updated>
<author>
<name>weiping zhang</name>
<email>zhangweiping@didichuxing.com</email>
</author>
<published>2017-12-21T12:39:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f2b44cde7e1687ef7886831a3a30df653bda2481'/>
<id>urn:sha1:f2b44cde7e1687ef7886831a3a30df653bda2481</id>
<content type='text'>
In order to make caller do a simple cleanup, we split device_register
into device_initialize and device_add. device_initialize always succeeds,
so the caller can always use put_device when register_virtio_device faild.

Signed-off-by: weiping zhang &lt;zhangweiping@didichuxing.com&gt;
Suggested-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio: make VIRTIO a menuconfig to ease disabling it all</title>
<updated>2018-02-01T14:26:43Z</updated>
<author>
<name>Vincent Legoll</name>
<email>vincent.legoll@gmail.com</email>
</author>
<published>2018-01-07T11:33:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7b95fec6d2ffa53f4a8d637b0f223644d458ea4e'/>
<id>urn:sha1:7b95fec6d2ffa53f4a8d637b0f223644d458ea4e</id>
<content type='text'>
No need to get into the submenu to disable all VIRTIO-related
config entries.

This makes it easier to disable all VIRTIO config options
without entering the submenu. It will also enable one
to see that en/dis-abled state from the outside menu.

This is only intended to change menuconfig UI, not change
the config dependencies.

Signed-off-by: Vincent Legoll &lt;vincent.legoll@gmail.com&gt;
Reviewed-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Tested-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio: virtio_mmio: make of_device_ids const.</title>
<updated>2018-01-30T23:47:35Z</updated>
<author>
<name>Arvind Yadav</name>
<email>arvind.yadav.cs@gmail.com</email>
</author>
<published>2017-06-19T06:14:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=31919140ff8c88c236f697baa28a6305df45e4ea'/>
<id>urn:sha1:31919140ff8c88c236f697baa28a6305df45e4ea</id>
<content type='text'>
of_device_ids are not supposed to change at runtime. All functions
working with of_device_ids provided by &lt;linux/of.h&gt; work with const
of_device_ids. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   3647	    608	      0	   4255	   109f	drivers/virtio/virtio_mmio.o

File size after constify virtio_mmio_match.
   text	   data	    bss	    dec	    hex	filename
   4063	    192	      0	   4255	   109f	drivers/virtio/virtio_mmio.o

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio-mmio: Use PTR_ERR_OR_ZERO()</title>
<updated>2018-01-30T23:47:34Z</updated>
<author>
<name>Vasyl Gomonovych</name>
<email>gomonovych@gmail.com</email>
</author>
<published>2017-11-28T15:15:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c2c9f9bc5b830cbb63d6674b0d51a7773e54c90c'/>
<id>urn:sha1:c2c9f9bc5b830cbb63d6674b0d51a7773e54c90c</id>
<content type='text'>
Fix ptr_ret.cocci warnings:
drivers/virtio/virtio_mmio.c:653:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Signed-off-by: Vasyl Gomonovych &lt;gomonovych@gmail.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_balloon: include disk/file caches memory statistics</title>
<updated>2018-01-30T23:47:33Z</updated>
<author>
<name>Tomáš Golembiovský</name>
<email>tgolembi@redhat.com</email>
</author>
<published>2017-11-12T12:05:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4d32029b8ddb7be4d1699c6d8e1675ff5476d149'/>
<id>urn:sha1:4d32029b8ddb7be4d1699c6d8e1675ff5476d149</id>
<content type='text'>
Add a new field VIRTIO_BALLOON_S_CACHES to virtio_balloon memory
statistics protocol. The value represents all disk/file caches.

In this case it corresponds to the sum of values
Buffers+Cached+SwapCached from /proc/meminfo.

Signed-off-by: Tomáš Golembiovský &lt;tgolembi@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_mmio: fix devm cleanup</title>
<updated>2017-12-14T19:01:40Z</updated>
<author>
<name>Mark Rutland</name>
<email>mark.rutland@arm.com</email>
</author>
<published>2017-12-12T13:45:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c2e90800aef22e7ea14ea7560ba99993f11d3616'/>
<id>urn:sha1:c2e90800aef22e7ea14ea7560ba99993f11d3616</id>
<content type='text'>
Recent rework of the virtio_mmio probe/remove paths balanced a
devm_ioremap() with an iounmap() rather than its devm variant. This ends
up corrupting the devm datastructures, and results in the following
boot-time splat on arm64 under QEMU 2.9.0:

[    3.450397] ------------[ cut here ]------------
[    3.453822] Trying to vfree() nonexistent vm area (00000000c05b4844)
[    3.460534] WARNING: CPU: 1 PID: 1 at mm/vmalloc.c:1525 __vunmap+0x1b8/0x220
[    3.475898] Kernel panic - not syncing: panic_on_warn set ...
[    3.475898]
[    3.493933] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.15.0-rc3 #1
[    3.513109] Hardware name: linux,dummy-virt (DT)
[    3.525382] Call trace:
[    3.531683]  dump_backtrace+0x0/0x368
[    3.543921]  show_stack+0x20/0x30
[    3.547767]  dump_stack+0x108/0x164
[    3.559584]  panic+0x25c/0x51c
[    3.569184]  __warn+0x29c/0x31c
[    3.576023]  report_bug+0x1d4/0x290
[    3.586069]  bug_handler.part.2+0x40/0x100
[    3.597820]  bug_handler+0x4c/0x88
[    3.608400]  brk_handler+0x11c/0x218
[    3.613430]  do_debug_exception+0xe8/0x318
[    3.627370]  el1_dbg+0x18/0x78
[    3.634037]  __vunmap+0x1b8/0x220
[    3.648747]  vunmap+0x6c/0xc0
[    3.653864]  __iounmap+0x44/0x58
[    3.659771]  devm_ioremap_release+0x34/0x68
[    3.672983]  release_nodes+0x404/0x880
[    3.683543]  devres_release_all+0x6c/0xe8
[    3.695692]  driver_probe_device+0x250/0x828
[    3.706187]  __driver_attach+0x190/0x210
[    3.717645]  bus_for_each_dev+0x14c/0x1f0
[    3.728633]  driver_attach+0x48/0x78
[    3.740249]  bus_add_driver+0x26c/0x5b8
[    3.752248]  driver_register+0x16c/0x398
[    3.757211]  __platform_driver_register+0xd8/0x128
[    3.770860]  virtio_mmio_init+0x1c/0x24
[    3.782671]  do_one_initcall+0xe0/0x398
[    3.791890]  kernel_init_freeable+0x594/0x660
[    3.798514]  kernel_init+0x18/0x190
[    3.810220]  ret_from_fork+0x10/0x18

To fix this, we can simply rip out the explicit cleanup that the devm
infrastructure will do for us when our probe function returns an error
code, or when our remove function returns.

We only need to ensure that we call put_device() if a call to
register_virtio_device() fails in the probe path.

Signed-off-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Fixes: 7eb781b1bbb7136f ("virtio_mmio: add cleanup for virtio_mmio_probe")
Fixes: 25f32223bce5c580 ("virtio_mmio: add cleanup for virtio_mmio_remove")
Cc: Cornelia Huck &lt;cohuck@redhat.com&gt;
Cc: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Cc: weiping zhang &lt;zhangweiping@didichuxing.com&gt;
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_mmio: add cleanup for virtio_mmio_remove</title>
<updated>2017-12-07T16:30:50Z</updated>
<author>
<name>weiping zhang</name>
<email>zhangweiping@didichuxing.com</email>
</author>
<published>2017-12-06T13:59:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=25f32223bce5c580e0392a176319a587d7a17e95'/>
<id>urn:sha1:25f32223bce5c580e0392a176319a587d7a17e95</id>
<content type='text'>
cleanup all resource allocated by virtio_mmio_probe.

Signed-off-by: weiping zhang &lt;zhangweiping@didichuxing.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_mmio: add cleanup for virtio_mmio_probe</title>
<updated>2017-12-07T16:30:50Z</updated>
<author>
<name>weiping zhang</name>
<email>zhangweiping@didichuxing.com</email>
</author>
<published>2017-12-06T13:59:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7eb781b1bbb7136fe78fb8c28c1c223c61fa32b5'/>
<id>urn:sha1:7eb781b1bbb7136fe78fb8c28c1c223c61fa32b5</id>
<content type='text'>
As mentioned at drivers/base/core.c:
/*
 * NOTE: _Never_ directly free @dev after calling this function, even
 * if it returned an error! Always use put_device() to give up the
 * reference initialized in this function instead.
 */
so we don't free vm_dev until vm_dev.dev.release be called.

Signed-off-by: weiping zhang &lt;zhangweiping@didichuxing.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
</content>
</entry>
</feed>
