Skip to content

Fix userptr failures on kernels not having SVM support#440

Merged
akanksh5-intc merged 5 commits into
intel-gpu:oot-backport/v7.0from
guptavar:userptr-fix
Jul 8, 2026
Merged

Fix userptr failures on kernels not having SVM support#440
akanksh5-intc merged 5 commits into
intel-gpu:oot-backport/v7.0from
guptavar:userptr-fix

Conversation

@guptavar

Copy link
Copy Markdown

No description provided.

Comment thread patches/0001-drm-xe-gate-full-SVM-path-on-migrate_device_pfns-availability.patch Outdated
Comment thread patches/0001-drm-xe-gate-full-SVM-path-on-migrate_device_pfns-availability.patch Outdated

@smuqthya smuqthya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good from Backport side with minor changes. SVM I let other expert to review. before merge

Comment thread patches/0001-drm-xe-userptr-add-fallback-pinning-for-non-full-svm.patch Outdated
Comment thread patches/0001-drm-xe-userptr-add-fallback-pinning-for-non-full-svm.patch Outdated
Comment thread patches/0001-drm-xe-vm-add-gpuva-map-fallback-and-fix-svm-gate.patch Outdated
Comment thread patches/0001-Revert-drm-xe-Drop-GuC-submit_wq-pool.patch Outdated
Comment thread autotools/m4/drm_gpuvm.m4 Outdated
Comment thread autotools/m4/drm_gpuvm.m4
Comment thread backport/compat/drm_gpuvm_madvise.c Outdated
{
/* For kernels without madvise support, use the standard map ops */
return drm_gpuvm_sm_map_ops_create(gpuvm, req);
return drm_gpuvm_sm_map_ops_create_req(gpuvm, req);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have conditional control with macro

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted. THanks

Comment thread patches/0001-drm-xe-userptr-runtime-full-svm-alignment.patch
Comment thread patches/0001-drm-xe-userptr-runtime-full-svm-alignment.patch
guptavar added 5 commits July 7, 2026 15:46
Keep module slot ordering stable by reserving index 12 for
drm_gpusvm_helper and index 13 for drm_gpuvm.

Update DKMS generator scripts so xe-vfio-pci remains at index 11 and
module indices stay unique.

This avoids ambiguous module array ordering across package generation
paths.

Signed-off-by: Varun Gupta <varun.gupta@intel.com>
Reviewed-by: Syed Abdul Muqthyar Ahmed <syed.abdul.muqthyar.ahmed@intel.com>
Add a backport patch that guards drm_pagemap_put definition when
BPM_DRM_PAGEMAP_PUT_NOT_PRESENT is set.

Without this guard, kernels that rely on the header-side fallback can
hit symbol redefinition or mismatch with the C implementation path.

Keep header fallback active on kernels without drm_pagemap_put, and
preserve the normal implementation/export path on kernels that provide
the API.

Signed-off-by: Varun Gupta <varun.gupta@intel.com>
Reviewed-by: Syed Abdul Muqthyar Ahmed <syed.abdul.muqthyar.ahmed@intel.com>
Gate full-SVM Xe paths on migrate_device_pfns capability checks to avoid
exposing full-SVM behavior on partial pagemap API targets.

When BPM_MIGRATE_DEVICE_PFNS_NOT_PRESENT is set:
- gate full-SVM enablement in xe_svm.h
- avoid tile-local pagemap cache lookups that assume full pagemap API
- expose CPU_ADDR_MIRROR capability only when the effective path is valid

Signed-off-by: Varun Gupta <varun.gupta@intel.com>
Reviewed-by: Syed Abdul Muqthyar Ahmed <syed.abdul.muqthyar.ahmed@intel.com>
Older kernels expose drm_gpuvm_sm_map_ops_create() with discrete
addr/range/obj/offset arguments, while newer kernels take
struct drm_gpuvm_map_req *.

Add AC_DRM_GPUVM_SM_MAP_OPS_CREATE_MAP_REQ_NOT_PRESENT and register
it in AC_XE_CONFIG. In backport drm_gpuvm.h, keep caller name
unchanged and adapt map_req call sites to legacy arguments via an
internal helper remap.

Reference:
        000a45dce7ad
        drm/gpuvm: Pass map arguments through a struct

Signed-off-by: Varun Gupta <varun.gupta@intel.com>
Reviewed-by: Syed Abdul Muqthyar Ahmed <syed.abdul.muqthyar.ahmed@intel.com>
Add two backport patches:

- build xe_svm.o under CONFIG_DRM_GPUSVM in xe Makefile
- align xe_vm userptr runtime map-op calls with drm_gpuvm compat wrapper

This keeps generated out-dir behavior consistent across kernels where
full Xe SVM is conditionally gated.

Signed-off-by: Varun Gupta <varun.gupta@intel.com>
Reviewed-by: Syed Abdul Muqthyar Ahmed <syed.abdul.muqthyar.ahmed@intel.com>
@akanksh5-intc akanksh5-intc merged commit b9db500 into intel-gpu:oot-backport/v7.0 Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants