<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/gpu/drm/vmwgfx, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>drm/vblank: Cancel vblank timer outside of critical section</title>
<updated>2026-11-17T14:40:36+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2026-11-10T08:45:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e109454dce1db5a5659509407305c849bc959af5'/>
<id>e109454dce1db5a5659509407305c849bc959af5</id>
<content type='text'>
Cancel the vblank timer's hrtimer after disabling the vblank timer to
avoid running timer function with outdated interval.

Stopping and restarting the vblank timer with a different interval can
leave behind an already-running timer function that uses the previous
interval. This can result in a vblank event with inconsistent timing. At
the same time, canceling the hrtimer in drm_crtc_vblank_cancel_timer() with
hrtimer_cancel() is not possible due to a deadlock between vblank_time_lock
and the hrtimer.

Resolve this problem by calling hrtimer_cancel() outside of
vblank_time_lock's critical section. Implement this with the new callback
sync_vblank in struct drm_crtc_funcs. Invoke this callback after switching
off the vblank. Some internal bookkeeping is necessary to ensure that the
timer is really switched off.

Implement sync_vblank for vblank timers with the new helper
drm_crtc_vblank_helper_sync_vblank_timer(). From there, the vblank function
drm_crtc_blank_stop_timer() stops the hrtimer unconditionally. Install
drm_crtc_vblank_helper_sync_vblank_timer() in most drivers via
DRM_CRTC_VBLANK_TIMER_FUNCS. Update vmwgfx, which does not use this macro.

Implement the locking in drm_crtc_vblank_cancel_timer() with a guard. Also
remove the call to hrtimer_try_to_cancel() from that function. It is no
longer needed with sync_vblank invoking hrtimer_cancel().

v2:
- handle uninitialized timer in drm_crtc_vblank_cancel_timer()

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20261110084710.503870-3-tzimmermann@suse.de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cancel the vblank timer's hrtimer after disabling the vblank timer to
avoid running timer function with outdated interval.

Stopping and restarting the vblank timer with a different interval can
leave behind an already-running timer function that uses the previous
interval. This can result in a vblank event with inconsistent timing. At
the same time, canceling the hrtimer in drm_crtc_vblank_cancel_timer() with
hrtimer_cancel() is not possible due to a deadlock between vblank_time_lock
and the hrtimer.

Resolve this problem by calling hrtimer_cancel() outside of
vblank_time_lock's critical section. Implement this with the new callback
sync_vblank in struct drm_crtc_funcs. Invoke this callback after switching
off the vblank. Some internal bookkeeping is necessary to ensure that the
timer is really switched off.

Implement sync_vblank for vblank timers with the new helper
drm_crtc_vblank_helper_sync_vblank_timer(). From there, the vblank function
drm_crtc_blank_stop_timer() stops the hrtimer unconditionally. Install
drm_crtc_vblank_helper_sync_vblank_timer() in most drivers via
DRM_CRTC_VBLANK_TIMER_FUNCS. Update vmwgfx, which does not use this macro.

Implement the locking in drm_crtc_vblank_cancel_timer() with a guard. Also
remove the call to hrtimer_try_to_cancel() from that function. It is no
longer needed with sync_vblank invoking hrtimer_cancel().

v2:
- handle uninitialized timer in drm_crtc_vblank_cancel_timer()

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20261110084710.503870-3-tzimmermann@suse.de
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix NULL vs error pointer bug in vmw_prime_import_sg_table()</title>
<updated>2026-11-17T01:39:53+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2026-06-30T13:32:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1914e9ac680d04613d25e545a2733d2e4d870fe3'/>
<id>1914e9ac680d04613d25e545a2733d2e4d870fe3</id>
<content type='text'>
The vmw_prime_import_sg_table() function is expected to return error
pointers on error and not NULL.  Otherwise it leads to a NULL dereference
in the caller drm_gem_prime_import_dev().

Propagate the error code from vmw_bo_create().

Fixes: b32233acceff ("drm/vmwgfx: Fix prime import/export")
Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/akPFZ-e9usvsYgf_@stanley.mountain
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The vmw_prime_import_sg_table() function is expected to return error
pointers on error and not NULL.  Otherwise it leads to a NULL dereference
in the caller drm_gem_prime_import_dev().

Propagate the error code from vmw_bo_create().

Fixes: b32233acceff ("drm/vmwgfx: Fix prime import/export")
Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/akPFZ-e9usvsYgf_@stanley.mountain
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: fix NULL pointer dereference in vmw_validation_bo_fence()</title>
<updated>2026-11-17T01:39:51+00:00</updated>
<author>
<name>Vladimir Popov</name>
<email>popov.nkv@gmail.com</email>
</author>
<published>2026-04-14T10:55:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=06f8a6708a98dff199ef7ea553b092efc38b4eab'/>
<id>06f8a6708a98dff199ef7ea553b092efc38b4eab</id>
<content type='text'>
If vmw_execbuf_fence_commands() call fails in
vmw_kms_helper_validation_finish(), it sets *p_fence = NULL. If
ctx-&gt;bo_list is not empty, the caller, vmw_kms_helper_validation_finish(),
passes the fence through a chain of functions to dma_fence_is_array(),
which causes a NULL pointer dereference in dma_fence_is_array():

vmw_kms_helper_validation_finish() // pass NULL fence
  vmw_validation_done()
    vmw_validation_bo_fence()
      ttm_eu_fence_buffer_objects() // pass NULL fence
        dma_resv_add_fence()
          dma_fence_is_container()
            dma_fence_is_array() // NULL deref

Fix this by adding a NULL check in vmw_validation_bo_fence(): if the fence
is NULL, fall back to ttm_eu_backoff_reservation()to safely release
the buffer object reservations without attempting to add a NULL fence to
dma_resv. This is safe because when fence is NULL, vmw_fallback_wait()
has already been called inside vmw_execbuf_fence_commands() to synchronize
the GPU.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 038ecc503236 ("drm/vmwgfx: Add a validation module v2")
Cc: stable@vger.kernel.org
Signed-off-by: Vladimir Popov &lt;popov.nkv@gmail.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20260414105529.9883-1-popov.nkv@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If vmw_execbuf_fence_commands() call fails in
vmw_kms_helper_validation_finish(), it sets *p_fence = NULL. If
ctx-&gt;bo_list is not empty, the caller, vmw_kms_helper_validation_finish(),
passes the fence through a chain of functions to dma_fence_is_array(),
which causes a NULL pointer dereference in dma_fence_is_array():

vmw_kms_helper_validation_finish() // pass NULL fence
  vmw_validation_done()
    vmw_validation_bo_fence()
      ttm_eu_fence_buffer_objects() // pass NULL fence
        dma_resv_add_fence()
          dma_fence_is_container()
            dma_fence_is_array() // NULL deref

Fix this by adding a NULL check in vmw_validation_bo_fence(): if the fence
is NULL, fall back to ttm_eu_backoff_reservation()to safely release
the buffer object reservations without attempting to add a NULL fence to
dma_resv. This is safe because when fence is NULL, vmw_fallback_wait()
has already been called inside vmw_execbuf_fence_commands() to synchronize
the GPU.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 038ecc503236 ("drm/vmwgfx: Add a validation module v2")
Cc: stable@vger.kernel.org
Signed-off-by: Vladimir Popov &lt;popov.nkv@gmail.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20260414105529.9883-1-popov.nkv@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: do not hand the embedded sg_table to the PRIME core</title>
<updated>2026-11-17T01:39:50+00:00</updated>
<author>
<name>Aldo Ariel Panzardo</name>
<email>qwe.aldo@gmail.com</email>
</author>
<published>2026-09-23T12:26:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=030e6d11d3e5eb7328f7a3e8177737a4b1c30654'/>
<id>030e6d11d3e5eb7328f7a3e8177737a4b1c30654</id>
<content type='text'>
vmw_gem_object_get_sg_table() returns vmw_tt-&gt;vsgt.sgt when the buffer
object has already been DMA mapped.  vmw_ttm_map_dma() sets that field
to &amp;vmw_tt-&gt;sgt, which is a member embedded inside the struct
vmw_ttm_tt allocation and not a table of its own.

The core owns whatever .get_sg_table returns.  drm_gem_map_dma_buf()
takes the table and drm_gem_unmap_dma_buf() destroys it in full:

	dma_unmap_sgtable(attach-&gt;dev, sgt, dir, DMA_ATTR_SKIP_CPU_SYNC);
	sg_free_table(sgt);
	kfree(sgt);

Both are ops of drm_gem_prime_dmabuf_ops, so the core ends up calling
kfree() on &amp;vmw_tt-&gt;sgt, which is not the start of an allocation.  The
preceding sg_free_table() also destroys a scatterlist that vmwgfx still
considers its own and frees again from vmw_ttm_unmap_dma().

drm_gem_unmap_dma_buf() runs from dma_buf_detach(), including the
importer's error path, so a failed import is enough to reach it:
exporting a bound buffer with DRM_IOCTL_PRIME_HANDLE_TO_FD and
importing it on a second DRM device with DRM_IOCTL_PRIME_FD_TO_HANDLE
is sufficient.  Both ioctls are DRM_RENDER_ALLOW.

Observed on 6.12.101 with KASAN, as uid 65534:

  BUG: KASAN: invalid-free in drm_gem_unmap_dma_buf+0xb3/0xf0
  Free of addr ffff888008290450 by task poc_mm04_sgtabl/321
  CPU: 1 UID: 65534 PID: 321 Comm: poc_mm04_sgtabl Not tainted 6.12.101 #4
   kasan_report_invalid_free+0x94/0xc0
   check_slab_allocation+0x116/0x120
   kfree+0x103/0x360
   drm_gem_unmap_dma_buf+0xb3/0xf0
   dma_buf_detach+0x165/0x510
   drm_gem_prime_import_dev+0x33e/0x430
  which belongs to the cache kmalloc-192 of size 192
  The buggy address is located 80 bytes inside of
   144-byte region [ffff888008290400, ffff888008290490)

80 is offsetof(struct vmw_ttm_tt, sgt) and 144 is sizeof(struct
vmw_ttm_tt), which identifies the freed pointer as the embedded member.

Always return a table the core can own, as the other drivers do.
Reusing the cached representation would require copying it into a
freshly allocated sg_table, never returning the alias.

Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM")
Cc: stable@vger.kernel.org
Signed-off-by: Aldo Ariel Panzardo &lt;qwe.aldo@gmail.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20260923122601.438892-1-qwe.aldo@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vmw_gem_object_get_sg_table() returns vmw_tt-&gt;vsgt.sgt when the buffer
object has already been DMA mapped.  vmw_ttm_map_dma() sets that field
to &amp;vmw_tt-&gt;sgt, which is a member embedded inside the struct
vmw_ttm_tt allocation and not a table of its own.

The core owns whatever .get_sg_table returns.  drm_gem_map_dma_buf()
takes the table and drm_gem_unmap_dma_buf() destroys it in full:

	dma_unmap_sgtable(attach-&gt;dev, sgt, dir, DMA_ATTR_SKIP_CPU_SYNC);
	sg_free_table(sgt);
	kfree(sgt);

Both are ops of drm_gem_prime_dmabuf_ops, so the core ends up calling
kfree() on &amp;vmw_tt-&gt;sgt, which is not the start of an allocation.  The
preceding sg_free_table() also destroys a scatterlist that vmwgfx still
considers its own and frees again from vmw_ttm_unmap_dma().

drm_gem_unmap_dma_buf() runs from dma_buf_detach(), including the
importer's error path, so a failed import is enough to reach it:
exporting a bound buffer with DRM_IOCTL_PRIME_HANDLE_TO_FD and
importing it on a second DRM device with DRM_IOCTL_PRIME_FD_TO_HANDLE
is sufficient.  Both ioctls are DRM_RENDER_ALLOW.

Observed on 6.12.101 with KASAN, as uid 65534:

  BUG: KASAN: invalid-free in drm_gem_unmap_dma_buf+0xb3/0xf0
  Free of addr ffff888008290450 by task poc_mm04_sgtabl/321
  CPU: 1 UID: 65534 PID: 321 Comm: poc_mm04_sgtabl Not tainted 6.12.101 #4
   kasan_report_invalid_free+0x94/0xc0
   check_slab_allocation+0x116/0x120
   kfree+0x103/0x360
   drm_gem_unmap_dma_buf+0xb3/0xf0
   dma_buf_detach+0x165/0x510
   drm_gem_prime_import_dev+0x33e/0x430
  which belongs to the cache kmalloc-192 of size 192
  The buggy address is located 80 bytes inside of
   144-byte region [ffff888008290400, ffff888008290490)

80 is offsetof(struct vmw_ttm_tt, sgt) and 144 is sizeof(struct
vmw_ttm_tt), which identifies the freed pointer as the embedded member.

Always return a table the core can own, as the other drivers do.
Reusing the cached representation would require copying it into a
freshly allocated sg_table, never returning the alias.

Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM")
Cc: stable@vger.kernel.org
Signed-off-by: Aldo Ariel Panzardo &lt;qwe.aldo@gmail.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20260923122601.438892-1-qwe.aldo@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: close TOCTOU on guest_memory_bo in surface reference ioctl</title>
<updated>2026-11-17T01:39:49+00:00</updated>
<author>
<name>Aldo Ariel Panzardo</name>
<email>qwe.aldo@gmail.com</email>
</author>
<published>2026-10-07T21:20:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=30131b82b062180183a09a97183a944fadab72ee'/>
<id>30131b82b062180183a09a97183a944fadab72ee</id>
<content type='text'>
vmw_gb_surface_reference_internal() checks srf-&gt;res.guest_memory_bo
for NULL and reads its vma_node offset and base.size outside the
cmdbuf_mutex scope that protects the backup pointer.

A concurrent backup switch, e.g. from SVGA_3D_CMD_BIND_GB_SURFACE
via vmw_resource_unreserve(), drops its reference to the old buffer
and installs a new one under cmdbuf_mutex. The unlocked check in
the surface reference ioctl can see a transient NULL. The reads
after the unlock can return another buffer's offset and size; a
further switch can drop that buffer's last reference and free it
while the ioctl reads from it.

Move the NULL check inside the mutex, and read buffer_map_handle
and buffer_size while still holding it.

Fixes: a97e21923b42 ("drm/vmwgfx: Hook up guest-backed surfaces")
Cc: stable@vger.kernel.org
Reported-by: Sashiko &lt;sashiko-bot@kernel.org&gt;
Closes: https://lore.kernel.org/r/20260808233347.209DD1F000E9@smtp.kernel.org
Signed-off-by: Aldo Ariel Panzardo &lt;qwe.aldo@gmail.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20261007212051.2574235-3-qwe.aldo@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vmw_gb_surface_reference_internal() checks srf-&gt;res.guest_memory_bo
for NULL and reads its vma_node offset and base.size outside the
cmdbuf_mutex scope that protects the backup pointer.

A concurrent backup switch, e.g. from SVGA_3D_CMD_BIND_GB_SURFACE
via vmw_resource_unreserve(), drops its reference to the old buffer
and installs a new one under cmdbuf_mutex. The unlocked check in
the surface reference ioctl can see a transient NULL. The reads
after the unlock can return another buffer's offset and size; a
further switch can drop that buffer's last reference and free it
while the ioctl reads from it.

Move the NULL check inside the mutex, and read buffer_map_handle
and buffer_size while still holding it.

Fixes: a97e21923b42 ("drm/vmwgfx: Hook up guest-backed surfaces")
Cc: stable@vger.kernel.org
Reported-by: Sashiko &lt;sashiko-bot@kernel.org&gt;
Closes: https://lore.kernel.org/r/20260808233347.209DD1F000E9@smtp.kernel.org
Signed-off-by: Aldo Ariel Panzardo &lt;qwe.aldo@gmail.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20261007212051.2574235-3-qwe.aldo@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: return an error when a shared GB surface has no backup buffer</title>
<updated>2026-11-17T01:39:47+00:00</updated>
<author>
<name>Aldo Ariel Panzardo</name>
<email>qwe.aldo@gmail.com</email>
</author>
<published>2026-10-07T21:20:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3a2f97af36754b64083d463a4cee0af26826bec8'/>
<id>3a2f97af36754b64083d463a4cee0af26826bec8</id>
<content type='text'>
vmw_gb_surface_reference_internal() rejects a surface that has no backup
buffer by logging an error and jumping to out_bad_resource, but it never
sets ret on that path. ret is still 0 from the earlier successful
vmw_surface_handle_reference(), so the ioctl returns success while
leaving the reply structure unfilled — user space is handed a
"successful" reply that was never produced. DRM_VMW_GB_SURFACE_REF is
DRM_RENDER_ALLOW, so an unprivileged local user can reach it.

Set ret to -EINVAL and, on the error paths, drop the reference that
vmw_surface_handle_reference() took; once the ioctl fails user space no
longer releases it via DRM_VMW_UNREF_SURFACE. The unref is guarded by
ret so the shared success fall-through keeps the reference the caller
still owns, and it also plugs the same leak on the drm_gem_handle_create()
failure path.

Fixes: 14b1c33e8429 ("drm/vmwgfx: Add new ioctl for GB surface create and reference")
Cc: stable@vger.kernel.org
Suggested-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Aldo Ariel Panzardo &lt;qwe.aldo@gmail.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
[zack: aligned a continuation line with the open parenthesis]
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20261007212051.2574235-2-qwe.aldo@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vmw_gb_surface_reference_internal() rejects a surface that has no backup
buffer by logging an error and jumping to out_bad_resource, but it never
sets ret on that path. ret is still 0 from the earlier successful
vmw_surface_handle_reference(), so the ioctl returns success while
leaving the reply structure unfilled — user space is handed a
"successful" reply that was never produced. DRM_VMW_GB_SURFACE_REF is
DRM_RENDER_ALLOW, so an unprivileged local user can reach it.

Set ret to -EINVAL and, on the error paths, drop the reference that
vmw_surface_handle_reference() took; once the ioctl fails user space no
longer releases it via DRM_VMW_UNREF_SURFACE. The unref is guarded by
ret so the shared success fall-through keeps the reference the caller
still owns, and it also plugs the same leak on the drm_gem_handle_create()
failure path.

Fixes: 14b1c33e8429 ("drm/vmwgfx: Add new ioctl for GB surface create and reference")
Cc: stable@vger.kernel.org
Suggested-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Aldo Ariel Panzardo &lt;qwe.aldo@gmail.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
[zack: aligned a continuation line with the open parenthesis]
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20261007212051.2574235-2-qwe.aldo@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: log MOB limits outside the manager spinlock</title>
<updated>2026-11-16T20:09:37+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-10-29T06:22:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=eee4285a8c3c918bbd21791e17f2bb261a709792'/>
<id>eee4285a8c3c918bbd21791e17f2bb261a709792</id>
<content type='text'>
vmw_gmrid_man_get_node reports MOB limit expansion and allocation
failures through vmw_host_printf while holding gman-&gt;lock. The helper
formats its messages with GFP_KERNEL allocations, which may sleep.

KDE startup and desktop mode changes can reach this path, producing
"BUG: sleeping function called from invalid context" from kvasprintf()
while the manager spinlock is held. That's likely a separate bug
because KDE shouldn't be using that much memory but to debug
that properly stop filling kernel logs with warnings.

Defer both host messages until after dropping the spinlock. Capture the
failed allocation's page limit and roll back its accounting while locked,
then report the error and free the resource after unlocking. Use
drm_warn for the guest messages so they identify the device.

Fixes: cfdc3458db8a ("drm/vmwgfx: Be a lot more flexible with MOB limits")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Maaz Mombasawala &lt;maaz.mombasawala@broadcom.com&gt;
Link: https://patch.msgid.link/20261029215700.3009996-1-zack.rusin@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vmw_gmrid_man_get_node reports MOB limit expansion and allocation
failures through vmw_host_printf while holding gman-&gt;lock. The helper
formats its messages with GFP_KERNEL allocations, which may sleep.

KDE startup and desktop mode changes can reach this path, producing
"BUG: sleeping function called from invalid context" from kvasprintf()
while the manager spinlock is held. That's likely a separate bug
because KDE shouldn't be using that much memory but to debug
that properly stop filling kernel logs with warnings.

Defer both host messages until after dropping the spinlock. Capture the
failed allocation's page limit and roll back its accounting while locked,
then report the error and free the resource after unlocking. Use
drm_warn for the guest messages so they identify the device.

Fixes: cfdc3458db8a ("drm/vmwgfx: Be a lot more flexible with MOB limits")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Maaz Mombasawala &lt;maaz.mombasawala@broadcom.com&gt;
Link: https://patch.msgid.link/20261029215700.3009996-1-zack.rusin@broadcom.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: log missing primary planes only once</title>
<updated>2026-11-16T20:09:37+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2026-10-29T05:26:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f01848d84577e5860a187eea64f5321acaf1f893'/>
<id>f01848d84577e5860a187eea64f5321acaf1f893</id>
<content type='text'>
Stop filling kernel logs due to something that's not even a bug. Some
igt tests, e.g. kms_flip trigger this message ~17000 times which makes
all the other diagnostics almost impossible to find.

Just inform the user about this condition once and let it through
afterward.

Fixes: a60ccade88f9 ("drm/vmwgfx: Fix crtc's atomic check conditional")
Cc: stable@vger.kernel.org
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Maaz Mombasawala &lt;maaz.mombasawala@broadcom.com&gt;
Link: https://patch.msgid.link/20261029215540.3008997-1-zack.rusin@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Stop filling kernel logs due to something that's not even a bug. Some
igt tests, e.g. kms_flip trigger this message ~17000 times which makes
all the other diagnostics almost impossible to find.

Just inform the user about this condition once and let it through
afterward.

Fixes: a60ccade88f9 ("drm/vmwgfx: Fix crtc's atomic check conditional")
Cc: stable@vger.kernel.org
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Maaz Mombasawala &lt;maaz.mombasawala@broadcom.com&gt;
Link: https://patch.msgid.link/20261029215540.3008997-1-zack.rusin@broadcom.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Check whether CRTC is active when updating planes</title>
<updated>2026-11-16T20:09:36+00:00</updated>
<author>
<name>Ian Forbes</name>
<email>ian.forbes@broadcom.com</email>
</author>
<published>2026-05-22T19:53:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0771ae93718bb016f80eb8e7d4b43135ad168999'/>
<id>0771ae93718bb016f80eb8e7d4b43135ad168999</id>
<content type='text'>
The IGT test kms_universal_plane triggers the error condition in this
branch because the screen target is not defined.

Also access the STDU via the plane since it's guaranteed to be non-null.

Fixes: e05162c017e2 ("drm: Store new plane state in a variable for atomic_update and disable")
Signed-off-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20260522195303.797091-1-ian.forbes@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The IGT test kms_universal_plane triggers the error condition in this
branch because the screen target is not defined.

Also access the STDU via the plane since it's guaranteed to be non-null.

Fixes: e05162c017e2 ("drm: Store new plane state in a variable for atomic_update and disable")
Signed-off-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20260522195303.797091-1-ian.forbes@broadcom.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Never destroy STDU zero's Screen Target</title>
<updated>2026-11-16T20:09:36+00:00</updated>
<author>
<name>Ian Forbes</name>
<email>ian.forbes@broadcom.com</email>
</author>
<published>2026-05-14T15:31:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d3cbc7400e075eb8b50845fe0bb9fa2ad560df60'/>
<id>d3cbc7400e075eb8b50845fe0bb9fa2ad560df60</id>
<content type='text'>
When some VMware clients connect to a VM they query the existing screen
target information to create a window of the same size. If the VM
display is asleep and the CRTC is disabled we don't have a screen target
and the client will not create a window which may lead it to have no
way of accepting user input.

Without input the VM cannot be awoken and the user is left with a blank
screen. This can be overcome by using the 'Send Key' command from the
client's application menu but this is not an ideal experience for users.

This can be fixed by always leaving display unit zero with a screen target.

Fixes: 7ef91dcba172 ("drm/vmwgfx: Don't destroy Screen Target when CRTC is enabled but inactive")
Signed-off-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20260514153103.1465013-1-ian.forbes@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When some VMware clients connect to a VM they query the existing screen
target information to create a window of the same size. If the VM
display is asleep and the CRTC is disabled we don't have a screen target
and the client will not create a window which may lead it to have no
way of accepting user input.

Without input the VM cannot be awoken and the user is left with a blank
screen. This can be overcome by using the 'Send Key' command from the
client's application menu but this is not an ideal experience for users.

This can be fixed by always leaving display unit zero with a screen target.

Fixes: 7ef91dcba172 ("drm/vmwgfx: Don't destroy Screen Target when CRTC is enabled but inactive")
Signed-off-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patch.msgid.link/20260514153103.1465013-1-ian.forbes@broadcom.com
</pre>
</div>
</content>
</entry>
</feed>
