]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe/madvise: Accept canonical GPU addresses in xe_vm_madvise_ioctl
authorArvind Yadav <arvind.yadav@intel.com>
Thu, 26 Mar 2026 13:08:38 +0000 (18:38 +0530)
committerMatthew Brost <matthew.brost@intel.com>
Fri, 27 Mar 2026 02:59:54 +0000 (19:59 -0700)
commit05c8b1cdc54036465ea457a0501a8c2f9409fce7
tree0e02d4928b4bb8ebb9735d65fef41091c19ae290
parent4def73ec3d000a8347b2b63f4ecc5b1e3b476941
drm/xe/madvise: Accept canonical GPU addresses in xe_vm_madvise_ioctl

Userspace passes canonical (sign-extended) GPU addresses where bits 63:48
mirror bit 47. The internal GPUVM uses non-canonical form (upper bits
zeroed), so passing raw canonical addresses into GPUVM lookups causes
mismatches for addresses above 128TiB.

Strip the sign extension with xe_device_uncanonicalize_addr() at the
top of xe_vm_madvise_ioctl(). Non-canonical addresses are unaffected.

Fixes: ada7486c5668 ("drm/xe: Implement madvise ioctl for xe")
Suggested-by: Matthew Brost <matthew.brost@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Signed-off-by: Arvind Yadav <arvind.yadav@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260326130843.3545241-13-arvind.yadav@intel.com
drivers/gpu/drm/xe/xe_vm_madvise.c