On 2025/11/25 6:54, Dmitry Osipenko wrote:
On 11/20/25 18:02, Dmitry Osipenko wrote:
On 11/20/25 17:54, Dmitry Osipenko wrote:
On 11/20/25 08:07, Akihiko Odaki wrote:
+int virtio_gpu_virgl_reset(VirtIOGPU *g)
   {
+    struct virtio_gpu_simple_resource *res, *tmp;
+
+    QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {
+        virtio_gpu_virgl_resource_destroy(g, res, NULL);
+    }
+
+    if (!QTAILQ_EMPTY(&g->reslist)) {
+        error_report("failed to reset virgl resources");
+        return -1;

It shouldn't report an error if suspended.

Could you please expand on what you're meaning by "suspended"?

Suppose you're talking about guest's kernel suspension. There was a
discussion on [1] RE a need to use `x-pcie-pm-no-soft-reset=true` option
to avoid virtio-gpu resetting across S3 suspend-resume. This option
works with virtio-vga, but not with virtio-vga-gl device where VM hangs
on startup. So currently S3 doesn't work for virgl and needs further fixing.

[1]
https://lore.kernel.org/dri-devel/[email protected]/

Correction: `x-pcie-pm-no-soft-reset=true` works with virgl without
enabled hostmem. It's hostmem that doesn't work with the additional PCI bus.

No, I meant that virtio_gpu_virgl_resource_unref() may set *cmd_suspended true. If that happens, QTAILQ_EMPTY(&g->reslist) will be false, but it is fine so no error log should be emitted.


I'll add a clarifying comment to the code in v4 telling that virgl shall
not be reset at runtime.

It is confusing what "runtime" refers to. This code doesn't care about S3 so such a comment shouldn't be necessary.

Regards,
Akihiko Odaki

Reply via email to