<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/virtio, branch v2.6.34</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=v2.6.34</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.34'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2010-04-22T14:34:05Z</updated>
<entry>
<title>virtio: Fix GFP flags passed from the virtio balloon driver</title>
<updated>2010-04-22T14:34:05Z</updated>
<author>
<name>Balbir Singh</name>
<email>balbir@linux.vnet.ibm.com</email>
</author>
<published>2010-04-22T02:52:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=61fb06cc8e68906fb29d67bd5b6c2d50a95fc9e5'/>
<id>urn:sha1:61fb06cc8e68906fb29d67bd5b6c2d50a95fc9e5</id>
<content type='text'>
The virtio balloon driver can dig into the reservation pools of the OS
to satisfy a balloon request.  This is not advisable and other balloon
drivers (drivers/xen/balloon.c) avoid this as well.

The patch also adds changes to avoid printing a warning if allocation
fails, since we retry after sometime anyway.

Signed-off-by: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: kvm &lt;kvm@vger.kernel.org&gt;
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h</title>
<updated>2010-03-30T13:02:32Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-03-24T08:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5a0e3ad6af8660be21ca98a971cd00f331318c05'/>
<id>urn:sha1:5a0e3ad6af8660be21ca98a971cd00f331318c05</id>
<content type='text'>
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -&gt; slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Guess-its-ok-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Lee Schermerhorn &lt;Lee.Schermerhorn@hp.com&gt;
</content>
</entry>
<entry>
<title>virtio: set pci bus master enable bit</title>
<updated>2010-03-02T11:41:14Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2009-11-29T15:52:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bc505f373979692d51a86d40925f77a8b09d17b9'/>
<id>urn:sha1:bc505f373979692d51a86d40925f77a8b09d17b9</id>
<content type='text'>
As all virtio devices perform DMA, we
must enable bus mastering for them to be
spec compliant.

This patch fixes hotplug of virtio devices
with Linux guests and qemu 0.11-0.12.

Tested-by: Alexander Graf &lt;agraf@suse.de&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio: fix out of range array access</title>
<updated>2010-02-28T18:39:11Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2010-02-25T17:08:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3119815912a220bdac943dfbdfee640414c0c611'/>
<id>urn:sha1:3119815912a220bdac943dfbdfee640414c0c611</id>
<content type='text'>
I have observed the following error on virtio-net module unload:

------------[ cut here ]------------
WARNING: at kernel/irq/manage.c:858 __free_irq+0xa0/0x14c()
Hardware name: Bochs
Trying to free already-free IRQ 0
Modules linked in: virtio_net(-) virtio_blk virtio_pci virtio_ring
virtio af_packet e1000 shpchp aacraid uhci_hcd ohci_hcd ehci_hcd [last
unloaded: scsi_wait_scan]
Pid: 1957, comm: rmmod Not tainted 2.6.33-rc8-vhost #24
Call Trace:
 [&lt;ffffffff8103e195&gt;] warn_slowpath_common+0x7c/0x94
 [&lt;ffffffff8103e204&gt;] warn_slowpath_fmt+0x41/0x43
 [&lt;ffffffff810a7a36&gt;] ? __free_pages+0x5a/0x70
 [&lt;ffffffff8107cc00&gt;] __free_irq+0xa0/0x14c
 [&lt;ffffffff8107cceb&gt;] free_irq+0x3f/0x65
 [&lt;ffffffffa0081424&gt;] vp_del_vqs+0x81/0xb1 [virtio_pci]
 [&lt;ffffffffa0091d29&gt;] virtnet_remove+0xda/0x10b [virtio_net]
 [&lt;ffffffffa0075200&gt;] virtio_dev_remove+0x22/0x4a [virtio]
 [&lt;ffffffff812709ee&gt;] __device_release_driver+0x66/0xac
 [&lt;ffffffff81270ab7&gt;] driver_detach+0x83/0xa9
 [&lt;ffffffff8126fc66&gt;] bus_remove_driver+0x91/0xb4
 [&lt;ffffffff81270fcf&gt;] driver_unregister+0x6c/0x74
 [&lt;ffffffffa0075418&gt;] unregister_virtio_driver+0xe/0x10 [virtio]
 [&lt;ffffffffa0091c4d&gt;] fini+0x15/0x17 [virtio_net]
 [&lt;ffffffff8106997b&gt;] sys_delete_module+0x1c3/0x230
 [&lt;ffffffff81007465&gt;] ? old_ich_force_enable_hpet+0x117/0x164
 [&lt;ffffffff813bb720&gt;] ? do_page_fault+0x29c/0x2cc
 [&lt;ffffffff81028e58&gt;] sysenter_dispatch+0x7/0x27
---[ end trace 15e88e4c576cc62b ]---

The bug is in virtio-pci: we use msix_vector as array index to get irq
entry, but some vqs do not have a dedicated vector so this causes an out
of bounds access.  By chance, we seem to often get 0 value, which
results in this error.

Fix by verifying that vector is legal before using it as index.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Anthony Liguori &lt;aliguori@us.ibm.com&gt;
Acked-by: Shirley Ma &lt;xma@us.ibm.com&gt;
Acked-by: Amit Shah &lt;amit.shah@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio: Initialize vq-&gt;data entries to NULL</title>
<updated>2010-02-24T03:52:29Z</updated>
<author>
<name>Amit Shah</name>
<email>amit.shah@redhat.com</email>
</author>
<published>2010-02-12T05:02:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3b8706240ee6084ccb46e53cd3a554356b7eeec8'/>
<id>urn:sha1:3b8706240ee6084ccb46e53cd3a554356b7eeec8</id>
<content type='text'>
vq operations depend on vq-&gt;data[i] being NULL to figure out if the vq
entry is in use (since the previous patch).

We have to initialize them to NULL to ensure we don't work with junk
data and trigger false BUG_ONs.

Signed-off-by: Amit Shah &lt;amit.shah@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Shirley Ma &lt;xma@us.ibm.com&gt;
</content>
</entry>
<entry>
<title>virtio: Add ability to detach unused buffers from vrings</title>
<updated>2010-02-24T03:52:27Z</updated>
<author>
<name>Shirley Ma</name>
<email>mashirle@us.ibm.com</email>
</author>
<published>2010-01-18T13:45:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c021eac4148c16bf53baa0dd14e8ebee6f39dab5'/>
<id>urn:sha1:c021eac4148c16bf53baa0dd14e8ebee6f39dab5</id>
<content type='text'>
There's currently no way for a virtio driver to ask for unused
buffers, so it has to keep a list itself to reclaim them at shutdown.
This is redundant, since virtio_ring stores that information.  So
add a new hook to do this.

Signed-off-by: Shirley Ma &lt;xma@us.ibm.com&gt;
Signed-off-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: use smp_XX barriers on SMP</title>
<updated>2010-02-24T03:52:25Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2010-01-27T22:42:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d57ed95da483418e8b0433da693c9168dd0a2df6'/>
<id>urn:sha1:d57ed95da483418e8b0433da693c9168dd0a2df6</id>
<content type='text'>
virtio is communicating with a virtual "device" that actually runs on
another host processor. Thus SMP barriers can be used to control
memory access ordering.

Where possible, we should use SMP barriers which are more lightweight than
mandatory barriers, because mandatory barriers also control MMIO effects on
accesses through relaxed memory I/O windows (which virtio does not use)
(compare specifically smp_rmb and rmb on x86_64).

We can't just use smp_mb and friends though, because
we must force memory ordering even if guest is UP since host could be
running on another CPU, but SMP barriers are defined to barrier() in
that configuration. So, for UP fall back to mandatory barriers instead.

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 bogus barriers from DEBUG version of virtio_ring.c</title>
<updated>2010-02-24T03:52:24Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2010-02-24T20:22:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=97a545ab6ce922a0f868d192718a48a0091ebc5e'/>
<id>urn:sha1:97a545ab6ce922a0f868d192718a48a0091ebc5e</id>
<content type='text'>
With DEBUG defined, we add an -&gt;in_use flag to detect if the caller
invokes two virtio methods in parallel.  The barriers attempt to ensure
timely update of the -&gt;in_use flag.

But they're voodoo: if we need these barriers it implies that the
calling code doesn't have sufficient synchronization to ensure the
code paths aren't invoked at the same time anyway, and we want to
detect it.

Also, adding barriers changes timing, so turning on debug has more
chance of hiding real problems.

Thanks to MST for drawing my attention to this code...

CC: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>virtio: fix balloon without VIRTIO_BALLOON_F_STATS_VQ</title>
<updated>2010-02-24T03:52:17Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2010-02-24T20:22:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=169c246a30808588436794e96a97c61a01af9bed'/>
<id>urn:sha1:169c246a30808588436794e96a97c61a01af9bed</id>
<content type='text'>
When running under qemu-kvm-0.11.0:

	BUG: unable to handle kernel paging request at 56e58955
	...
	Process vballoon (pid: 1297, ti=c7976000 task=c70a6ca0 task.ti=c7
	...
	Call Trace:
	 [&lt;c88253a3&gt;] ? balloon+0x1b3/0x440 [virtio_balloon]
	 [&lt;c041c2d7&gt;] ? schedule+0x327/0x9d0
	 [&lt;c88251f0&gt;] ? balloon+0x0/0x440 [virtio_balloon]
	 [&lt;c014a2d4&gt;] ? kthread+0x74/0x80
	 [&lt;c014a260&gt;] ? kthread+0x0/0x80
	 [&lt;c0103b36&gt;] ? kernel_thread_helper+0x6/0x30

need_stats_update should be zero-initialized.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Acked-by: Adam Litke &lt;agl@us.ibm.com&gt;
</content>
</entry>
<entry>
<title>virtio: Fix scheduling while atomic in virtio_balloon stats</title>
<updated>2010-02-24T03:52:14Z</updated>
<author>
<name>Adam Litke</name>
<email>agl@us.ibm.com</email>
</author>
<published>2009-12-10T22:35:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1f34c71afe5115e77a49c4e67720a66e27053e54'/>
<id>urn:sha1:1f34c71afe5115e77a49c4e67720a66e27053e54</id>
<content type='text'>
This is a fix for my earlier patch: "virtio: Add memory statistics reporting to
the balloon driver (V4)".

I discovered that all_vm_events() can sleep and therefore stats collection
cannot be done in interrupt context.  One solution is to handle the interrupt
by noting that stats need to be collected and waking the existing vballoon
kthread which will complete the work via stats_handle_request().  Rusty, is
this a saner way of doing business?

There is one issue that I would like a broader opinion on.  In stats_request, I
update vb-&gt;need_stats_update and then wake up the kthread.  The kthread uses
vb-&gt;need_stats_update as a condition variable.  Do I need a memory barrier
between the update and wake_up to ensure that my kthread sees the correct
value?  My testing suggests that it is not needed but I would like some
confirmation from the experts.

Signed-off-by: Adam Litke &lt;agl@us.ibm.com&gt;
To: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Anthony Liguori &lt;aliguori@linux.vnet.ibm.com&gt;
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
</feed>
