dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] accel/amdxdna: SYNC_BO correctness fixes
@ 2026-08-13 18:33 Taimuraz Kaitmazov
  2026-08-13 16:46 ` Taimuraz Kaitmazov
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Taimuraz Kaitmazov @ 2026-08-13 18:33 UTC (permalink / raw)
  To: dri-devel

Three independent fixes in and around amdxdna_drm_sync_bo_ioctl(). None of
them depend on each other.

Patch 1 refuses an I/O memory mapping of an imported BO, which the driver
currently stores as if it were an ordinary kernel address. Patches 2 and 3
fix two ways the ioctl mishandles its own range: a zero length reaching
drm_clflush_virt_range(), and an offset and size added to the BO address
without an overflow check, one level above a function that checks the same
arithmetic.

Changes in v3:
  - dropped the range patch ("flush only the requested range") and the
    quiet-vmap patch that existed only to serve it. Christian NAKed
    flushing an imported dma-buf, and the numbers in that patch came from
    exactly that case; I also have not tested its premise on a matching
    tree.
  - patch 1: corrected a wrong sentence in the commit message about which
    errno drm_gem_vmap_locked() returns.
  - patch 2: also says what changes for an imported BO, where a zero-length
    request currently flushes the whole scatterlist.

Refusing a sync on a genuinely foreign import is still being discussed on
the v2 thread and is not part of this series.

v2: https://lore.kernel.org/all/20260811231351.1011244-1-taimuraz@kaitmazov.com/

Compile-tested on drm-misc-next only: x86_64 defconfig with
DRM_ACCEL_AMDXDNA=m, gcc 16.2.1, no W=1 warnings. Not booted, and not run
on hardware.

Taimuraz Kaitmazov (3):
  accel/amdxdna: refuse an I/O memory mapping of an imported BO
  accel/amdxdna: return early from a zero-length flush
  accel/amdxdna: check the sync range for overflow on a device BO

 drivers/accel/amdxdna/amdxdna_gem.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-08-26 17:18 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13 18:33 [PATCH v3 0/3] accel/amdxdna: SYNC_BO correctness fixes Taimuraz Kaitmazov
2026-08-13 16:46 ` Taimuraz Kaitmazov
2026-08-13 18:33 ` [PATCH v3 1/3] accel/amdxdna: refuse an I/O memory mapping of an imported BO Taimuraz Kaitmazov
2026-08-13 16:46   ` Taimuraz Kaitmazov
2026-08-14  7:21     ` sashiko-bot
2026-08-17 17:53   ` Lizhi Hou
2026-08-24 14:06     ` Christian König
2026-08-24 16:08       ` Lizhi Hou
2026-08-26  8:37         ` Christian König
2026-08-26 17:18           ` Lizhi Hou
2026-08-13 18:33 ` [PATCH v3 2/3] accel/amdxdna: return early from a zero-length flush Taimuraz Kaitmazov
2026-08-13 16:46   ` Taimuraz Kaitmazov
2026-08-14  7:18     ` sashiko-bot
2026-08-13 18:33 ` [PATCH v3 3/3] accel/amdxdna: check the sync range for overflow on a device BO Taimuraz Kaitmazov
2026-08-13 16:47   ` Taimuraz Kaitmazov
2026-08-14  7:22     ` sashiko-bot
2026-08-13 18:51   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox