<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/char/virtio_console.c, branch linux-3.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2013-04-05T16:26:15Z</updated>
<entry>
<title>virtio: console: add locking around c_ovq operations</title>
<updated>2013-04-05T16:26:15Z</updated>
<author>
<name>Amit Shah</name>
</author>
<published>2013-03-29T11:00:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9d3fba85c14cef1dbdace865d7825c01839c941'/>
<id>urn:sha1:d9d3fba85c14cef1dbdace865d7825c01839c941</id>
<content type='text'>
commit 9ba5c80b1aea8648a3efe5f22dc1f7cacdfbeeb8 upstream.

When multiple ovq operations are being performed (lots of open/close
operations on virtio_console fds), the __send_control_msg() function can
get confused without locking.

A simple recipe to cause badness is:
* create a QEMU VM with two virtio-serial ports
* in the guest, do
  while true;do echo abc &gt;/dev/vport0p1;done
  while true;do echo edf &gt;/dev/vport0p2;done

In one run, this caused a panic in __send_control_msg().  In another, I
got

   virtio_console virtio0: control-o:id 0 is not a head!

This also results repeated messages similar to these on the host:

  qemu-kvm: virtio-serial-bus: Unexpected port id 478762112 for device virtio-serial-bus.0
  qemu-kvm: virtio-serial-bus: Unexpected port id 478762368 for device virtio-serial-bus.0

Reported-by: FuXiangChun &lt;xfu@redhat.com&gt;
Signed-off-by: Amit Shah &lt;amit.shah@redhat.com&gt;
Reviewed-by: Wanlong Gao &lt;gaowanlong@cn.fujitsu.com&gt;
Reviewed-by: Asias He &lt;asias@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>virtio: console: rename cvq_lock to c_ivq_lock</title>
<updated>2013-04-05T16:26:15Z</updated>
<author>
<name>Amit Shah</name>
</author>
<published>2013-03-29T11:00:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=566ccc5afe7305ad8b83ec508d843e9486a598d4'/>
<id>urn:sha1:566ccc5afe7305ad8b83ec508d843e9486a598d4</id>
<content type='text'>
commit 165b1b8bbc17c9469b053bab78b11b7cbce6d161 upstream.

The cvq_lock was taken for the c_ivq.  Rename the lock to make that
obvious.

We'll also add a lock around the c_ovq in the next commit, so there's no
ambiguity.

Signed-off-by: Amit Shah &lt;amit.shah@redhat.com&gt;
Reviewed-by: Asias He &lt;asias@redhat.com&gt;
Reviewed-by: Wanlong Gao &lt;gaowanlong@cn.fujitsu.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>virtio_console: Don't access uninitialized data.</title>
<updated>2013-02-07T01:07:37Z</updated>
<author>
<name>Sjur Brændeland</name>
</author>
<published>2013-01-21T23:20:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aded024a12b32fc1ed9a80639681daae2d07ec25'/>
<id>urn:sha1:aded024a12b32fc1ed9a80639681daae2d07ec25</id>
<content type='text'>
Don't access uninitialized work-queue when removing device.
The work queue is initialized only if the device multi-queue.
So don't call cancel_work unless this is a multi-queue device.

This fixes the following panic:

Kernel panic - not syncing: BUG!
Call Trace:
62031b28:  [&lt;6026085d&gt;] panic+0x16b/0x2d3
62031b30:  [&lt;6004ef5e&gt;] flush_work+0x0/0x1d7
62031b60:  [&lt;602606f2&gt;] panic+0x0/0x2d3
62031b68:  [&lt;600333b0&gt;] memcpy+0x0/0x140
62031b80:  [&lt;6002d58a&gt;] unblock_signals+0x0/0x84
62031ba0:  [&lt;602609c5&gt;] printk+0x0/0xa0
62031bd8:  [&lt;60264e51&gt;] __mutex_unlock_slowpath+0x13d/0x148
62031c10:  [&lt;6004ef5e&gt;] flush_work+0x0/0x1d7
62031c18:  [&lt;60050234&gt;] try_to_grab_pending+0x0/0x17e
62031c38:  [&lt;6004e984&gt;] get_work_gcwq+0x71/0x8f
62031c48:  [&lt;60050539&gt;] __cancel_work_timer+0x5b/0x115
62031c78:  [&lt;628acc85&gt;] unplug_port+0x0/0x191 [virtio_console]
62031c98:  [&lt;6005061c&gt;] cancel_work_sync+0x12/0x14
62031ca8:  [&lt;628ace96&gt;] virtcons_remove+0x80/0x15c [virtio_console]
62031ce8:  [&lt;628191de&gt;] virtio_dev_remove+0x1e/0x7e [virtio]
62031d08:  [&lt;601cf242&gt;] __device_release_driver+0x75/0xe4
62031d28:  [&lt;601cf2dd&gt;] device_release_driver+0x2c/0x40
62031d48:  [&lt;601ce0dd&gt;] driver_unbind+0x7d/0xc6
62031d88:  [&lt;601cd5d9&gt;] drv_attr_store+0x27/0x29
62031d98:  [&lt;60115f61&gt;] sysfs_write_file+0x100/0x14d
62031df8:  [&lt;600b737d&gt;] vfs_write+0xcb/0x184
62031e08:  [&lt;600b58b8&gt;] filp_close+0x88/0x94
62031e38:  [&lt;600b7686&gt;] sys_write+0x59/0x88
62031e88:  [&lt;6001ced1&gt;] handle_syscall+0x5d/0x80
62031ea8:  [&lt;60030a74&gt;] userspace+0x405/0x531
62031f08:  [&lt;600d32cc&gt;] sys_dup+0x0/0x5e
62031f28:  [&lt;601b11d6&gt;] strcpy+0x0/0x18
62031f38:  [&lt;600be46c&gt;] do_execve+0x10/0x12
62031f48:  [&lt;600184c7&gt;] run_init_process+0x43/0x45
62031fd8:  [&lt;60019a91&gt;] new_thread_handler+0xba/0xbc

Signed-off-by: Sjur Brændeland &lt;sjur.brandeland@stericsson.com&gt;
Cc: stable@kernel.org
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>Drivers: char: remove __dev* attributes.</title>
<updated>2013-01-03T23:57:15Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2012-12-21T23:12:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bcd2982a0e2af8d0506271b439af4b568fc33fdc'/>
<id>urn:sha1:bcd2982a0e2af8d0506271b439af4b568fc33fdc</id>
<content type='text'>
CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton &lt;wfp5p@virginia.edu&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Matt Mackall &lt;mpm@selenic.com&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux</title>
<updated>2012-12-20T16:37:05Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2012-12-20T16:37:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b7dfde956daee23f4439d0c8562a5e38b43e79d9'/>
<id>urn:sha1:b7dfde956daee23f4439d0c8562a5e38b43e79d9</id>
<content type='text'>
Pull virtio update from Rusty Russell:
 "Some nice cleanups, and even a patch my wife did as a "live" demo for
  Latinoware 2012.

  There's a slightly non-trivial merge in virtio-net, as we cleaned up
  the virtio add_buf interface while DaveM accepted the mq virtio-net
  patches."

* tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (27 commits)
  virtio_console: Add support for remoteproc serial
  virtio_console: Merge struct buffer_token into struct port_buffer
  virtio: add drv_to_virtio to make code clearly
  virtio: use dev_to_virtio wrapper in virtio
  virtio-mmio: Fix irq parsing in command line parameter
  virtio_console: Free buffers from out-queue upon close
  virtio: Convert dev_printk(KERN_&lt;LEVEL&gt; to dev_&lt;level&gt;(
  virtio_console: Use kmalloc instead of kzalloc
  virtio_console: Free buffer if splice fails
  virtio: tools: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: scsi: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: rpmsg: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: net: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: console: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: make virtqueue_add_buf() returning 0 on success, not capacity.
  virtio: console: don't rely on virtqueue_add_buf() returning capacity.
  virtio_net: don't rely on virtqueue_add_buf() returning capacity.
  virtio-net: remove unused skb_vnet_hdr-&gt;num_sg field
  virtio-net: correct capacity math on ring full
  virtio: move queue_index and num_free fields into core struct virtqueue.
  ...
</content>
</entry>
<entry>
<title>virtio_console: Add support for remoteproc serial</title>
<updated>2012-12-18T04:50:44Z</updated>
<author>
<name>Sjur Brændeland</name>
</author>
<published>2012-12-14T04:10:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1b6370463e88b0c1c317de16d7b962acc1dab4f2'/>
<id>urn:sha1:1b6370463e88b0c1c317de16d7b962acc1dab4f2</id>
<content type='text'>
Add a simple serial connection driver called
VIRTIO_ID_RPROC_SERIAL (11) for communicating with a
remote processor in an asymmetric multi-processing
configuration.

This implementation reuses the existing virtio_console
implementation, and adds support for DMA allocation
of data buffers and disables use of tty console and
the virtio control queue.

Signed-off-by: Sjur Brændeland &lt;sjur.brandeland@stericsson.com&gt;
Acked-by: Amit Shah &lt;amit.shah@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>virtio_console: Merge struct buffer_token into struct port_buffer</title>
<updated>2012-12-18T04:50:44Z</updated>
<author>
<name>Sjur Brændeland</name>
</author>
<published>2012-12-14T03:16:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=276a3e954cfe4da7c492c9063741f99290d2973e'/>
<id>urn:sha1:276a3e954cfe4da7c492c9063741f99290d2973e</id>
<content type='text'>
Refactoring the splice functionality by unifying the approach for
sending scatter-lists and regular buffers. This simplifies
buffer handling and reduces code size. Splice will now allocate
a port_buffer and send_buf() and free_buf() can always be used
for any buffer.

Signed-off-by: Sjur Brændeland &lt;sjur.brandeland@stericsson.com&gt;
Acked-by: Amit Shah &lt;amit.shah@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>virtio_console: Free buffers from out-queue upon close</title>
<updated>2012-12-18T04:50:41Z</updated>
<author>
<name>sjur.brandeland@stericsson.com</name>
</author>
<published>2012-11-16T00:50:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb34f12b509823571e88b791ae2088280943894f'/>
<id>urn:sha1:eb34f12b509823571e88b791ae2088280943894f</id>
<content type='text'>
Free pending output buffers from the virtio out-queue when
host has acknowledged port_close.

Signed-off-by: Sjur Brændeland &lt;sjur.brandeland@stericsson.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt; (rebased &amp; cut down)
</content>
</entry>
<entry>
<title>virtio_console: Use kmalloc instead of kzalloc</title>
<updated>2012-12-18T04:50:39Z</updated>
<author>
<name>Sjur Brændeland</name>
</author>
<published>2012-10-15T07:57:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0127f6855e643c6b8fd5fbe3b5fa23c9d26cd237'/>
<id>urn:sha1:0127f6855e643c6b8fd5fbe3b5fa23c9d26cd237</id>
<content type='text'>
Avoid the more cpu expensive kzalloc when allocating buffers.
Originally kzalloc was intended for isolating the guest from
the host by not sending random guest data to the host. But device
isolation is not yet in place so kzalloc is not really needed.

Signed-off-by: Sjur Brændeland &lt;sjur.brandeland@stericsson.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>virtio_console: Free buffer if splice fails</title>
<updated>2012-12-18T04:50:39Z</updated>
<author>
<name>Sjur Brændeland</name>
</author>
<published>2012-10-15T07:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe5295374ec9ac56ba3b619c5c1792b3fd66d859'/>
<id>urn:sha1:fe5295374ec9ac56ba3b619c5c1792b3fd66d859</id>
<content type='text'>
Free the allocated scatter list if send_pages fails in function
port_splice_write.

Signed-off-by: Sjur Brændeland &lt;sjur.brandeland@stericsson.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
</feed>
