[PATCH] virtio-gpu-rutabaga: make sure ctx_ids match

Gurchetan Singh posted 1 patch 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20261005174522.8663-1-gurchetan.singh.foss@gmail.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Dmitry Osipenko <dmitry.osipenko@collabora.com>
There is a newer version of this series
hw/display/virtio-gpu-rutabaga.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] virtio-gpu-rutabaga: make sure ctx_ids match
Posted by Gurchetan Singh 1 month, 2 weeks ago
The ctx_ids need to match as well as the ring ids for
proper signaling.

Fixes: 1dcc6adbc168 ("gfxstream + rutabaga: add initial support for gfxstream")
Signed-off-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
---
 hw/display/virtio-gpu-rutabaga.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/display/virtio-gpu-rutabaga.c b/hw/display/virtio-gpu-rutabaga.c
index 3aafa4dc66..edf7b62703 100644
--- a/hw/display/virtio-gpu-rutabaga.c
+++ b/hw/display/virtio-gpu-rutabaga.c
@@ -902,7 +902,8 @@ virtio_gpu_rutabaga_aio_cb(void *opaque)
         }
 
         if (signaled_ctx_specific &&
-           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx)) {
+           ((cmd->cmd_hdr.ctx_id != fence_data.ctx_id) ||
+           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx))) {
             continue;
         }
 
-- 
2.55.0
Re: [PATCH] virtio-gpu-rutabaga: make sure ctx_ids match
Posted by Marc-André Lureau 1 month, 2 weeks ago
Hi

On Mon, Oct 5, 2026 at 11:00 PM Gurchetan Singh
<gurchetan.singh.foss@gmail.com> wrote:
>
> The ctx_ids need to match as well as the ring ids for
> proper signaling.
>
> Fixes: 1dcc6adbc168 ("gfxstream + rutabaga: add initial support for gfxstream")
> Signed-off-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
> ---
>  hw/display/virtio-gpu-rutabaga.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/display/virtio-gpu-rutabaga.c b/hw/display/virtio-gpu-rutabaga.c
> index 3aafa4dc66..edf7b62703 100644
> --- a/hw/display/virtio-gpu-rutabaga.c
> +++ b/hw/display/virtio-gpu-rutabaga.c
> @@ -902,7 +902,8 @@ virtio_gpu_rutabaga_aio_cb(void *opaque)
>          }
>
>          if (signaled_ctx_specific &&
> -           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx)) {
> +           ((cmd->cmd_hdr.ctx_id != fence_data.ctx_id) ||
> +           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx))) {
>              continue;
>          }

lgtm

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


btw Gurchetan, do you remember why virtio-gpu-pci-rutabaga.c is using
raw TypeInfo, and not VirtioPCIDeviceTypeInfo? Is it just an
oversight? I can send a patch if it's the case


thanks
>
> --
> 2.55.0
>
>
Re: [PATCH] virtio-gpu-rutabaga: make sure ctx_ids match
Posted by Akihiko Odaki 1 month, 2 weeks ago
On 2026/10/06 4:22, Marc-André Lureau wrote:
> Hi
> 
> On Mon, Oct 5, 2026 at 11:00 PM Gurchetan Singh
> <gurchetan.singh.foss@gmail.com> wrote:
>>
>> The ctx_ids need to match as well as the ring ids for
>> proper signaling.
>>
>> Fixes: 1dcc6adbc168 ("gfxstream + rutabaga: add initial support for gfxstream")
>> Signed-off-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
>> ---
>>   hw/display/virtio-gpu-rutabaga.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/display/virtio-gpu-rutabaga.c b/hw/display/virtio-gpu-rutabaga.c
>> index 3aafa4dc66..edf7b62703 100644
>> --- a/hw/display/virtio-gpu-rutabaga.c
>> +++ b/hw/display/virtio-gpu-rutabaga.c
>> @@ -902,7 +902,8 @@ virtio_gpu_rutabaga_aio_cb(void *opaque)
>>           }
>>
>>           if (signaled_ctx_specific &&
>> -           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx)) {
>> +           ((cmd->cmd_hdr.ctx_id != fence_data.ctx_id) ||
>> +           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx))) {
>>               continue;
>>           }
> 
> lgtm
> 
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
> 
> 
> btw Gurchetan, do you remember why virtio-gpu-pci-rutabaga.c is using
> raw TypeInfo, and not VirtioPCIDeviceTypeInfo? Is it just an
> oversight? I can send a patch if it's the case

It looks like an oversight to me as well.

Earlier revisions of the patch used VirtioPCIDeviceTypeInfo [1]. In v12, 
the code was converted to use DEFINE_TYPES() [2], and 
VirtioPCIDeviceTypeInfo was replaced with TypeInfo at the same time.

[1] 
https://lore.kernel.org/qemu-devel/20230823012541.485-7-gurchetansingh@chromium.org/
[2] 
https://lore.kernel.org/qemu-devel/20230824234046.499-7-gurchetansingh@chromium.org/

Regards,
Akihiko Odaki

Re: [PATCH] virtio-gpu-rutabaga: make sure ctx_ids match
Posted by Gurchetan Singh 1 month, 2 weeks ago
On Tue, Oct 6, 2026 at 3:50 AM Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
wrote:

> On 2026/10/06 4:22, Marc-André Lureau wrote:
> > Hi
> >
> > On Mon, Oct 5, 2026 at 11:00 PM Gurchetan Singh
> > <gurchetan.singh.foss@gmail.com> wrote:
> >>
> >> The ctx_ids need to match as well as the ring ids for
> >> proper signaling.
> >>
> >> Fixes: 1dcc6adbc168 ("gfxstream + rutabaga: add initial support for
> gfxstream")
> >> Signed-off-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
> >> ---
> >>   hw/display/virtio-gpu-rutabaga.c | 3 ++-
> >>   1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/hw/display/virtio-gpu-rutabaga.c
> b/hw/display/virtio-gpu-rutabaga.c
> >> index 3aafa4dc66..edf7b62703 100644
> >> --- a/hw/display/virtio-gpu-rutabaga.c
> >> +++ b/hw/display/virtio-gpu-rutabaga.c
> >> @@ -902,7 +902,8 @@ virtio_gpu_rutabaga_aio_cb(void *opaque)
> >>           }
> >>
> >>           if (signaled_ctx_specific &&
> >> -           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx)) {
> >> +           ((cmd->cmd_hdr.ctx_id != fence_data.ctx_id) ||
> >> +           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx))) {
> >>               continue;
> >>           }
> >
> > lgtm
> >
> > Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
> >
> >
> > btw Gurchetan, do you remember why virtio-gpu-pci-rutabaga.c is using
> > raw TypeInfo, and not VirtioPCIDeviceTypeInfo? Is it just an
> > oversight? I can send a patch if it's the case
>

I don't remember, but probably a random oversight yes.  Feel free to send
the patch and I will test.


>
> It looks like an oversight to me as well.
>
> Earlier revisions of the patch used VirtioPCIDeviceTypeInfo [1]. In v12,
> the code was converted to use DEFINE_TYPES() [2], and
> VirtioPCIDeviceTypeInfo was replaced with TypeInfo at the same time.

[1]
>
> https://lore.kernel.org/qemu-devel/20230823012541.485-7-gurchetansingh@chromium.org/
> [2]
>
> https://lore.kernel.org/qemu-devel/20230824234046.499-7-gurchetansingh@chromium.org/
>
> Regards,
> Akihiko Odaki
>