[PATCH 0/8] virtio-gpu/next - misc fixes and MR handling

Alex Bennée posted 8 patches 3 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251014111234.3190346-1-alex.bennee@linaro.org
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>, Paolo Bonzini <pbonzini@redhat.com>, Peter Xu <peterx@redhat.com>, David Hildenbrand <david@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>
qapi/virtio.json                          | 10 +++-
include/system/memory.h                   |  1 +
hw/display/virtio-gpu-base.c              | 10 ++++
hw/display/virtio-gpu-virgl.c             | 62 +++++++++++--------
system/memory.c                           |  5 ++
ui/gtk-gl-area.c                          |  1 -
hw/display/trace-events                   |  2 +
system/trace-events                       |  1 +
tests/functional/aarch64/meson.build      |  1 +
tests/functional/aarch64/test_gpu_blob.py | 73 +++++++++++++++++++++++
10 files changed, 138 insertions(+), 28 deletions(-)
create mode 100755 tests/functional/aarch64/test_gpu_blob.py
[PATCH 0/8] virtio-gpu/next - misc fixes and MR handling
Posted by Alex Bennée 3 months, 3 weeks ago
I still have a number of patches that addressed a lock-up but were
never merged due to objections. However there is a bunch of discussion
around re-factoring the MemoryRegion code so I'm re-posting with an
additional functional test which demonstrates the lock-up is fixed.
Whatever the final solution for more cleanly handling the binding
between MemoryRegions and blobs it will at least need to pass the
test.

Blob memory issues aside I'll send a PR next week to merge the
per-head and ui/gtk-gl-area changes.

Discuss,

Alex.

Alex Bennée (4):
  system/memory: add memory_region_finalize tracepoint
  hw/display: add blob map/unmap trace events
  hw/display: re-arrange memory region tracking
  tests/functional: add GPU blob allocation test

Andrew Keesler (1):
  Support per-head resolutions with virtio-gpu

Dongwon Kim (1):
  ui/gtk-gl-area: Remove extra draw call in refresh

Manos Pitsidianakis (2):
  virtio-gpu: refactor async blob unmapping
  virtio-gpu: fix hang under TCG when unmapping blob

 qapi/virtio.json                          | 10 +++-
 include/system/memory.h                   |  1 +
 hw/display/virtio-gpu-base.c              | 10 ++++
 hw/display/virtio-gpu-virgl.c             | 62 +++++++++++--------
 system/memory.c                           |  5 ++
 ui/gtk-gl-area.c                          |  1 -
 hw/display/trace-events                   |  2 +
 system/trace-events                       |  1 +
 tests/functional/aarch64/meson.build      |  1 +
 tests/functional/aarch64/test_gpu_blob.py | 73 +++++++++++++++++++++++
 10 files changed, 138 insertions(+), 28 deletions(-)
 create mode 100755 tests/functional/aarch64/test_gpu_blob.py

-- 
2.47.3


Re: [PATCH 0/8] virtio-gpu/next - misc fixes and MR handling
Posted by Michael Tokarev 2 months, 3 weeks ago
Hi!

2 changes from this series has been applied to the master branch:

  9f714c4b20 hw/display: add blob map/unmap trace events
  0c6d6d79a5 ui/gtk-gl-area: Remove extra draw call in refresh

but the rest weren't.  And it looks like some are worth to be
considered at least.

Alex, maybe you can refresh the series and re-send?
We're entering feature freeze stage with 10.2..

Thanks,

/mjt

On 10/14/25 14:12, Alex Bennée wrote:
> I still have a number of patches that addressed a lock-up but were
> never merged due to objections. However there is a bunch of discussion
> around re-factoring the MemoryRegion code so I'm re-posting with an
> additional functional test which demonstrates the lock-up is fixed.
> Whatever the final solution for more cleanly handling the binding
> between MemoryRegions and blobs it will at least need to pass the
> test.
> 
> Blob memory issues aside I'll send a PR next week to merge the
> per-head and ui/gtk-gl-area changes.
> 
> Discuss,
> 
> Alex.
> 
> Alex Bennée (4):
>    system/memory: add memory_region_finalize tracepoint
>    hw/display: add blob map/unmap trace events
>    hw/display: re-arrange memory region tracking
>    tests/functional: add GPU blob allocation test
> 
> Andrew Keesler (1):
>    Support per-head resolutions with virtio-gpu
> 
> Dongwon Kim (1):
>    ui/gtk-gl-area: Remove extra draw call in refresh
> 
> Manos Pitsidianakis (2):
>    virtio-gpu: refactor async blob unmapping
>    virtio-gpu: fix hang under TCG when unmapping blob
> 
>   qapi/virtio.json                          | 10 +++-
>   include/system/memory.h                   |  1 +
>   hw/display/virtio-gpu-base.c              | 10 ++++
>   hw/display/virtio-gpu-virgl.c             | 62 +++++++++++--------
>   system/memory.c                           |  5 ++
>   ui/gtk-gl-area.c                          |  1 -
>   hw/display/trace-events                   |  2 +
>   system/trace-events                       |  1 +
>   tests/functional/aarch64/meson.build      |  1 +
>   tests/functional/aarch64/test_gpu_blob.py | 73 +++++++++++++++++++++++
>   10 files changed, 138 insertions(+), 28 deletions(-)
>   create mode 100755 tests/functional/aarch64/test_gpu_blob.py
> 


Re: [PATCH 0/8] virtio-gpu/next - misc fixes and MR handling
Posted by Alex Bennée 2 months, 3 weeks ago
Michael Tokarev <mjt@tls.msk.ru> writes:

> Hi!
>
> 2 changes from this series has been applied to the master branch:
>
>  9f714c4b20 hw/display: add blob map/unmap trace events
>  0c6d6d79a5 ui/gtk-gl-area: Remove extra draw call in refresh
>
> but the rest weren't.  And it looks like some are worth to be
> considered at least.
>
> Alex, maybe you can refresh the series and re-send?
> We're entering feature freeze stage with 10.2..

There were problems with the other patches leading to leaks in
MemoryRegions. Akihiko has been looking at alternatives patches to
re-factor MemoryRegion handling and also investigating the sub-optimal
RCU behaviour that causes the test case (patch 8) to lock up on the
current master.

Longer term I wonder if there is a better backend we can use that avoids
the need for the complex blob/MemoryRegion dance we currently do between
threads?

>
> Thanks,
>
> /mjt
>
> On 10/14/25 14:12, Alex Bennée wrote:
>> I still have a number of patches that addressed a lock-up but were
>> never merged due to objections. However there is a bunch of discussion
>> around re-factoring the MemoryRegion code so I'm re-posting with an
>> additional functional test which demonstrates the lock-up is fixed.
>> Whatever the final solution for more cleanly handling the binding
>> between MemoryRegions and blobs it will at least need to pass the
>> test.
>> Blob memory issues aside I'll send a PR next week to merge the
>> per-head and ui/gtk-gl-area changes.
>> Discuss,
>> Alex.
>> Alex Bennée (4):
>>    system/memory: add memory_region_finalize tracepoint
>>    hw/display: add blob map/unmap trace events
>>    hw/display: re-arrange memory region tracking
>>    tests/functional: add GPU blob allocation test
>> Andrew Keesler (1):
>>    Support per-head resolutions with virtio-gpu
>> Dongwon Kim (1):
>>    ui/gtk-gl-area: Remove extra draw call in refresh
>> Manos Pitsidianakis (2):
>>    virtio-gpu: refactor async blob unmapping
>>    virtio-gpu: fix hang under TCG when unmapping blob
>>   qapi/virtio.json                          | 10 +++-
>>   include/system/memory.h                   |  1 +
>>   hw/display/virtio-gpu-base.c              | 10 ++++
>>   hw/display/virtio-gpu-virgl.c             | 62 +++++++++++--------
>>   system/memory.c                           |  5 ++
>>   ui/gtk-gl-area.c                          |  1 -
>>   hw/display/trace-events                   |  2 +
>>   system/trace-events                       |  1 +
>>   tests/functional/aarch64/meson.build      |  1 +
>>   tests/functional/aarch64/test_gpu_blob.py | 73 +++++++++++++++++++++++
>>   10 files changed, 138 insertions(+), 28 deletions(-)
>>   create mode 100755 tests/functional/aarch64/test_gpu_blob.py
>> 

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro
Re: [PATCH 0/8] virtio-gpu/next - misc fixes and MR handling
Posted by Dmitry Osipenko 2 months, 3 weeks ago
On 11/17/25 12:32, Alex Bennée wrote:
> Michael Tokarev <mjt@tls.msk.ru> writes:
> 
>> Hi!
>>
>> 2 changes from this series has been applied to the master branch:
>>
>>  9f714c4b20 hw/display: add blob map/unmap trace events
>>  0c6d6d79a5 ui/gtk-gl-area: Remove extra draw call in refresh
>>
>> but the rest weren't.  And it looks like some are worth to be
>> considered at least.
>>
>> Alex, maybe you can refresh the series and re-send?
>> We're entering feature freeze stage with 10.2..
> 
> There were problems with the other patches leading to leaks in
> MemoryRegions. Akihiko has been looking at alternatives patches to
> re-factor MemoryRegion handling and also investigating the sub-optimal
> RCU behaviour that causes the test case (patch 8) to lock up on the
> current master.
> 
> Longer term I wonder if there is a better backend we can use that avoids
> the need for the complex blob/MemoryRegion dance we currently do between
> threads?

The MAP_FIXED feature will close MR problems [1].

[1]
https://lore.kernel.org/qemu-devel/20251116141427.2325372-3-dmitry.osipenko@collabora.com/

-- 
Best regards,
Dmitry