<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/char/virtio_console.c, branch linux-4.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-11-10T15:38:52Z</updated>
<entry>
<title>virtio: console: Unlock vqs while freeing buffers</title>
<updated>2016-11-10T15:38:52Z</updated>
<author>
<name>Matt Redfearn</name>
</author>
<published>2016-10-11T11:05:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d8db5234adef690428989554edbcde6224aca49f'/>
<id>urn:sha1:d8db5234adef690428989554edbcde6224aca49f</id>
<content type='text'>
commit 34563769e438d2881f62cf4d9badc4e589ac0ec0 upstream.

Commit c6017e793b93 ("virtio: console: add locks around buffer removal
in port unplug path") added locking around the freeing of buffers in the
vq. However, when free_buf() is called with can_sleep = true and rproc
is enabled, it calls dma_free_coherent() directly, requiring interrupts
to be enabled. Currently a WARNING is triggered due to the spin locking
around free_buf, with a call stack like this:

WARNING: CPU: 3 PID: 121 at ./include/linux/dma-mapping.h:433
free_buf+0x1a8/0x288
Call Trace:
[&lt;8040c538&gt;] show_stack+0x74/0xc0
[&lt;80757240&gt;] dump_stack+0xd0/0x110
[&lt;80430d98&gt;] __warn+0xfc/0x130
[&lt;80430ee0&gt;] warn_slowpath_null+0x2c/0x3c
[&lt;807e7c6c&gt;] free_buf+0x1a8/0x288
[&lt;807ea590&gt;] remove_port_data+0x50/0xac
[&lt;807ea6a0&gt;] unplug_port+0xb4/0x1bc
[&lt;807ea858&gt;] virtcons_remove+0xb0/0xfc
[&lt;807b6734&gt;] virtio_dev_remove+0x58/0xc0
[&lt;807f918c&gt;] __device_release_driver+0xac/0x134
[&lt;807f924c&gt;] device_release_driver+0x38/0x50
[&lt;807f7edc&gt;] bus_remove_device+0xfc/0x130
[&lt;807f4b74&gt;] device_del+0x17c/0x21c
[&lt;807f4c38&gt;] device_unregister+0x24/0x38
[&lt;807b6b50&gt;] unregister_virtio_device+0x28/0x44

Fix this by restructuring the loops to allow the locks to only be taken
where it is necessary to protect the vqs, and release it while the
buffer is being freed.

Fixes: c6017e793b93 ("virtio: console: add locks around buffer removal in port unplug path")
Signed-off-by: Matt Redfearn &lt;matt.redfearn@imgtec.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>virtio_console: Stop doing DMA on the stack</title>
<updated>2016-09-09T18:12:45Z</updated>
<author>
<name>Andy Lutomirski</name>
</author>
<published>2016-08-30T15:04:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5e59d9a1aed26abcc79abe78af5cfd34e53cbe7f'/>
<id>urn:sha1:5e59d9a1aed26abcc79abe78af5cfd34e53cbe7f</id>
<content type='text'>
virtio_console uses a small DMA buffer for control requests.  Move
that buffer into heap memory.

Doing virtio DMA on the stack is normally okay on non-DMA-API virtio
systems (which is currently most of them), but it breaks completely
if the stack is virtually mapped.

Tested by typing both directions using picocom aimed at /dev/hvc0.

Signed-off-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Amit Shah &lt;amit.shah@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_console: silence a static checker warning</title>
<updated>2015-05-24T19:24:35Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2015-05-08T09:16:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=db1700685c0ad2ecb9e42af6a568435a03bbc3fd'/>
<id>urn:sha1:db1700685c0ad2ecb9e42af6a568435a03bbc3fd</id>
<content type='text'>
My static checker complains that this sprintf() can overflow but really
it can't.  Just silence the warning by using snprintf().

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Amit Shah &lt;amit.shah@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virtio_console: Use bool function return values of true/false not 1/0</title>
<updated>2015-04-03T14:15:30Z</updated>
<author>
<name>Joe Perches</name>
</author>
<published>2015-03-30T23:46:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f580d730c90c11be0ef4fe88aff3de80845176cb'/>
<id>urn:sha1:f580d730c90c11be0ef4fe88aff3de80845176cb</id>
<content type='text'>
Use the normal return values for bool functions

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Reviewed-by: Amit Shah &lt;amit.shah@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virtio_console: avoid config access from irq</title>
<updated>2015-03-05T03:06:18Z</updated>
<author>
<name>Michael S. Tsirkin</name>
</author>
<published>2015-03-05T00:15:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eeb8a7e8bb123e84daeef84f5a2eab99ad2839a2'/>
<id>urn:sha1:eeb8a7e8bb123e84daeef84f5a2eab99ad2839a2</id>
<content type='text'>
when multiport is off, virtio console invokes config access from irq
context, config access is blocking on s390.
Fix this up by scheduling work from config irq - similar to what we do
for multiport configs.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Amit Shah &lt;amit.shah@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: stable@kernel.org
</content>
</entry>
<entry>
<title>virtio_console: init work unconditionally</title>
<updated>2015-03-05T03:06:17Z</updated>
<author>
<name>Michael S. Tsirkin</name>
</author>
<published>2015-03-05T00:15:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4f6e24ed9de8634d6471ef86b382cba6d4e57ca8'/>
<id>urn:sha1:4f6e24ed9de8634d6471ef86b382cba6d4e57ca8</id>
<content type='text'>
when multiport is off, we don't initialize config work,
but we then cancel uninitialized control_work on freeze.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Amit Shah &lt;amit.shah@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: stable@kernel.org
</content>
</entry>
<entry>
<title>virtio: don't require a config space on the console device.</title>
<updated>2015-02-11T04:33:17Z</updated>
<author>
<name>Rusty Russell</name>
</author>
<published>2015-02-11T04:31:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=be8ff5952a8d943660d3c01f1abf4e71eb565fdb'/>
<id>urn:sha1:be8ff5952a8d943660d3c01f1abf4e71eb565fdb</id>
<content type='text'>
Strictly, it's only needed when we have features (size or multiport).

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>virtio/console: verify device has config space</title>
<updated>2015-01-21T05:58:46Z</updated>
<author>
<name>Michael S. Tsirkin</name>
</author>
<published>2015-01-12T14:23:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=011f0e7a6944855436fb29c7a7e6c3c89c95f8fb'/>
<id>urn:sha1:011f0e7a6944855436fb29c7a7e6c3c89c95f8fb</id>
<content type='text'>
Some devices might not implement config space access
(e.g. remoteproc used not to - before 3.9).
virtio/console needs config space access so make it
fail gracefully if not there.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>virtio_console: fix sparse warnings</title>
<updated>2014-12-09T10:06:33Z</updated>
<author>
<name>Michael S. Tsirkin</name>
</author>
<published>2014-12-01T11:31:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=48b36066b48025b7cd7d46c9a879f2f72fd9086a'/>
<id>urn:sha1:48b36066b48025b7cd7d46c9a879f2f72fd9086a</id>
<content type='text'>
CHECK drivers/char/virtio_console.c
drivers/char/virtio_console.c:687:36: warning: incorrect type in
	argument 1 (different address spaces)
drivers/char/virtio_console.c:687:36:    expected void [noderef]
	&lt;asn:1&gt;*to
drivers/char/virtio_console.c:687:36:    got char *out_buf
drivers/char/virtio_console.c:790:35: warning: incorrect type in
	argument 2 (different address spaces)
drivers/char/virtio_console.c:790:35:    expected char *out_buf
drivers/char/virtio_console.c:790:35:    got char [noderef]
	&lt;asn:1&gt;*ubuf

fill_readbuf is reused with both kernel and userspace pointers,
depending on value of to_user flag.

Tag address parameter as __user, and cast to/from regular pointer type
when we know it's safe.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;




</content>
</entry>
<entry>
<title>virtio: drop VIRTIO_F_VERSION_1 from drivers</title>
<updated>2014-12-09T10:06:32Z</updated>
<author>
<name>Michael S. Tsirkin</name>
</author>
<published>2014-12-01T14:49:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=51cdc3815f15cf1d6e25915965b34d5ea148e434'/>
<id>urn:sha1:51cdc3815f15cf1d6e25915965b34d5ea148e434</id>
<content type='text'>
Core activates this bit automatically now,
drop it from drivers that set it explicitly.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;




</content>
</entry>
</feed>
