<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/virtio, branch v3.7</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/virtio?h=v3.7</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/virtio?h=v3.7'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-11-09T04:24:24Z</updated>
<entry>
<title>virtio: Don't access index after unregister.</title>
<updated>2012-11-09T04:24:24Z</updated>
<author>
<name>Cornelia Huck</name>
<email>cornelia.huck@de.ibm.com</email>
</author>
<published>2012-11-09T04:24:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=237242bddc99041e15a4ca51b8439657cadaff17'/>
<id>urn:sha1:237242bddc99041e15a4ca51b8439657cadaff17</id>
<content type='text'>
Virtio wants to release used indices after the corresponding
virtio device has been unregistered. However, virtio does not
hold an extra reference, giving up its last reference with
device_unregister(), making accessing dev-&gt;index afterwards
invalid.

I actually saw problems when testing my (not-yet-merged)
virtio-ccw code:

- device_add virtio-net,id=xxx
-&gt; creates device virtio&lt;n&gt; with n&gt;0

- device_del xxx
-&gt; deletes virtio&lt;n&gt;, but calls ida_simple_remove with an
   index of 0

- device_add virtio-net,id=xxx
-&gt; tries to add virtio0, which is still in use...

So let's save the index we want to release before calling
device_unregister().

Signed-off-by: Cornelia Huck &lt;cornelia.huck@de.ibm.com&gt;
Acked-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>virtio_mmio: Don't attempt to create empty virtqueues</title>
<updated>2012-09-28T05:35:16Z</updated>
<author>
<name>Brian Foley</name>
<email>brian.foley@arm.com</email>
</author>
<published>2012-09-24T13:33:42Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d78b519f6b945aef6202bbb5b56f928572e15165'/>
<id>urn:sha1:d78b519f6b945aef6202bbb5b56f928572e15165</id>
<content type='text'>
If a virtio device reports a QueueNumMax of 0, vring_new_virtqueue()
doesn't check this, and thanks to an unsigned (i &lt; num - 1) loop
guard, scribbles over memory when initialising the free list.

Avoid by not trying to create zero-descriptor queues, as there's no
way to do any I/O with one.

Signed-off-by: Brian Foley &lt;brian.foley@arm.com&gt;
Signed-off-by: Pawel Moll &lt;pawel.moll@arm.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>virtio_mmio: fix off by one error allocating queue</title>
<updated>2012-09-28T05:35:16Z</updated>
<author>
<name>Brian Foley</name>
<email>brian.foley@arm.com</email>
</author>
<published>2012-09-24T13:33:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3850d29fc40f3494a3e9c3aac45b6afe53526449'/>
<id>urn:sha1:3850d29fc40f3494a3e9c3aac45b6afe53526449</id>
<content type='text'>
vm_setup_vq fails to allow VirtQueues needing only 2 pages of
storage, as it should. Found with a kernel using 64kB pages, but
can be provoked if a virtio device reports QueueNumMax where the
descriptor table and available ring fit in one page, and the used
ring on the second (&lt;= 227 descriptors with 4kB pages and &lt;= 3640
with 64kB pages.)

Signed-off-by: Brian Foley &lt;brian.foley@arm.com&gt;
Signed-off-by: Pawel Moll &lt;pawel.moll@arm.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>drivers/virtio/virtio_pci.c: fix error return code</title>
<updated>2012-09-28T05:35:16Z</updated>
<author>
<name>Peter Senna Tschudin</name>
<email>peter.senna@gmail.com</email>
</author>
<published>2012-09-17T17:31:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=74a74b376c997645b32a4fdf8e76705a00ae097a'/>
<id>urn:sha1:74a74b376c997645b32a4fdf8e76705a00ae097a</id>
<content type='text'>
Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
(
if@p1 (\(ret &lt; 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &amp;ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// &lt;/smpl&gt;

Signed-off-by: Peter Senna Tschudin &lt;peter.senna@gmail.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>virtio: don't crash when device is buggy</title>
<updated>2012-09-28T05:35:16Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2012-09-28T05:35:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5543a6ac31eb4bfd8d938db6b234ce833d14e04e'/>
<id>urn:sha1:5543a6ac31eb4bfd8d938db6b234ce833d14e04e</id>
<content type='text'>
Because of a sanity check in virtio_dev_remove, a buggy device can crash
kernel.  And in case of rproc it's userspace so it's not a good idea.
We are unloading a driver so how bad can it be?
Be less aggressive in handling this error: if it's a driver bug,
warning once should be enough.

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: remove CONFIG_VIRTIO_RING</title>
<updated>2012-09-28T05:35:15Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2012-09-28T05:35:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=eccbb05a64fef867362ff05b5d266757e3c82b36'/>
<id>urn:sha1:eccbb05a64fef867362ff05b5d266757e3c82b36</id>
<content type='text'>
Everyone who selects VIRTIO is also made to select VIRTIO_RING; just make
them synonymous, since we removed the indirection layer some time ago.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>virtio: add help to CONFIG_VIRTIO option.</title>
<updated>2012-09-28T05:35:15Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2012-09-28T05:35:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=387daf1716da579fc1d198414d890967cd624a5b'/>
<id>urn:sha1:387daf1716da579fc1d198414d890967cd624a5b</id>
<content type='text'>
Trying to enable a virtio driver (eg CONFIG_VIRTIO_BLK) is painful
because it depends on CONFIG_VIRTIO.  CONFIG_VIRTIO doesn't tell you
how to turn it on (it's selected from anything which provides a virtio
bus).

This patch at least adds some documentation, visible in menuconfig, as
a hint.

Reported-by: Kent Overstreet &lt;koverstreet@google.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>virtio: support reserved vqs</title>
<updated>2012-09-28T05:35:15Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2012-09-05T18:47:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6457f126c888b3481fdae6f702e616cd0c79646e'/>
<id>urn:sha1:6457f126c888b3481fdae6f702e616cd0c79646e</id>
<content type='text'>
virtio network device multiqueue support reserves
vq 3 for future use (useful both for future extensions and to make it
pretty - this way receive vqs have even and transmit - odd numbers).
Make it possible to skip initialization for
specific vq numbers by specifying NULL for name.
Document this usage as well as (existing) NULL callback.

Drivers using this not coded up yet, so I simply tested
with virtio-pci and verified that this patch does
not break existing drivers.

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: introduce an API to set affinity for a virtqueue</title>
<updated>2012-09-28T05:35:15Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2012-08-28T11:54:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=75a0a52be3c27b58654fbed2c8f2ff401482b9a4'/>
<id>urn:sha1:75a0a52be3c27b58654fbed2c8f2ff401482b9a4</id>
<content type='text'>
Sometimes, virtio device need to configure irq affinity hint to maximize the
performance. Instead of just exposing the irq of a virtqueue, this patch
introduce an API to set the affinity for a virtqueue.

The api is best-effort, the affinity hint may not be set as expected due to
platform support, irq sharing or irq type. Currently, only pci method were
implemented and we set the affinity according to:

- if device uses INTX, we just ignore the request
- if device has per vq vector, we force the affinity hint
- if the virtqueues share MSI, make the affinity OR over all affinities
  requested

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>virtio-ring: move queue_index to vring_virtqueue</title>
<updated>2012-09-28T05:35:15Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2012-08-28T11:54:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=17bb6d40880d4178f5f8a75900ed8c9ff47d3fb2'/>
<id>urn:sha1:17bb6d40880d4178f5f8a75900ed8c9ff47d3fb2</id>
<content type='text'>
Instead of storing the queue index in transport-specific virtio structs,
this patch moves them to vring_virtqueue and introduces an helper to get
the value.  This lets drivers simplify their management and tracing of
virtqueues.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
</feed>
