Re: [RFC PATCH] drm/gpusvm: reject device pages not owned by the caller

From: Praneeth Balasubramanian

Date: Sat Dec 05 2026 - 03:21:38 EST


On Sat, 05 Dec 2026 07:03:31 +0000, sashiko-bot@xxxxxxxxxx wrote:
> [Severity: High]
> Can returning -EOPNOTSUPP here livelock Xe GPU page fault handling on
> foreign device coherent pages?

Yes. __xe_svm_handle_pagefault() retries -EOPNOTSUPP, -EFAULT and -EPERM
without a bound when devmem_only is not set, and
drm_gpusvm_range_evict() leaves a present device coherent page where it
is. So v2 returns -EINVAL for a foreign page, which ends the fault. The
userptr path returns it to the caller as before.

> Should this include:
>
> Fixes: 99624bdff867 ("drm/gpusvm: Add support for GPU Shared Virtual Memory")

Yes, that commit already read zone_device_data as a zdd without an
owner check. Added in v2.

For the DRM SVM folks: is failing the mapping what you want here, or
should foreign device coherent pages be mapped like system memory? And
if failing is right, is -EINVAL the code you prefer?