<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/next/linux-next.git/drivers/virtio, branch stable</title>
<subtitle>The linux-next integration testing tree</subtitle>
<id>https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/atom?h=stable</id>
<link rel='self' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/atom?h=stable'/>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/'/>
<updated>2026-09-07T22:54:04+00:00</updated>
<entry>
<title>virtio_input: stop callbacks before unregistering input device</title>
<updated>2026-09-07T22:54:04+00:00</updated>
<author>
<name>Karl Mehltretter</name>
<email>kmehltretter@gmail.com</email>
</author>
<published>2026-09-05T15:20:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d7808b37da0a619cf1fa541c2384e783fecc2480'/>
<id>urn:sha1:d7808b37da0a619cf1fa541c2384e783fecc2480</id>
<content type='text'>
virtinput_remove() unregisters the input device before resetting the
virtio device. virtinput_recv_events() drops vi-&gt;lock around input_event(),
so clearing vi-&gt;ready does not stop a callback that passed the entry check.
It can still use vi-&gt;idev, requeue buffers and kick the queue.

Reset first, as virtinput_freeze() already does. With the preceding core
change, reset waits for callbacks before input_unregister_device() can
free vi-&gt;idev. Recheck vi-&gt;ready after taking the lock again: keep draining
completed events so an input packet is not truncated, but stop requeueing
buffers and kicking the queue.

With evdev attached, input_unregister_handle() currently waits for an RCU
grace period, which also waits out IRQ callbacks. This masks the lifetime
bug on PCI and MMIO, but does not protect sleepable callbacks on other
transports.

Fixes: 271c865161c5 ("Add virtio-input driver.")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter &lt;kmehltretter@gmail.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Message-ID: &lt;20260905152059.89560-3-kmehltretter@gmail.com&gt;
</content>
</entry>
<entry>
<title>virtio_input: reset device if input_register_device() fails</title>
<updated>2026-09-07T22:54:04+00:00</updated>
<author>
<name>Xiong Weimin</name>
<email>xiongweimin@kylinos.cn</email>
</author>
<published>2026-08-05T03:29:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=81489b32a21c9360f8750d1fb600155d27452e19'/>
<id>urn:sha1:81489b32a21c9360f8750d1fb600155d27452e19</id>
<content type='text'>
Probe marks the device DRIVER_OK with virtio_device_ready() before
calling input_register_device(). If registration fails, the error path
cleared vi-&gt;ready and called del_vqs() while the device was still live,
so the device could keep DMA to queues that were already torn down.

Match remove/freeze: call virtio_reset_device() on that path before
tearing down the virtqueues.

Fixes: 271c865161c5 ("Add virtio-input driver.")
Signed-off-by: Xiong Weimin &lt;xiongweimin@kylinos.cn&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Message-ID: &lt;20260805032931.1606652-1-xiongweimin@kylinos.cn&gt;
</content>
</entry>
<entry>
<title>virtio-pci: return IRQ_HANDLED after non-zero ISR</title>
<updated>2026-09-07T22:54:03+00:00</updated>
<author>
<name>Andrew Stellman</name>
<email>astellman@stellman-greene.com</email>
</author>
<published>2026-09-04T14:13:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=93fa09455fb1a9624b73d42ac1f83771f4818e80'/>
<id>urn:sha1:93fa09455fb1a9624b73d42ac1f83771f4818e80</id>
<content type='text'>
vp_interrupt() reads the ISR before dispatching config-change and
vring handling. Reading the ISR also clears it, so once the read
returns non-zero the interrupt was from this device and has already
been consumed.

Currently vp_interrupt() returns the result of vp_vring_interrupt().
For a config-change interrupt with no vring work, that can return
IRQ_NONE even though the ISR was non-zero and the interrupt was
handled.

Call vp_vring_interrupt() for any queue work, but once the ISR is
non-zero return IRQ_HANDLED.

Tested with QEMU virtio-blk-pci forced to INTx using vectors=0 and
pci=nomsi. On an idle device, 200 config-change interrupts were
generated using QMP block_resize.

Before this change, irq_handler_exit reported ret=unhandled and
/proc/irq/11/spurious increased from 0 to 200 unhandled interrupts.
After this change, irq_handler_exit reported ret=handled and the
unhandled count remained at 0.

The issue was found during an LLM-assisted Quality Playbook review.

Fixes: 77cf524654a8 ("virtio_pci: split up vp_interrupt")
Suggested-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Assisted-by: LLM
Signed-off-by: Andrew Stellman &lt;astellman@stellman-greene.com&gt;
Message-ID: &lt;20260904141318.30278-1-astellman@stellman-greene.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio-vdpa: Use queue id when setting vq affinity</title>
<updated>2026-09-07T22:54:03+00:00</updated>
<author>
<name>Xiong Weimin</name>
<email>xiongweimin@kylinos.cn</email>
</author>
<published>2026-08-04T09:26:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ca2c2165a02e499b591a367224346a7e52664d9c'/>
<id>urn:sha1:ca2c2165a02e499b591a367224346a7e52664d9c</id>
<content type='text'>
When optional queues are skipped, pass the compressed vDPA queue id to
set_vq_affinity() so affinity is applied to the queue that was actually
created.

Signed-off-by: Xiong Weimin &lt;xiongweimin@kylinos.cn&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Message-ID: &lt;20260804092649.1344478-1-xiongweimin@kylinos.cn&gt;
</content>
</entry>
<entry>
<title>virtio_mmio: disable IRQ wake before free_irq</title>
<updated>2026-09-07T22:54:02+00:00</updated>
<author>
<name>Xiong Weimin</name>
<email>xiongweimin@kylinos.cn</email>
</author>
<published>2026-08-05T03:29:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d14d693adb055e98ca705822ba6daebc18602d9a'/>
<id>urn:sha1:d14d693adb055e98ca705822ba6daebc18602d9a</id>
<content type='text'>
When the DT node has "wakeup-source", vm_find_vqs() calls
enable_irq_wake() on the shared IRQ, but vm_del_vqs() freed that IRQ
without a matching disable_irq_wake(). That leaves a wake reference
behind and can warn on later free_irq()/request_irq() cycles.

Record whether enable_irq_wake() succeeded, and disable it in
vm_del_vqs() before free_irq().

Fixes: 02213273f72a ("virtio_mmio: add support to set IRQ of a virtio device as wakeup source")
Cc: stable@vger.kernel.org
Signed-off-by: Xiong Weimin &lt;xiongweimin@kylinos.cn&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Message-ID: &lt;20260805032937.1606737-1-xiongweimin@kylinos.cn&gt;
</content>
</entry>
<entry>
<title>virtio: fix use-after-free in unregister_virtio_device()</title>
<updated>2026-09-07T22:54:02+00:00</updated>
<author>
<name>Karl Mehltretter</name>
<email>kmehltretter@gmail.com</email>
</author>
<published>2026-08-21T21:39:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3f9a0fceb730f5107d52421ead5568eae25a0049'/>
<id>urn:sha1:3f9a0fceb730f5107d52421ead5568eae25a0049</id>
<content type='text'>
device_unregister() is device_del() plus put_device(). When the caller
holds no extra reference, that drops the last one and runs the release
callback, which for several transports frees the memory the embedded
struct virtio_device sits in. unregister_virtio_device() then calls
virtio_debug_device_exit(), which reads dev-&gt;debugfs_dir out of the freed
object.

Affected transports are the ones whose release callback frees and whose
remove path takes no reference: virtio_mmio, virtio_vdpa, virtio_uml,
mlxbf-tmfifo and virtio_ccw. virtio_pci is unaffected because
virtio_pci_remove() brackets the call with get_device() and put_device().

Remove the debugfs entries before the device can go away. They are only
accessed through the protected debugfs interface, so
debugfs_remove_recursive() waits for in-progress file operations before
returning. Tearing them down while the device is still alive is therefore
safe.

Reproduced on User-Mode Linux with CONFIG_KASAN and CONFIG_VIRTIO_DEBUG
by unbinding a virtio-uml device:

  BUG: KASAN: slab-use-after-free in virtio_debug_device_exit+0x36/0x4d
  Read of size 8 at addr 00000000616e0b10 by task init/1
   __asan_report_load8_noabort
   virtio_debug_device_exit+0x36/0x4d
   unregister_virtio_device+0x48/0x75
   virtio_uml_remove
   platform_remove
   device_release_driver_internal
   unbind_store

  Freed by task 1:
   kfree
   virtio_uml_release_dev
   device_release
   kobject_put
   put_device
   device_unregister

With this applied, the report is gone and unbind is clean.

Fixes: 96a8326d69ff ("virtio: add debugfs infrastructure to allow to debug virtio features")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Karl Mehltretter &lt;kmehltretter@gmail.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Message-ID: &lt;20260821213953.76906-1-kmehltretter@gmail.com&gt;
</content>
</entry>
<entry>
<title>virtio_ring: fix stale descriptor flags after a failed packed add</title>
<updated>2026-09-07T22:54:02+00:00</updated>
<author>
<name>Alexander Graf</name>
<email>graf@amazon.com</email>
</author>
<published>2026-08-17T22:32:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=75d276e5bb68778b2916f98a2bc30f142ebadc64'/>
<id>urn:sha1:75d276e5bb68778b2916f98a2bc30f142ebadc64</id>
<content type='text'>
In a packed ring the AVAIL and USED bits sit in the descriptor itself,
so writing them makes that descriptor available. Those bit combinations
flip meaning on every round of the ring, tracked by a wrap counter, so
invalidating or validating a descriptor means inverting both bits.

Commit 1ce9e6055fa0 ("virtio_ring: introduce packed ring support") has
virtqueue_add_packed() make every descriptor of a chain available as it
maps the chain, and write the head last. The device consumes the ring in
order and stops at a head that is not available yet, so it never reaches
the rest.

When vring_map_one_sg() fails partway, unmap_release unmaps the segments
and restores avail_used_flags, but the descriptors it wrote to in the
ring stay marked with AVAIL and USED bits. The head is now the only
entry that keeps the device from consuming these stale entries.

For example, the ring would look like this now.

  Z - pre-previous command
  A - previous command
  B - aborted command
  C - current command

  [A1 DONE] [A2 DONE] &lt;C1 EMPTY&gt; [B2] [B3] [Z1 DONE]

When the driver now attempts to issue the C command, the next add starts
at the same head as B. If C spans less descriptors than B, there is no
end marker because AVAIL and USED bits were still in place. And that
means the device will start interpreting these stale entries (B2/B3) as
another command entry, which then blocks the queue.

This effect typically happens in swiotlb configurations under memory
pressure, because vring_map_one_sg() can then fail with larger I/O
requests which then leads to command abortions.

There are broadly 2 ways to avoid leaving those flags behind:

  1) Defer those flags too until the chain is complete.
  2) Rewrite those flags for the previous wrap counter.

Implement the second option in both packed add paths. The first option
traverses the chain a second time on every successful add. The second
option invalidates all added descriptors when any add fails.

With this patch applied, a packed virtqueue keeps completing requests
after a failed add.

Fixes: 1ce9e6055fa0 ("virtio_ring: introduce packed ring support")
Fixes: f6a15d854986 ("virtio_ring: add in order support")
Assisted-by: Kiro:claude-opus-5 checkpatch sparse
Signed-off-by: Alexander Graf &lt;graf@amazon.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Message-ID: &lt;20260817223229.28954-1-graf@amazon.com&gt;
</content>
</entry>
<entry>
<title>virtio_ring: fix infinite loop in virtnet_poll_cleantx when device is broken</title>
<updated>2026-08-19T10:38:47+00:00</updated>
<author>
<name>Jinqian Yang</name>
<email>yangjinqian1@huawei.com</email>
</author>
<published>2026-07-16T11:59:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=0d0eff39ceb3dcbf7847a6f4517086c207c60081'/>
<id>urn:sha1:0d0eff39ceb3dcbf7847a6f4517086c207c60081</id>
<content type='text'>
virtnet_poll_cleantx() contains a do-while loop that cleans up
transmitted TX buffers and calls virtqueue_enable_cb_delayed() to check
whether more buffers need processing. When the virtio backend stops
responding during guest reboot, used-&gt;idx is never updated, so
virtqueue_enable_cb_delayed() always returns false and the loop never
terminates. Then it will block reboot process, and the guest will hang.

The problem occurs during guest reboot under network traffic:

  1. kernel_restart() -&gt; device_shutdown() traverses the device list
  2. virtio_dev_shutdown() calls virtio_break_device() which sets
     vq-&gt;broken = true
  3. virtio_dev_shutdown() then calls virtio_synchronize_cbs() to wait
     for in-flight callbacks to complete
  4. A virtio interrupt fires, softirq is deferred to ksoftirqd which
     calls net_rx_action() -&gt; virtnet_poll() -&gt; virtnet_poll_cleantx()
  5. virtnet_poll_cleantx() enters the do-while loop and never exits
     because the QEMU backend has stopped updating used-&gt;idx, despite
     vq-&gt;broken having been set to true in step 2.

Since the loop runs inside ksoftirqd (a SCHED_OTHER kthread), it is
visible to the scheduler and does not trigger a hard lockup. However,
the kthread never leaves the loop, so RCU detects it as a CPU stall
and reports it periodically. Meanwhile, the reboot process remains
blocked in device_shutdown() because virtio_dev_shutdown() cannot
complete its synchronization step, and the guest hangs permanently.

This can be reproduced on a guest with a virtio-net device: run iperf3
traffic in the guest, then trigger reboot. The reboot occasionally hangs
permanently with RCU stall on ksoftirqd.

Observed on ARM64 KVM guest:

  CPU#1 RCU stall (ksoftirqd/1), repeated periodically:
    virtqueue_enable_cb_delayed_split &lt;- virtnet_poll &lt;- __napi_poll &lt;-
    net_rx_action &lt;- handle_softirqs &lt;- run_ksoftirqd &lt;-
    smpboot_thread_fn &lt;- kthread

Fix by adding a vq-&gt;broken check in virtqueue_enable_cb_delayed(), so
that the loop exits immediately when the device is broken, allowing
the device shutdown to proceed.

Signed-off-by: Jinqian Yang &lt;yangjinqian1@huawei.com&gt;
Reviewed-by: Xuan Zhuo &lt;xuanzhuo@linux.alibaba.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Message-ID: &lt;20260716115940.394832-1-yangjinqian1@huawei.com&gt;
</content>
</entry>
<entry>
<title>virtio_mem: fix typo in comment</title>
<updated>2026-08-19T10:38:47+00:00</updated>
<author>
<name>xiongweimin</name>
<email>xiongweimin@kylinos.cn</email>
</author>
<published>2026-07-14T03:24:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=7eaf82117b9ee8c40b568cddbc50864d4e204eae'/>
<id>urn:sha1:7eaf82117b9ee8c40b568cddbc50864d4e204eae</id>
<content type='text'>
Correct "actipn" to "action".

Signed-off-by: xiongweimin &lt;xiongweimin@kylinos.cn&gt;
Reviewed-by: Parav Pandit &lt;parav@nvidia.com&gt;
Acked-by: David Hildenbrand (Arm) &lt;david@kernel.org&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Message-ID: &lt;20260714032417.201353-1-xiongwm2026@163.com&gt;
</content>
</entry>
<entry>
<title>virtio: fix article before virtio in dma-buf comment</title>
<updated>2026-08-19T10:38:47+00:00</updated>
<author>
<name>xiongweimin</name>
<email>xiongweimin@kylinos.cn</email>
</author>
<published>2026-07-14T02:45:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3b0320a27554ec26b822ee0fe42cd4b34890525e'/>
<id>urn:sha1:3b0320a27554ec26b822ee0fe42cd4b34890525e</id>
<content type='text'>
Use "a virtio" rather than "an virtio".

Signed-off-by: xiongweimin &lt;xiongweimin@kylinos.cn&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Message-ID: &lt;20260714024513.188571-1-15927021679@163.com&gt;
</content>
</entry>
</feed>
