<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/virtio, branch v4.11</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=v4.11</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.11'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2017-04-10T21:30:20Z</updated>
<entry>
<title>virtio-pci: Remove affinity hint before freeing the interrupt</title>
<updated>2017-04-10T21:30:20Z</updated>
<author>
<name>Marc Zyngier</name>
<email>marc.zyngier@arm.com</email>
</author>
<published>2017-03-08T08:09:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2f8dc3a01f1cf8ed17b1e295812ad12b688be5d3'/>
<id>urn:sha1:2f8dc3a01f1cf8ed17b1e295812ad12b688be5d3</id>
<content type='text'>
virtio-pci registers a per-vq affinity hint when using MSIX,
but fails to remove it when freeing the interrupt, resulting
in this type of splat:

[   31.111202] WARNING: CPU: 0 PID: 2823 at kernel/irq/manage.c:1503 __free_irq+0x2c4/0x2c8
[   31.114689] Modules linked in:
[   31.116101] CPU: 0 PID: 2823 Comm: kexec Not tainted 4.10.0+ #6941
[   31.118911] Hardware name: Generic DT based system
[   31.121319] [&lt;c022fb78&gt;] (unwind_backtrace) from [&lt;c0229d8c&gt;] (show_stack+0x18/0x1c)
[   31.125017] [&lt;c0229d8c&gt;] (show_stack) from [&lt;c05192f4&gt;] (dump_stack+0x84/0x98)
[   31.128427] [&lt;c05192f4&gt;] (dump_stack) from [&lt;c023d940&gt;] (__warn+0xf4/0x10c)
[   31.131910] [&lt;c023d940&gt;] (__warn) from [&lt;c023da20&gt;] (warn_slowpath_null+0x28/0x30)
[   31.135543] [&lt;c023da20&gt;] (warn_slowpath_null) from [&lt;c0290238&gt;] (__free_irq+0x2c4/0x2c8)
[   31.139355] [&lt;c0290238&gt;] (__free_irq) from [&lt;c02902d0&gt;] (free_irq+0x44/0x78)
[   31.142909] [&lt;c02902d0&gt;] (free_irq) from [&lt;c059d3a8&gt;] (vp_del_vqs+0x68/0x1c0)
[   31.146299] [&lt;c059d3a8&gt;] (vp_del_vqs) from [&lt;c056ca4c&gt;] (pci_device_shutdown+0x3c/0x78)

The obvious fix is to drop the affinity hint before freeing the
interrupt.

Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>Revert "virtio_pci: remove struct virtio_pci_vq_info"</title>
<updated>2017-04-10T21:29:59Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2017-04-04T18:44:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0a9b3f47da5b8a2c4bf4f2f2199761f49ac0a54e'/>
<id>urn:sha1:0a9b3f47da5b8a2c4bf4f2f2199761f49ac0a54e</id>
<content type='text'>
This reverts commit 5c34d002dcc7a6dd665a19d098b4f4cd5501ba1a.

Conflicts:
	drivers/virtio/virtio_pci_common.c

The cleanup seems to be one of the changes that broke
hybernation for some users. We are still not sure why
but revert helps.

This reverts the cleanup changes but keeps the affinity support.

Tested-by: Mike Galbraith &lt;efault@gmx.de&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>Revert "virtio_pci: use shared interrupts for virtqueues"</title>
<updated>2017-04-10T21:28:57Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2017-04-04T18:15:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0b0f9dc52ed0333fa52a9314b53d0b2b248b821d'/>
<id>urn:sha1:0b0f9dc52ed0333fa52a9314b53d0b2b248b821d</id>
<content type='text'>
This reverts commit 07ec51480b5eb1233f8c1b0f5d7a7c8d1247c507.

Conflicts:
	drivers/virtio/virtio_pci_common.c

Unfortunately the idea does not work with threadirqs
as more than 32 queues can then map to a single interrupts.

Further, the cleanup seems to be one of the changes that broke
hybernation for some users. We are still not sure why
but revert helps.

This reverts the cleanup changes but keeps the affinity support.

Tested-by: Mike Galbraith &lt;efault@gmx.de&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>Revert "virtio_pci: don't duplicate the msix_enable flag in struct pci_dev"</title>
<updated>2017-04-10T21:28:41Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2017-04-04T18:09:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2008c1544c73d5190f81ef1790fa5bd2fade5bd0'/>
<id>urn:sha1:2008c1544c73d5190f81ef1790fa5bd2fade5bd0</id>
<content type='text'>
This reverts commit 53a020c661741f3b87ad3ac6fa545088aaebac9b.

The cleanup seems to be one of the changes that broke
hybernation for some users. We are still not sure why
but revert helps.

Tested-by: Mike Galbraith &lt;efault@gmx.de&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>Revert "virtio_pci: simplify MSI-X setup"</title>
<updated>2017-04-10T21:19:40Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2017-04-04T18:08:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bf951b1045cc5d694b5e767c4f4d05df4f2cbe89'/>
<id>urn:sha1:bf951b1045cc5d694b5e767c4f4d05df4f2cbe89</id>
<content type='text'>
This reverts commit 52a61516125fa9a21b3bdf4f90928308e2e5573f.

Conflicts:
	drivers/virtio/virtio_pci_common.c

The cleanup seems to be one of the changes that broke
hybernation for some users. We are still not sure why
but revert helps.

This reverts the cleanup changes but keeps the affinity support.

Tested-by: Mike Galbraith &lt;efault@gmx.de&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>Revert "virtio_pci: fix out of bound access for msix_names"</title>
<updated>2017-04-10T20:27:50Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2017-04-04T18:04:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8f10d0149fb983aa84a02a92f9c2113d69e23cb8'/>
<id>urn:sha1:8f10d0149fb983aa84a02a92f9c2113d69e23cb8</id>
<content type='text'>
This reverts commit de85ec8b07f82c8c84de7687f769e74bf4c26a1e.

Follow-up patches will revert 07ec51480b5e ("virtio_pci: use shared
interrupts for virtqueues") that triggered the problem so no need for
this one anymore.

Tested-by: Mike Galbraith &lt;efault@gmx.de&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio: allow drivers to validate features</title>
<updated>2017-04-07T13:38:59Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2017-03-29T16:06:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=404123c2db798027e852480ed9c4accef9f1d9e6'/>
<id>urn:sha1:404123c2db798027e852480ed9c4accef9f1d9e6</id>
<content type='text'>
Some drivers can't support all features in all configurations.  At the
moment we blindly set FEATURES_OK and later FAILED.  Support this better
by adding a callback drivers can use to do some early checks.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_balloon: prevent uninitialized variable use</title>
<updated>2017-03-28T17:41:28Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2017-03-28T16:46:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f0bb2d50dfcc519f06f901aac88502be6ff1df2c'/>
<id>urn:sha1:f0bb2d50dfcc519f06f901aac88502be6ff1df2c</id>
<content type='text'>
The latest gcc-7.0.1 snapshot reports a new warning:

virtio/virtio_balloon.c: In function 'update_balloon_stats':
virtio/virtio_balloon.c:258:26: error: 'events[2]' is used uninitialized in this function [-Werror=uninitialized]
virtio/virtio_balloon.c:260:26: error: 'events[3]' is used uninitialized in this function [-Werror=uninitialized]
virtio/virtio_balloon.c:261:56: error: 'events[18]' is used uninitialized in this function [-Werror=uninitialized]
virtio/virtio_balloon.c:262:56: error: 'events[17]' is used uninitialized in this function [-Werror=uninitialized]

This seems absolutely right, so we should add an extra check to
prevent copying uninitialized stack data into the statistics.
&gt;From all I can tell, this has been broken since the statistics code
was originally added in 2.6.34.

Fixes: 9564e138b1f6 ("virtio: Add memory statistics reporting to the balloon driver (V4)")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ladi Prosek &lt;lprosek@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio-balloon: use actual number of stats for stats queue buffers</title>
<updated>2017-03-28T17:41:28Z</updated>
<author>
<name>Ladi Prosek</name>
<email>lprosek@redhat.com</email>
</author>
<published>2017-03-28T16:46:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9646b26e85896ef0256e66649f7937f774dc18a6'/>
<id>urn:sha1:9646b26e85896ef0256e66649f7937f774dc18a6</id>
<content type='text'>
The virtio balloon driver contained a not-so-obvious invariant that
update_balloon_stats has to update exactly VIRTIO_BALLOON_S_NR counters
in order to send valid stats to the host. This commit fixes it by having
update_balloon_stats return the actual number of counters, and its
callers use it when pushing buffers to the stats virtqueue.

Note that it is still out of spec to change the number of counters
at run-time. "Driver MUST supply the same subset of statistics in all
buffers submitted to the statsq."

Suggested-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ladi Prosek &lt;lprosek@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_balloon: init 1st buffer in stats vq</title>
<updated>2017-03-28T17:41:27Z</updated>
<author>
<name>Ladi Prosek</name>
<email>lprosek@redhat.com</email>
</author>
<published>2017-03-23T07:04:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fc8653228c8588a120f6b5dad6983b7b61ff669e'/>
<id>urn:sha1:fc8653228c8588a120f6b5dad6983b7b61ff669e</id>
<content type='text'>
When init_vqs runs, virtio_balloon.stats is either uninitialized or
contains stale values. The host updates its state with garbage data
because it has no way of knowing that this is just a marker buffer
used for signaling.

This patch updates the stats before pushing the initial buffer.

Alternative fixes:
* Push an empty buffer in init_vqs. Not easily done with the current
  virtio implementation and violates the spec "Driver MUST supply the
  same subset of statistics in all buffers submitted to the statsq".
* Push a buffer with invalid tags in init_vqs. Violates the same
  spec clause, plus "invalid tag" is not really defined.

Note: the spec says:
	When using the legacy interface, the device SHOULD ignore all values in
	the first buffer in the statsq supplied by the driver after device
	initialization. Note: Historically, drivers supplied an uninitialized
	buffer in the first buffer.

Unfortunately QEMU does not seem to implement the recommendation
even for the legacy interface.

Cc: stable@vger.kernel.org
Signed-off-by: Ladi Prosek &lt;lprosek@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
</feed>
