[PATCH v3 0/3] drm/xe: Userptr invalid page access fixes

Thomas Hellström thomas.hellstrom at linux.intel.com
Wed Mar 5 12:51:06 UTC 2025


On Tue, 2025-03-04 at 22:11 -0800, Matthew Brost wrote:
> On Tue, Mar 04, 2025 at 06:33:39PM +0100, Thomas Hellström wrote:
> > Fix a number of potential invalid page-accesses by the userptr
> > code.
> > 
> > Patch 1:
> > - Some coding style fixes.
> > Patch 2:
> > - Avoids invalid struct page accesses during userptr pinning.
> > Patch 3:
> > - Block xe device accesses on mmu_invalidation on the iommu level.
> > 
> 
> For the series:
> Acked-by: Matthew Brost <matthew.brost at intel.com>
> 
> In the long term, I believe it would be beneficial if we could unify
> Xe userptr
> with the DRM common GPU SVM get_pages/notifiers. This is really hard
> to get
> right, and I think everything we have fixed here has already been
> correctly
> handled in GPU SVM. It would also help other drivers getting userptr
> correct
> going forward.

I fully agree.

One thing Matt Auld brought up, though, is that the size of a page
(hmm_pfn_page_order()) may be larger than a range (userptr or SVM) and
cross the range start and range end. Do we address that problem in SVM?

Or perhaps it's not really a problem there.

/Thomas


> 
> Matt
> 
> > v2:
> > - Address review comments by Matt Auld
> > 
> > Cc: Matthew Auld <matthew.auld at intel.com>
> > Cc: Oak Zeng <oak.zeng at intel.com>
> > 
> > Thomas Hellström (3):
> >   drm/xe/hmm: Style- and include fixes
> >   drm/xe/hmm: Don't dereference struct page pointers without
> > notifier
> >     lock
> >   drm/xe/userptr: Unmap userptrs in the mmu notifier
> > 
> >  drivers/gpu/drm/xe/xe_hmm.c      | 170 +++++++++++++++++++++++----
> > ----
> >  drivers/gpu/drm/xe/xe_hmm.h      |   7 ++
> >  drivers/gpu/drm/xe/xe_vm.c       |   4 +
> >  drivers/gpu/drm/xe/xe_vm_types.h |   4 +
> >  4 files changed, 145 insertions(+), 40 deletions(-)
> > 
> > -- 
> > 2.48.1
> > 



More information about the Intel-xe mailing list