* [PATCH v1] drm/virtio: Reset device before deleting virtqueues on freeze
@ 2026-09-26 20:20 Yuho Choi
2026-09-26 20:26 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Yuho Choi @ 2026-09-26 20:20 UTC (permalink / raw)
To: David Airlie, Gerd Hoffmann, Dmitry Osipenko, Dongwon Kim
Cc: Gurchetan Singh, Chia-I Wu, dri-devel, virtualization,
linux-kernel, Yuho Choi, stable
virtgpu_freeze() waits for the control and cursor queues to drain and
then deletes the virtqueues, but nothing tells the device to stop first.
del_vqs() frees the vring backing, but does not provide a generic device
quiesce operation. In particular, modern virtio-pci keeps enabled queues
active until the device is reset, so the device is left DRIVER_OK with
its queues pointing at memory that has been freed and may be reused while
the guest is suspended. virtio_device_restore() only resets the device
later, on resume.
Reset the device before deleting the virtqueues, the way
virtio_gpu_deinit() already does on removal.
Fixes: cad6a879a7fb ("drm/virtio: Freeze and restore hooks to support suspend and resume")
Cc: stable@vger.kernel.org
Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
---
drivers/gpu/drm/virtio/virtgpu_drv.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 2aaa7cb08085..52c174f9bff7 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -225,6 +225,7 @@ static int virtgpu_freeze(struct virtio_device *vdev)
goto err_resume;
}
+ virtio_reset_device(vdev);
vdev->config->del_vqs(vdev);
return 0;
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] drm/virtio: Reset device before deleting virtqueues on freeze
2026-09-26 20:20 [PATCH v1] drm/virtio: Reset device before deleting virtqueues on freeze Yuho Choi
@ 2026-09-26 20:26 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-09-26 20:26 UTC (permalink / raw)
To: Yuho Choi; +Cc: Michael S. Tsirkin, dri-devel, virtualization, Eugenio Perez
> virtgpu_freeze() waits for the control and cursor queues to drain and
> then deletes the virtqueues, but nothing tells the device to stop first.
> del_vqs() frees the vring backing, but does not provide a generic device
> quiesce operation. In particular, modern virtio-pci keeps enabled queues
> active until the device is reset, so the device is left DRIVER_OK with
> its queues pointing at memory that has been freed and may be reused while
> the guest is suspended. virtio_device_restore() only resets the device
> later, on resume.
>
> Reset the device before deleting the virtqueues, the way
> virtio_gpu_deinit() already does on removal.
>
> Fixes: cad6a879a7fb ("drm/virtio: Freeze and restore hooks to support suspend and resume")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260926202040.1313385-1-oss.patchbox@gmail.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-26 20:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-26 20:20 [PATCH v1] drm/virtio: Reset device before deleting virtqueues on freeze Yuho Choi
2026-09-26 20:26 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox