* [PATCH v4 2/5] vhost/vsock: suppress EHOSTUNREACH fast-fail during CPR pause
From: Andrey Drobyshev @ 2026-07-14 15:16 UTC (permalink / raw)
To: linux-kernel
Cc: kvm, virtualization, netdev, sgarzare, mst, stefanha,
dongli.zhang, maciej.szmigiero, bchaney, mark.kanda, ptikhomirov,
den, andrey.drobyshev
In-Reply-To: <20260714151638.143019-1-andrey.drobyshev@virtuozzo.com>
Earlier commit bb26ed5f3a8b ("vhost/vsock: Refuse the connection
immediately when guest isn't ready") added a fast-fail in
vhost_transport_send_pkt(). It rejects every host send with -EHOSTUNREACH
until the destination calls SET_RUNNING(1). The fast-fail condition checks
whether device's backends are dropped, and if they're, the guest is
considered to be not ready.
However, there might be other reasons for backends to be nulled. In
particular, when QEMU is performing CPR (checkpoint-restore) migration,
device ownership is being RESET and SET again, which leads to backends
drop and reattach. If we end up connecting during this window, an
AF_VSOCK client gets -EHOSTUNREACH, which is wrong.
Add an 'ever_started' flag which is set once in vhost_vsock_start() and is
never cleared. The behaviour changes to:
* When device was never started -> flag is unset -> no listener can
exist yet -> fast-fail;
* Once the device starts -> flag is set -> we don't fast-fail ->
we queue and preserve during any later stop / CPR pause.
The VHOST_RESET_OWNER ioctl is implemented in a following patch, and
without RESET_OWNER the problem we fix here isn't manifesting - thus
this patch is a preparation to support RESET_OWNER.
Important caveat: after the first start, a connect during any stopped
window is queued instead of fast-failed. That was the behaviour before
the patch bb26ed5f3a8b, and we're restoring it now. However we still
keep the behaviour originally intended by that commit (i.e. fast-fail if
there's no real listener yet) while fixing the CPR path.
Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
drivers/vhost/vsock.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index b12221ce6faf..27169a09e87e 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -61,6 +61,7 @@ struct vhost_vsock {
u32 guest_cid;
bool seqpacket_allow;
+ bool ever_started; /* set on first SET_RUNNING(1); never cleared */
};
static u32 vhost_transport_get_local_cid(void)
@@ -302,17 +303,12 @@ vhost_transport_send_pkt(struct sk_buff *skb, struct net *net)
return -ENODEV;
}
- /* Fast-fail if the guest hasn't enabled the RX vq yet. Queuing the packet
- * and making the caller wait is pointless: even if the guest manages to init
- * within the timeout, it'll immediately reply with RST, because there's no
- * listener on the port yet.
- *
- * vhost_vq_get_backend() without vq->mutex is acceptable here: locking
- * the mutex would be too expensive in this hot path, and we already have
- * all the outcomes covered: if the backend becomes NULL right after the check,
- * vhost_transport_do_send_pkt() will check it under the mutex anyway.
+ /* Fast-fail until the guest first enables the device (SET_RUNNING(1)).
+ * Before that there is no listener, so queuing is pointless.
+ * 'ever_started' is never cleared, so once we're up we keep queuing
+ * across later stop / CPR-pause windows.
*/
- if (unlikely(!data_race(vhost_vq_get_backend(&vsock->vqs[VSOCK_VQ_RX])))) {
+ if (unlikely(!READ_ONCE(vsock->ever_started))) {
rcu_read_unlock();
kfree_skb(skb);
return -EHOSTUNREACH;
@@ -640,6 +636,11 @@ static int vhost_vsock_start(struct vhost_vsock *vsock)
mutex_unlock(&vq->mutex);
}
+ /* Set 'ever_started' flag on the first start; never cleared, so send_pkt
+ * keeps queuing (instead of fast-failing) on later stop / CPR pauses.
+ */
+ WRITE_ONCE(vsock->ever_started, true);
+
/* Some packets may have been queued before the device was started,
* let's kick the send worker to send them.
*/
@@ -728,6 +729,7 @@ static int vhost_vsock_dev_open(struct inode *inode, struct file *file)
vsock->guest_cid = 0; /* no CID assigned yet */
vsock->seqpacket_allow = false;
+ vsock->ever_started = false;
atomic_set(&vsock->queued_replies, 0);
--
2.47.1
^ permalink raw reply related
* [PATCH v4 3/5] vhost/vsock: re-scan TX virtqueue on device start
From: Andrey Drobyshev @ 2026-07-14 15:16 UTC (permalink / raw)
To: linux-kernel
Cc: kvm, virtualization, netdev, sgarzare, mst, stefanha,
dongli.zhang, maciej.szmigiero, bchaney, mark.kanda, ptikhomirov,
den, andrey.drobyshev
In-Reply-To: <20260714151638.143019-1-andrey.drobyshev@virtuozzo.com>
During QEMU CPR live-update (and VHOST_RESET_OWNER in general) the guest
keeps running while the host drops and later re-attaches vhost backends.
If the guest adds a buffer to the TX virtqueue (guest->host) and kicks
while the backend is temporarily NULL (between vhost_vsock_drop_backends()
and the next vhost_vsock_start()), then the kick is delivered to the
vhost worker, handle_tx_kick() sees a NULL backend and returns, and the
kick signal is consumed. The buffer is then left in the ring.
Then upon device start vhost_vsock_start() only re-kicks the RX send
worker, never the TX VQ, so the buffer is processed only if the guest
happens to kick again. But if the guest itself is now waiting for data
from the host, it will never kick TX VQ again, and we end up in a
deadlock.
The issue itself is pre-existing, but it only manifests during a device
pause caused by VHOST_RESET_OWNER. Namely, the deadlock is reproduced
during active host->guest socat data transfer under multiple consecutive
CPR live-update's.
To fix this, in vhost_vsock_start(), after kicking the RX send worker, also
queue the TX vq poll so any buffers the guest enqueued while we were paused
get scanned.
The VHOST_RESET_OWNER ioctl itself is implemented in the following
patch, thus this patch is a preparation to support VHOST_RESET_OWNER.
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
drivers/vhost/vsock.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index 27169a09e87e..d5022d21120b 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -646,6 +646,13 @@ static int vhost_vsock_start(struct vhost_vsock *vsock)
*/
vhost_vq_work_queue(&vsock->vqs[VSOCK_VQ_RX], &vsock->send_pkt_work);
+ /* The guest may have added TX buffers while the device was stopped
+ * (e.g. across VHOST_RESET_OWNER) and their kicks got consumed by
+ * the NULL-backend window. Re-scan the TX VQ, mirroring the RX
+ * send-worker kick above.
+ */
+ vhost_poll_queue(&vsock->vqs[VSOCK_VQ_TX].poll);
+
mutex_unlock(&vsock->dev.mutex);
return 0;
--
2.47.1
^ permalink raw reply related
* [PATCH v4 4/5] vhost: synchronize with RCU readers when freeing workers
From: Andrey Drobyshev @ 2026-07-14 15:16 UTC (permalink / raw)
To: linux-kernel
Cc: kvm, virtualization, netdev, sgarzare, mst, stefanha,
dongli.zhang, maciej.szmigiero, bchaney, mark.kanda, ptikhomirov,
den, andrey.drobyshev
In-Reply-To: <20260714151638.143019-1-andrey.drobyshev@virtuozzo.com>
vhost_vq_work_queue() only holds the RCU read lock while it dereferences
vq->worker and queues work on it. vhost_workers_free() however clears
the vq->worker pointers and immediately frees the workers, without
waiting for a grace period. A caller that fetched the worker right
before the pointer was cleared can therefore still be queueing work on
it while it is freed. And even when the queueing itself wins the race,
the work is never run, so its VHOST_WORK_QUEUED bit stays set and all
future attempts to queue it are silently skipped.
None of the current callers can actually hit this: net and scsi stop
their virtqueues before the workers are freed, and vsock unhashes the
device and does synchronize_rcu() of its own in vhost_vsock_dev_release()
before the workers go away. But the upcoming VHOST_RESET_OWNER support
in vhost-vsock keeps the device hashed while its workers are freed, so
the lockless send/cancel paths become able to race with the teardown.
Close this the way vhost_worker_killed() already does: clear the
vq->worker pointers, wait for a grace period, run whatever the last
readers may have queued, and only then free the workers. The
synchronize_rcu() is skipped if the device has no workers, so cleanup of
devices which never got an owner stays cheap.
Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
drivers/vhost/vhost.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 4c525b3e16ea..0d1414d40f4e 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -729,6 +729,21 @@ static void vhost_workers_free(struct vhost_dev *dev)
for (i = 0; i < dev->nvqs; i++)
rcu_assign_pointer(dev->vqs[i]->worker, NULL);
+
+ /*
+ * vhost_vq_work_queue() reads vq->worker under rcu_read_lock(), so a
+ * caller that fetched a worker before we cleared the pointers above
+ * may still be about to queue work on it. Wait for those RCU readers
+ * to finish before freeing the worker, then run whatever they queued
+ * so nothing is left with VHOST_WORK_QUEUED set. Mirrors
+ * vhost_worker_killed().
+ */
+ if (!xa_empty(&dev->worker_xa)) {
+ synchronize_rcu();
+ xa_for_each(&dev->worker_xa, i, worker)
+ vhost_run_work_list(worker);
+ }
+
/*
* Free the default worker we created and cleanup workers userspace
* created but couldn't clean up (it forgot or crashed).
--
2.47.1
^ permalink raw reply related
* [PATCH v4 5/5] vhost/vsock: add VHOST_RESET_OWNER ioctl
From: Andrey Drobyshev @ 2026-07-14 15:16 UTC (permalink / raw)
To: linux-kernel
Cc: kvm, virtualization, netdev, sgarzare, mst, stefanha,
dongli.zhang, maciej.szmigiero, bchaney, mark.kanda, ptikhomirov,
den, andrey.drobyshev
In-Reply-To: <20260714151638.143019-1-andrey.drobyshev@virtuozzo.com>
From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
This ioctl is needed for QEMU's CPR (checkpoint-restore) migration of
the guest with vhost-vsock device. For this to work, we need to reset
the device ownership on the source side by calling RESET_OWNER, and then
claim it on the dest side by calling SET_OWNER. We expect not to lose any
AF_VSOCK connection while this happens.
To that end, unlike the release path, RESET_OWNER keeps the guest CID
hashed: established connections survive, and host sends issued while
the device is between owners simply stay on send_pkt_queue until the
next device start drains them.
Since the device stays reachable through the CID hash, the lockless
send/cancel paths can race with the worker teardown in
vhost_workers_free(). The previous commit ("vhost: synchronize with
RCU readers when freeing workers") makes that safe.
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
drivers/vhost/vsock.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index d5022d21120b..86f25ff80722 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -903,6 +903,29 @@ static int vhost_vsock_set_features(struct vhost_vsock *vsock, u64 features)
return -EFAULT;
}
+static long vhost_vsock_reset_owner(struct vhost_vsock *vsock)
+{
+ struct vhost_iotlb *umem;
+ long err;
+
+ mutex_lock(&vsock->dev.mutex);
+ err = vhost_dev_check_owner(&vsock->dev);
+ if (err)
+ goto done;
+ umem = vhost_dev_reset_owner_prepare();
+ if (!umem) {
+ err = -ENOMEM;
+ goto done;
+ }
+ vhost_vsock_drop_backends(vsock);
+ vhost_vsock_flush(vsock);
+ vhost_dev_stop(&vsock->dev);
+ vhost_dev_reset_owner(&vsock->dev, umem);
+done:
+ mutex_unlock(&vsock->dev.mutex);
+ return err;
+}
+
static long vhost_vsock_dev_ioctl(struct file *f, unsigned int ioctl,
unsigned long arg)
{
@@ -946,6 +969,8 @@ static long vhost_vsock_dev_ioctl(struct file *f, unsigned int ioctl,
return -EOPNOTSUPP;
vhost_set_backend_features(&vsock->dev, features);
return 0;
+ case VHOST_RESET_OWNER:
+ return vhost_vsock_reset_owner(vsock);
default:
mutex_lock(&vsock->dev.mutex);
r = vhost_dev_ioctl(&vsock->dev, ioctl, argp);
--
2.47.1
^ permalink raw reply related
* Re: [RFC] virtio_balloon: fix Use-After-Free in page reporting during PM freeze
From: Link Lin @ 2026-07-14 18:05 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: David Hildenbrand (Arm), Andrew Morton, Vlastimil Babka,
virtualization, linux-mm, linux-kernel, prasin, rientjes, duenwen,
jasowang, xuanzhuo, Ammar Faizi, jiaqiyan, ahwilkins, Greg Thelen,
Alexander Duyck, stable
In-Reply-To: <20260714092146-mutt-send-email-mst@kernel.org>
On Mon, Jul 13, 2026 at 6:17 AM David Hildenbrand wrote:
> I assume that workqueue is not frozen yet because ... it's not freezable :)
> So could we queue to system_freezable_wq instead, or define our own freezable
> workqueue there? Then a driver doesn't have to worry about that.
Exactly. As noted in the RFC, the root cause is indeed that system_wq
lacks the WQ_FREEZABLE flag, leaving it active during suspend.
Switching the worker over to system_freezable_wq is a brilliant idea.
It's a much cleaner abstraction that solves the problem at the core,
saving individual drivers from having to micromanage this lifecycle
and handle failure unwinding during freeze/restore.
On Mon, Jul 13, 2026 at 6:26 AM Michael S. Tsirkin wrote:
> +1. Just system_freezable_wq will do the trick.
Thanks, David and Michael. I will drop the virtio-balloon specific
unregister logic and adopt this approach.
Per the earlier feedback to keep these fixes independent, I'll format
v2 as a 3-part patch series:
[PATCH v2 1/3] mm/page_reporting: use system_freezable_wq
[PATCH v2 2/3] virtio_balloon: fix shrinker UAF during PM freeze
[PATCH v2 3/3] virtio_balloon: fix OOM notifier UAF during PM freeze
I'll send that out shortly.
Thanks,
Link
^ permalink raw reply
* Re: [RFC] virtio_balloon: fix Use-After-Free in page reporting during PM freeze
From: David Rientjes @ 2026-07-14 18:21 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: David Hildenbrand (Arm), Link Lin, Andrew Morton, Vlastimil Babka,
virtualization, linux-mm, linux-kernel, prasin, duenwen, jasowang,
xuanzhuo, Ammar Faizi, jiaqiyan, ahwilkins, Greg Thelen,
Alexander Duyck, stable
In-Reply-To: <20260714092146-mutt-send-email-mst@kernel.org>
On Tue, 14 Jul 2026, Michael S. Tsirkin wrote:
> > > diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> > > index a1b2c3d4e5f6..45a90fb3abf8 100640
> > > --- a/drivers/virtio/virtio_balloon.c
> > > +++ b/drivers/virtio/virtio_balloon.c
> > > @@ -1055,6 +1055,9 @@ static int virtballoon_freeze(struct virtio_device *vdev)
> > > * The workqueue is already frozen by the PM core before this
> > > * function is called.
> > > */
> > > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_REPORTING))
> > > + page_reporting_unregister(&vb->pr_dev_info);
> > > +
> > > remove_common(vb);
> > > return 0;
> > > }
> > >
> > > static int virtballoon_restore(struct virtio_device *vdev)
> > > {
> > > struct virtio_balloon *vb = vdev->priv;
> > > int ret;
> > >
> > > ret = init_vqs(vdev->priv);
> > > if (ret)
> > > return ret;
> > >
> > > virtio_device_ready(vdev);
> > >
> > > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_REPORTING)) {
> > > + ret = page_reporting_register(&vb->pr_dev_info);
> > > + if (ret)
> > > + goto out_remove_vqs;
> > > + }
> >
> > Hm, that failure handling is rather nasty.
> >
> >
> > In virtballoon_freeze() we document:
> >
> > "The workqueue is already frozen by the PM core before this function is called"
> >
> > Your report states:
> >
> > "Workqueue: events page_reporting_process"
> >
> >
> > I assume that workqueue is not frozen yet because ... it's not freezable :)
> >
> > So could we queue to system_freezable_wq instead, or define our own freezable
> > workqueue there? Then a driver doesn't have to worry about that.
> >
> > --
> > Cheers,
> >
> > David
>
> +1. Just system_freezable_wq will do the trick.
>
This makes sense.
I'm curious why this bug hasn't popped up earlier, presumably any VM that
has gone through suspend while reporting free pages through FPR is
vulnerable to it and could have panicked as a result. Which would suggest
maybe >99% of FPR is done by guests that never suspend? While under
pressure this issue seems reproducible.
^ permalink raw reply
* Re: [RFC] virtio_balloon: fix Use-After-Free in page reporting during PM freeze
From: Michael S. Tsirkin @ 2026-07-14 18:52 UTC (permalink / raw)
To: David Rientjes
Cc: David Hildenbrand (Arm), Link Lin, Andrew Morton, Vlastimil Babka,
virtualization, linux-mm, linux-kernel, prasin, duenwen, jasowang,
xuanzhuo, Ammar Faizi, jiaqiyan, ahwilkins, Greg Thelen,
Alexander Duyck, stable
In-Reply-To: <5e18d7ec-a9d7-2cc3-7741-695ec3580ffa@google.com>
On Tue, Jul 14, 2026 at 11:21:33AM -0700, David Rientjes wrote:
> On Tue, 14 Jul 2026, Michael S. Tsirkin wrote:
>
> > > > diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> > > > index a1b2c3d4e5f6..45a90fb3abf8 100640
> > > > --- a/drivers/virtio/virtio_balloon.c
> > > > +++ b/drivers/virtio/virtio_balloon.c
> > > > @@ -1055,6 +1055,9 @@ static int virtballoon_freeze(struct virtio_device *vdev)
> > > > * The workqueue is already frozen by the PM core before this
> > > > * function is called.
> > > > */
> > > > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_REPORTING))
> > > > + page_reporting_unregister(&vb->pr_dev_info);
> > > > +
> > > > remove_common(vb);
> > > > return 0;
> > > > }
> > > >
> > > > static int virtballoon_restore(struct virtio_device *vdev)
> > > > {
> > > > struct virtio_balloon *vb = vdev->priv;
> > > > int ret;
> > > >
> > > > ret = init_vqs(vdev->priv);
> > > > if (ret)
> > > > return ret;
> > > >
> > > > virtio_device_ready(vdev);
> > > >
> > > > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_REPORTING)) {
> > > > + ret = page_reporting_register(&vb->pr_dev_info);
> > > > + if (ret)
> > > > + goto out_remove_vqs;
> > > > + }
> > >
> > > Hm, that failure handling is rather nasty.
> > >
> > >
> > > In virtballoon_freeze() we document:
> > >
> > > "The workqueue is already frozen by the PM core before this function is called"
> > >
> > > Your report states:
> > >
> > > "Workqueue: events page_reporting_process"
> > >
> > >
> > > I assume that workqueue is not frozen yet because ... it's not freezable :)
> > >
> > > So could we queue to system_freezable_wq instead, or define our own freezable
> > > workqueue there? Then a driver doesn't have to worry about that.
> > >
> > > --
> > > Cheers,
> > >
> > > David
> >
> > +1. Just system_freezable_wq will do the trick.
> >
>
> This makes sense.
>
> I'm curious why this bug hasn't popped up earlier, presumably any VM that
> has gone through suspend while reporting free pages through FPR is
> vulnerable to it and could have panicked as a result. Which would suggest
> maybe >99% of FPR is done by guests that never suspend?
Quite possible.
> While under
> pressure this issue seems reproducible.
^ permalink raw reply
* Re: [PATCH] virtio_net: fix infinite loop in virtnet_poll_cleantx when device is broken
From: Jinqian Yang @ 2026-07-15 2:45 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: jasowang, xuanzhuo, eperezma, andrew+netdev, davem, edumazet,
kuba, pabeni, netdev, virtualization, linux-kernel, liuyonglong,
wangzhou1, linuxarm
In-Reply-To: <20260714091622-mutt-send-email-mst@kernel.org>
Hi,
On 2026/7/14 21:17, Michael S. Tsirkin wrote:
> On Mon, Jul 13, 2026 at 09:20:25PM +0800, Jinqian Yang wrote:
>> 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->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() -> device_shutdown() traverses the device list
>> 2. virtio_dev_shutdown() calls virtio_break_device() which sets
>> vq->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() -> virtnet_poll() -> virtnet_poll_cleantx()
>> 5. virtnet_poll_cleantx() enters the do-while loop and never exits
>> because the QEMU backend has stopped updating used->idx, despite
>> vq->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 <- virtnet_poll <- __napi_poll <-
>> net_rx_action <- handle_softirqs <- run_ksoftirqd <-
>> smpboot_thread_fn <- kthread
>>
>> Fix by adding a virtqueue_is_broken() check to the loop condition, so
>> that the loop exits immediately when the device is broken, allowing
>> the device shutdown to proceed.
>>
>> Signed-off-by: Jinqian Yang <yangjinqian1@huawei.com>
>
> I'd expect lots of drivers have this issue? Wouldn't it make more sense
> to check virtqueue_is_broken in
> virtqueue_enable_cb_delayed/virtqueue_enable_cb? This way it works for
> all drivers.
>
In virtqueue_enable_cb->virtqueue_poll, a check for vq->broken is
performed, so other devices do not have this issue.
Indeed, it is more reasonable to check vq->broken inside
virtqueue_enable_cb_delayed. I will make the changes in v2.
Thanks,
Jinqian
>
>
>> ---
>> drivers/net/virtio_net.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>> index 7d2eeb9b1226..c8d2d420c31d 100644
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -2970,7 +2970,8 @@ static void virtnet_poll_cleantx(struct receive_queue *rq, int budget)
>> do {
>> virtqueue_disable_cb(sq->vq);
>> free_old_xmit(sq, txq, !!budget);
>> - } while (unlikely(!virtqueue_enable_cb_delayed(sq->vq)));
>> + } while (!virtqueue_is_broken(sq->vq) &&
>> + unlikely(!virtqueue_enable_cb_delayed(sq->vq)));
>>
>> if (sq->vq->num_free >= MAX_SKB_FRAGS + 2)
>> virtnet_tx_wake_queue(vi, sq);
>> --
>> 2.33.0
>
>
^ permalink raw reply
* [PATCH 01/12] vhost-scsi: improve BIDI operation comments
From: Weimin Xiong @ 2026-07-15 8:09 UTC (permalink / raw)
To: virtualization
From: xiongweimin <xiongwm2026@163.com>
Replace FIXME comments with clearer Note comments documenting
that BIDI (bidirectional) operations are not yet supported.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---
drivers/vhost/scsi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 9a1253b9d..81e905c4c 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1047,7 +1047,7 @@ static void vhost_scsi_target_queue_cmd(struct vhost_scsi_nexus *nexus,
struct se_cmd *se_cmd = &cmd->tvc_se_cmd;
struct scatterlist *sg_ptr, *sg_prot_ptr = NULL;
- /* FIXME: BIDI operation */
+ /* Note: BIDI (bidirectional) operations are not yet supported */
if (cmd->tvc_sgl_count) {
sg_ptr = cmd->table.sgl;
@@ -1168,7 +1168,7 @@ vhost_scsi_get_desc(struct vhost_scsi *vs, struct vhost_virtqueue *vq,
/*
* Get the size of request and response buffers.
- * FIXME: Not correct for BIDI operation
+ * Note: Size calculation is not correct for BIDI operations.
*/
vc->out_size = iov_length(vq->iov, vc->out);
vc->in_size = iov_length(&vq->iov[vc->out], vc->in);
--
2.43.0
^ permalink raw reply related
* [PATCH 03/12] vhost-net: improve TSO and checksum TODO comments
From: Weimin Xiong @ 2026-07-15 8:09 UTC (permalink / raw)
To: virtualization
From: xiongweimin <xiongwm2026@163.com>
Update TODO comments related to TSO (TCP Segmentation Offload) and
checksum handling to clearly document the current limitations and
what's needed for future implementation.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---
drivers/vhost/net.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 77b59f49b..c6854cba5 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -644,7 +644,7 @@ static bool vhost_exceeds_maxpend(struct vhost_net *net)
static size_t init_iov_iter(struct vhost_virtqueue *vq, struct iov_iter *iter,
size_t hdr_size, int out)
{
- /* Skip header. TODO: support TSO. */
+ /* Skip header. TSO support requires parsing virtio_net_hdr gso_type */
size_t len = iov_length(vq->iov, out);
iov_iter_init(iter, ITER_SOURCE, vq->iov, out, len);
@@ -1240,8 +1240,8 @@ static void handle_rx(struct vhost_net *net)
iov_iter_init(&msg.msg_iter, ITER_DEST, vq->iov, in, vhost_len);
fixup = msg.msg_iter;
if (unlikely((vhost_hlen))) {
- /* We will supply the header ourselves
- * TODO: support TSO.
+ /* We will supply the header ourselves.
+ * Note: TSO requires handling gso_size/gso_type in virtio_net_hdr.
*/
iov_iter_advance(&msg.msg_iter, vhost_hlen);
}
@@ -1270,7 +1270,7 @@ static void handle_rx(struct vhost_net *net)
*/
iov_iter_advance(&fixup, sizeof(hdr));
}
- /* TODO: Should check and handle checksum. */
+ /* Note: Checksum offload handling not yet implemented */
num_buffers = cpu_to_vhost16(vq, headcount);
if (likely(set_num_buffers) &&
--
2.43.0
^ permalink raw reply related
* [PATCH 04/12] vhost-vdpa: improve ASID not found error message and return code
From: Weimin Xiong @ 2026-07-15 8:09 UTC (permalink / raw)
To: virtualization
From: xiongweimin <xiongwm2026@163.com>
Improve the error message when IOTLB is not found for an ASID to clarify
that the ASID may not be allocated. Also change the return code from
-EINVAL to -ENOENT to better indicate a missing resource.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---
drivers/vhost/vdpa.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index ac55275fa..a18ed439e 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -1275,8 +1275,10 @@ static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev, u32 asid,
v->batch_asid, asid);
}
if (!iotlb)
- dev_err(&v->dev, "no iotlb for asid %d\n", asid);
- r = -EINVAL;
+ dev_err(&v->dev,
+ "IOTLB not found for ASID %d: ASID may not be allocated\n",
+ asid);
+ r = -ENOENT;
goto unlock;
}
--
2.43.0
^ permalink raw reply related
* [PATCH 07/12] vhost-scsi: improve TMF log allocation error handling comment
From: Weimin Xiong @ 2026-07-15 8:09 UTC (permalink / raw)
To: virtualization
From: xiongweimin <xiongwm2026@163.com>
Add a clarifying comment to explain the error handling flow when TMF
log allocation fails. The tmf structure is freed via vhost_scsi_release_tmf_res()
and then safely falls through to send_reject since it doesn't access tmf
after release.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---
drivers/vhost/scsi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 77e47f246..219d9d881 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1620,6 +1620,9 @@ vhost_scsi_handle_tmf(struct vhost_scsi *vs, struct vhost_scsi_tpg *tpg,
tmf->tmf_log_num = log_num;
} else {
pr_err("vhost_scsi tmf log allocation error\n");
+ /* Free tmf and send reject response. The send_reject
+ * label does not access tmf after this release.
+ */
vhost_scsi_release_tmf_res(tmf);
goto send_reject;
}
--
2.43.0
^ permalink raw reply related
* [PATCH 09/12] vhost-net: use sizeof(*featurep) instead of sizeof(u64)
From: Weimin Xiong @ 2026-07-15 8:09 UTC (permalink / raw)
To: virtualization
From: xiongweimin <xiongwm2026@163.com>
Use sizeof(*featurep) instead of sizeof(u64) for better type safety
and consistency with kernel coding style. While sizeof(u64) equals
sizeof(*featurep) on all supported platforms, using sizeof(*featurep)
makes the code more maintainable.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---
drivers/vhost/net.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index c6854cba5..94028598f 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -1777,14 +1777,14 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl,
return -EFAULT;
/* Copy the net features, up to the user-provided buffer size */
- argp += sizeof(u64);
+ argp += sizeof(*featurep);
copied = min(count, (u64)VIRTIO_FEATURES_U64S);
if (copy_to_user(argp, vhost_net_features,
- copied * sizeof(u64)))
+ copied * sizeof(*featurep)))
return -EFAULT;
/* Zero the trailing space provided by user-space, if any */
- if (clear_user(argp, size_mul(count - copied, sizeof(u64))))
+ if (clear_user(argp, size_mul(count - copied, sizeof(*featurep))))
return -EFAULT;
return 0;
case VHOST_SET_FEATURES_ARRAY:
@@ -1792,9 +1792,9 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl,
return -EFAULT;
virtio_features_zero(all_features);
- argp += sizeof(u64);
+ argp += sizeof(*featurep);
copied = min(count, (u64)VIRTIO_FEATURES_U64S);
- if (copy_from_user(all_features, argp, copied * sizeof(u64)))
+ if (copy_from_user(all_features, argp, copied * sizeof(*featurep)))
return -EFAULT;
/*
--
2.43.0
^ permalink raw reply related
* [PATCH 02/12] vhost-scsi: remove dead commented code in vhost_scsi_make_tport
From: Weimin Xiong @ 2026-07-15 8:09 UTC (permalink / raw)
To: virtualization
From: xiongweimin <xiongwm2026@163.com>
Remove dead commented-out code that was left behind during previous
refactoring. The code checked for invalid WWN parsing but is no longer
used.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---
drivers/vhost/scsi.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 81e905c4c..77e47f246 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -2841,9 +2841,6 @@ vhost_scsi_make_tport(struct target_fabric_configfs *tf,
u64 wwpn = 0;
int off = 0;
- /* if (vhost_scsi_parse_wwn(name, &wwpn, 1) < 0)
- return ERR_PTR(-EINVAL); */
-
tport = kzalloc_obj(*tport);
if (!tport) {
pr_err("Unable to allocate struct vhost_scsi_tport");
--
2.43.0
^ permalink raw reply related
* [PATCH 08/12] vhost-scsi: improve CDB size validation and remove TODO comment
From: Weimin Xiong @ 2026-07-15 8:09 UTC (permalink / raw)
To: virtualization
From: xiongweimin <xiongwm2026@163.com>
Improve the CDB size validation by adding a zero-length check for
additional safety. Also remove the misleading TODO comment since
scsi_command_size() already correctly handles both fixed and
variable-length CDBs.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---
drivers/vhost/scsi.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 219d9d881..2fbc328c9 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1432,12 +1432,15 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
lun = vhost_buf_to_lun(v_req.lun);
}
/*
- * Check that the received CDB size does not exceeded our
- * hardcoded max for vhost-scsi, then get a pre-allocated
- * cmd descriptor for the new virtio-scsi tag.
- *
- * TODO what if cdb was too small for varlen cdb header?
+ * Check that the received CDB size is valid and does not
+ * exceed our hardcoded max for vhost-scsi, then get a
+ * pre-allocated cmd descriptor for the new virtio-scsi tag.
+ * scsi_command_size() handles both fixed and variable-length CDBs.
*/
+ if (unlikely(scsi_command_size(cdb) == 0)) {
+ vq_err(vq, "Received SCSI CDB with zero length\n");
+ goto err;
+ }
if (unlikely(scsi_command_size(cdb) > VHOST_SCSI_MAX_CDB_SIZE)) {
vq_err(vq, "Received SCSI CDB with command_size: %d that"
" exceeds SCSI_MAX_VARLEN_CDB_SIZE: %d\n",
--
2.43.0
^ permalink raw reply related
* [PATCH 05/12] vhost-vdpa: add comment for VHOST_SET_LOG_BASE not supported
From: Weimin Xiong @ 2026-07-15 8:09 UTC (permalink / raw)
To: virtualization
From: xiongweimin <xiongwm2026@163.com>
Add a comment explaining why VHOST_SET_LOG_BASE and VHOST_SET_LOG_FD
ioctls are not supported in vhost-vdpa. The vDPA devices use their own
logging mechanism through the vdpa bus instead.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---
drivers/vhost/vdpa.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index a18ed439e..6ddd5f0f9 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -848,6 +848,9 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep,
if (copy_to_user(argp, &v->vdpa->nas, sizeof(v->vdpa->nas)))
r = -EFAULT;
break;
+ /* vDPA devices use their own logging mechanism through the bus
+ * and don't support the traditional vhost-user log ioctls.
+ */
case VHOST_SET_LOG_BASE:
case VHOST_SET_LOG_FD:
r = -ENOIOCTLCMD;
--
2.43.0
^ permalink raw reply related
* [PATCH 06/12] vhost: rename confusing 'min' variable in log_write_hva
From: Weimin Xiong @ 2026-07-15 8:09 UTC (permalink / raw)
To: virtualization
From: xiongweimin <xiongwm2026@163.com>
Rename variable 'min' to 'logged_len' for clarity. The original expression
'min(l, min)' where 'min' is both a macro and a variable was confusing.
Also fix the misleading comment about GPAs - this function works with HVAs
and UMEM mappings.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---
drivers/vhost/vhost.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 4c525b3e1..3c080c454 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -2461,14 +2461,14 @@ static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len)
{
struct vhost_iotlb *umem = vq->umem;
struct vhost_iotlb_map *u;
- u64 start, end, l, min;
+ u64 start, end, l, logged_len;
int r;
bool hit = false;
while (len) {
- min = len;
- /* More than one GPAs can be mapped into a single HVA. So
- * iterate all possible umems here to be safe.
+ logged_len = len;
+ /* Multiple UMEM mappings may cover this HVA range.
+ * Iterate all mappings to ensure we log all dirty pages.
*/
list_for_each_entry(u, &umem->list, link) {
if (u->addr > hva - 1 + len ||
@@ -2483,14 +2483,14 @@ static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len)
if (r < 0)
return r;
hit = true;
- min = min(l, min);
+ logged_len = min(l, logged_len);
}
if (!hit)
return -EFAULT;
- len -= min;
- hva += min;
+ len -= logged_len;
+ hva += logged_len;
}
return 0;
--
2.43.0
^ permalink raw reply related
* [PATCH 10/12] vhost-vringh: use size_mul() for overflow-safe multiplication
From: Weimin Xiong @ 2026-07-15 8:09 UTC (permalink / raw)
To: virtualization
From: xiongweimin <xiongwm2026@163.com>
The multiplication sizeof(*dst) * num could potentially overflow if num
is very large. Use size_mul_overflow() for overflow-safe multiplication,
consistent with patterns used elsewhere in the kernel.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---
drivers/vhost/vringh.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
index 9066f9f12..b4a06454f 100644
--- a/drivers/vhost/vringh.c
+++ b/drivers/vhost/vringh.c
@@ -9,6 +9,7 @@
#include <linux/vringh.h>
#include <linux/virtio_ring.h>
#include <linux/kernel.h>
+#include <linux/overflow.h>
#include <linux/ratelimit.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
@@ -621,8 +622,11 @@ static inline int putused_user(const struct vringh *vrh,
const struct vring_used_elem *src,
unsigned int num)
{
- return copy_to_user((__force void __user *)dst, src,
- sizeof(*dst) * num) ? -EFAULT : 0;
+ size_t total_size;
+
+ if (unlikely(size_mul_overflow(sizeof(*dst), num, &total_size)))
+ return -EINVAL;
+ return copy_to_user((__force void __user *)dst, src, total_size) ? -EFAULT : 0;
}
static inline int xfer_from_user(const struct vringh *vrh, void *src,
--
2.43.0
^ permalink raw reply related
* [PATCH 11/12] vhost-vringh: use uintptr_t for address casting
From: Weimin Xiong @ 2026-07-15 8:09 UTC (permalink / raw)
To: virtualization
From: xiongweimin <xiongwm2026@163.com>
Use (void *)(uintptr_t) instead of (void *)(long) for cleaner
unsigned address handling. The uintptr_t type makes the intent clearer
that we're handling pointer-sized unsigned values.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---
drivers/vhost/vringh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
index b4a06454f..654567ee5 100644
--- a/drivers/vhost/vringh.c
+++ b/drivers/vhost/vringh.c
@@ -351,7 +351,7 @@ __vringh_iov(struct vringh *vrh, u16 i,
slowrange = range;
}
- addr = (void *)(long)(a + range.offset);
+ addr = (void *)(uintptr_t)(a + range.offset);
err = move_to_indirect(vrh, &up_next, &i, addr, &desc,
&descs, &desc_max);
if (err)
--
2.43.0
^ permalink raw reply related
* [PATCH 12/12] vhost-vdpa: add explicit cast for void* to u64__user*
From: Weimin Xiong @ 2026-07-15 8:09 UTC (permalink / raw)
To: virtualization
From: xiongweimin <xiongwm2026@163.com>
Add explicit cast from void __user* to u64 __user* for maximum
compatibility with static analysis tools. While the implicit conversion
is valid C, explicit casts improve sparse checking compatibility.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---
drivers/vhost/vdpa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 6ddd5f0f9..bb96b1aa5 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -779,7 +779,7 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep,
struct vhost_vdpa *v = filep->private_data;
struct vhost_dev *d = &v->vdev;
void __user *argp = (void __user *)arg;
- u64 __user *featurep = argp;
+ u64 __user *featurep = (u64 __user *)argp;
u64 features;
long r = 0;
--
2.43.0
^ permalink raw reply related
* [PATCH 00/12] vhost: cleanups and improvements - PLEASE IGNORE
From: Weimin Xiong @ 2026-07-15 8:14 UTC (permalink / raw)
To: virtualization
Cc: kvm, netdev, linux-kernel, mst, jasowangio, michael.christie
Please ignore the previous series "[PATCH 00/12] vhost: cleanups and improvements"
sent earlier today. There were missing CC recipients. A corrected version
will be resent shortly.
Sorry for the noise.
Weimin Xiong
^ permalink raw reply
* [PATCH 00/12] vhost: cleanups and improvements - PLEASE IGNORE
From: Weimin Xiong @ 2026-07-15 8:33 UTC (permalink / raw)
To: virtualization
Please ignore the previous series "[PATCH 00/12] vhost: cleanups and improvements"
sent earlier today. There were missing CC recipients. A corrected version
will be resent shortly.
Sorry for the noise.
Weimin Xiong
^ permalink raw reply
* Re: [PATCH] virtio_net: fix spelling of aggressively in comments
From: Jakub Raczynski @ 2026-07-15 8:49 UTC (permalink / raw)
To: weimin xiong
Cc: netdev, mst, jasowangio, xuanzhuo, eperezma, virtualization,
xiongweimin
In-Reply-To: <20260714024037.186799-1-15927021679@163.com>
[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]
Please read
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
This patch should target net-next tree and is not actively CC'ing any
maintainer. Use 'get_maintainer.pl' script to get correct recipents.
BR
Jakub Raczynski
On Tue, Jul 14, 2026 at 10:40:37AM +0800, weimin xiong wrote:
> From: xiongweimin <xiongweimin@kylinos.cn>
>
> Two receive-path comments misspell "aggressively" as "agressively".
>
> Signed-off-by: xiongweimin <xiongweimin@kylinos.cn>
> ---
> drivers/net/virtio_net.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 3e2a5876c..f3c7b28ce 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -3190,7 +3190,7 @@ static int virtnet_open(struct net_device *dev)
>
> for (i = 0; i < vi->max_queue_pairs; i++) {
> if (i < vi->curr_queue_pairs)
> - /* Pre-fill rq agressively, to make sure we are ready to
> + /* Pre-fill rq aggressively, to make sure we are ready to
> * get packets immediately.
> */
> try_fill_recv(vi, &vi->rq[i], GFP_KERNEL);
> @@ -3419,7 +3419,7 @@ static void virtnet_rx_resume(struct virtnet_info *vi,
> bool refill)
> {
> if (netif_running(vi->dev)) {
> - /* Pre-fill rq agressively, to make sure we are ready to get
> + /* Pre-fill rq aggressively, to make sure we are ready to get
> * packets immediately.
> */
> if (refill)
> --
> 2.43.0
>
>
> No virus found
> Checked by Hillstone Network AntiVirus
>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply
* Re: [PATCH 01/12] vhost-scsi: improve BIDI operation comments
From: Bobby Eshleman @ 2026-07-15 9:24 UTC (permalink / raw)
To: Weimin Xiong; +Cc: virtualization
In-Reply-To: <20260715080906.21689-1-xiongwm2026@163.com>
On Wed, Jul 15, 2026 at 04:09:06PM +0800, Weimin Xiong wrote:
> From: xiongweimin <xiongwm2026@163.com>
>
> Replace FIXME comments with clearer Note comments documenting
> that BIDI (bidirectional) operations are not yet supported.
>
> Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
> Co-authored-by: Cursor <cursoragent@cursor.com>
> ---
> drivers/vhost/scsi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> index 9a1253b9d..81e905c4c 100644
> --- a/drivers/vhost/scsi.c
> +++ b/drivers/vhost/scsi.c
> @@ -1047,7 +1047,7 @@ static void vhost_scsi_target_queue_cmd(struct vhost_scsi_nexus *nexus,
> struct se_cmd *se_cmd = &cmd->tvc_se_cmd;
> struct scatterlist *sg_ptr, *sg_prot_ptr = NULL;
>
> - /* FIXME: BIDI operation */
> + /* Note: BIDI (bidirectional) operations are not yet supported */
> if (cmd->tvc_sgl_count) {
> sg_ptr = cmd->table.sgl;
>
> @@ -1168,7 +1168,7 @@ vhost_scsi_get_desc(struct vhost_scsi *vs, struct vhost_virtqueue *vq,
>
> /*
> * Get the size of request and response buffers.
> - * FIXME: Not correct for BIDI operation
> + * Note: Size calculation is not correct for BIDI operations.
> */
> vc->out_size = iov_length(vq->iov, vc->out);
> vc->in_size = iov_length(&vq->iov[vc->out], vc->in);
> --
> 2.43.0
>
Hey Weimin,
This series is probably going to be ignored. Comment-only changes are
almost never merged, and the code changes here don't look like genuine
bugs.
In the case that there are some real bugs, I'd recommend to setup a
system and trigger a bug, and provide a reproducer.
Best,
Bobby
^ permalink raw reply
* Re:Re: [PATCH 01/12] vhost-scsi: improve BIDI operation comments
From: xiongwm2026 @ 2026-07-15 9:36 UTC (permalink / raw)
To: Bobby Eshleman; +Cc: virtualization
In-Reply-To: <aldR5cNr3SlVoBX/@devvm29614.prn0.facebook.com>
Hi Bobby,
Thanks for the feedback.
Understood. I will drop this comment-only change and focus on fixes with
a concrete bug scenario or reproducer.
Best,
Weimin
At 2026-07-15 17:24:53, "Bobby Eshleman" <bobbyeshleman@gmail.com> wrote:
>On Wed, Jul 15, 2026 at 04:09:06PM +0800, Weimin Xiong wrote:
>> From: xiongweimin <xiongwm2026@163.com>
>>
>> Replace FIXME comments with clearer Note comments documenting
>> that BIDI (bidirectional) operations are not yet supported.
>>
>> Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
>> Co-authored-by: Cursor <cursoragent@cursor.com>
>> ---
>> drivers/vhost/scsi.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
>> index 9a1253b9d..81e905c4c 100644
>> --- a/drivers/vhost/scsi.c
>> +++ b/drivers/vhost/scsi.c
>> @@ -1047,7 +1047,7 @@ static void vhost_scsi_target_queue_cmd(struct vhost_scsi_nexus *nexus,
>> struct se_cmd *se_cmd = &cmd->tvc_se_cmd;
>> struct scatterlist *sg_ptr, *sg_prot_ptr = NULL;
>>
>> - /* FIXME: BIDI operation */
>> + /* Note: BIDI (bidirectional) operations are not yet supported */
>> if (cmd->tvc_sgl_count) {
>> sg_ptr = cmd->table.sgl;
>>
>> @@ -1168,7 +1168,7 @@ vhost_scsi_get_desc(struct vhost_scsi *vs, struct vhost_virtqueue *vq,
>>
>> /*
>> * Get the size of request and response buffers.
>> - * FIXME: Not correct for BIDI operation
>> + * Note: Size calculation is not correct for BIDI operations.
>> */
>> vc->out_size = iov_length(vq->iov, vc->out);
>> vc->in_size = iov_length(&vq->iov[vc->out], vc->in);
>> --
>> 2.43.0
>>
>
>Hey Weimin,
>
>This series is probably going to be ignored. Comment-only changes are
>almost never merged, and the code changes here don't look like genuine
>bugs.
>
>In the case that there are some real bugs, I'd recommend to setup a
>system and trigger a bug, and provide a reproducer.
>
>Best,
>Bobby
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox