From: Matthew Auld <matthew.auld@intel.com>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
intel-xe@lists.freedesktop.org
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>,
Matthew Brost <matthew.brost@intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
dri-devel@lists.freedesktop.org, stable@vger.kernel.org
Subject: Re: [PATCH v3 1/2] drm, drm/xe: Fix xe userptr in the absence of CONFIG_DEVICE_PRIVATE
Date: Wed, 21 Jan 2026 17:54:12 +0000 [thread overview]
Message-ID: <19212684-a7f2-48f7-a498-9004aeefff04@intel.com> (raw)
In-Reply-To: <81331db882e57f7e7e8322ba7aba87081759465f.camel@linux.intel.com>
On 21/01/2026 17:25, Thomas Hellström wrote:
> On Wed, 2026-01-21 at 17:19 +0000, Matthew Auld wrote:
>> On 21/01/2026 09:10, Thomas Hellström wrote:
>>> CONFIG_DEVICE_PRIVATE is not selected by default by some distros,
>>> for example Fedora, and that leads to a regression in the xe driver
>>> since userptr support gets compiled out.
>>>
>>> It turns out that DRM_GPUSVM, which is needed for xe userptr
>>> support
>>> compiles also without CONFIG_DEVICE_PRIVATE, but doesn't compile
>>> without CONFIG_ZONE_DEVICE.
>>> Exclude the drm_pagemap files from compilation with
>>> !CONFIG_ZONE_DEVICE,
>>> and remove the CONFIG_DEVICE_PRIVATE dependency from
>>> CONFIG_DRM_GPUSVM and
>>> the xe driver's selection of it, re-enabling xe userptr for those
>>> configs.
>>>
>>> v2:
>>> - Don't compile the drm_pagemap files unless CONFIG_ZONE_DEVICE is
>>> set.
>>> - Adjust the drm_pagemap.h header accordingly.
>>>
>>> Fixes: 9e9787414882 ("drm/xe/userptr: replace xe_hmm with gpusvm")
>>> Cc: Matthew Auld <matthew.auld@intel.com>
>>> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
>>> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>>> Cc: Matthew Brost <matthew.brost@intel.com>
>>> Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
>>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>>> Cc: dri-devel@lists.freedesktop.org
>>> Cc: <stable@vger.kernel.org> # v6.18+
>>> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>>
>> Let me double check that while it does at least build it is also
>> functional without DRM_XE_GPUSVM. I think it takes a different init
>> path
>> and maybe some other differences. Unless you already did?
>
> I think I managed to test without DRM_XE_GPUSVM both with and without
> ZONE_DEVICE, but since this is going to stable, a second check would be
> great!
Tried various userptr IGTs, and looked good.
>
> Thanks,
> Thomas
>
>
>>
>> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
>>
>>> ---
>>> drivers/gpu/drm/Kconfig | 2 +-
>>> drivers/gpu/drm/Makefile | 4 +++-
>>> drivers/gpu/drm/xe/Kconfig | 2 +-
>>> include/drm/drm_pagemap.h | 18 ++++++++++++++----
>>> 4 files changed, 19 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>>> index a33b90251530..d3d52310c9cc 100644
>>> --- a/drivers/gpu/drm/Kconfig
>>> +++ b/drivers/gpu/drm/Kconfig
>>> @@ -210,7 +210,7 @@ config DRM_GPUVM
>>>
>>> config DRM_GPUSVM
>>> tristate
>>> - depends on DRM && DEVICE_PRIVATE
>>> + depends on DRM
>>> select HMM_MIRROR
>>> select MMU_NOTIFIER
>>> help
>>> diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
>>> index 0deee72ef935..0c21029c446f 100644
>>> --- a/drivers/gpu/drm/Makefile
>>> +++ b/drivers/gpu/drm/Makefile
>>> @@ -108,9 +108,11 @@ obj-$(CONFIG_DRM_EXEC) += drm_exec.o
>>> obj-$(CONFIG_DRM_GPUVM) += drm_gpuvm.o
>>>
>>> drm_gpusvm_helper-y := \
>>> - drm_gpusvm.o\
>>> + drm_gpusvm.o
>>> +drm_gpusvm_helper-$(CONFIG_ZONE_DEVICE) += \
>>> drm_pagemap.o\
>>> drm_pagemap_util.o
>>> +
>>> obj-$(CONFIG_DRM_GPUSVM) += drm_gpusvm_helper.o
>>>
>>> obj-$(CONFIG_DRM_BUDDY) += drm_buddy.o
>>> diff --git a/drivers/gpu/drm/xe/Kconfig
>>> b/drivers/gpu/drm/xe/Kconfig
>>> index 4b288eb3f5b0..c34be1be155b 100644
>>> --- a/drivers/gpu/drm/xe/Kconfig
>>> +++ b/drivers/gpu/drm/xe/Kconfig
>>> @@ -39,7 +39,7 @@ config DRM_XE
>>> select DRM_TTM
>>> select DRM_TTM_HELPER
>>> select DRM_EXEC
>>> - select DRM_GPUSVM if !UML && DEVICE_PRIVATE
>>> + select DRM_GPUSVM if !UML
>>> select DRM_GPUVM
>>> select DRM_SCHED
>>> select MMU_NOTIFIER
>>> diff --git a/include/drm/drm_pagemap.h b/include/drm/drm_pagemap.h
>>> index 46e9c58f09e0..2baf0861f78f 100644
>>> --- a/include/drm/drm_pagemap.h
>>> +++ b/include/drm/drm_pagemap.h
>>> @@ -243,6 +243,8 @@ struct drm_pagemap_devmem_ops {
>>> struct dma_fence *pre_migrate_fence);
>>> };
>>>
>>> +#if IS_ENABLED(CONFIG_ZONE_DEVICE)
>>> +
>>> int drm_pagemap_init(struct drm_pagemap *dpagemap,
>>> struct dev_pagemap *pagemap,
>>> struct drm_device *drm,
>>> @@ -252,17 +254,22 @@ struct drm_pagemap *drm_pagemap_create(struct
>>> drm_device *drm,
>>> struct dev_pagemap
>>> *pagemap,
>>> const struct
>>> drm_pagemap_ops *ops);
>>>
>>> -#if IS_ENABLED(CONFIG_DRM_GPUSVM)
>>> +struct drm_pagemap *drm_pagemap_page_to_dpagemap(struct page
>>> *page);
>>>
>>> void drm_pagemap_put(struct drm_pagemap *dpagemap);
>>>
>>> #else
>>>
>>> +static inline struct drm_pagemap
>>> *drm_pagemap_page_to_dpagemap(struct page *page)
>>> +{
>>> + return NULL;
>>> +}
>>> +
>>> static inline void drm_pagemap_put(struct drm_pagemap *dpagemap)
>>> {
>>> }
>>>
>>> -#endif /* IS_ENABLED(CONFIG_DRM_GPUSVM) */
>>> +#endif /* IS_ENABLED(CONFIG_ZONE_DEVICE) */
>>>
>>> /**
>>> * drm_pagemap_get() - Obtain a reference on a struct drm_pagemap
>>> @@ -334,6 +341,8 @@ struct drm_pagemap_migrate_details {
>>> u32 source_peer_migrates : 1;
>>> };
>>>
>>> +#if IS_ENABLED(CONFIG_ZONE_DEVICE)
>>> +
>>> int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem
>>> *devmem_allocation,
>>> struct mm_struct *mm,
>>> unsigned long start, unsigned
>>> long end,
>>> @@ -343,8 +352,6 @@ int drm_pagemap_evict_to_ram(struct
>>> drm_pagemap_devmem *devmem_allocation);
>>>
>>> const struct dev_pagemap_ops *drm_pagemap_pagemap_ops_get(void);
>>>
>>> -struct drm_pagemap *drm_pagemap_page_to_dpagemap(struct page
>>> *page);
>>> -
>>> void drm_pagemap_devmem_init(struct drm_pagemap_devmem
>>> *devmem_allocation,
>>> struct device *dev, struct mm_struct
>>> *mm,
>>> const struct drm_pagemap_devmem_ops
>>> *ops,
>>> @@ -359,4 +366,7 @@ int drm_pagemap_populate_mm(struct drm_pagemap
>>> *dpagemap,
>>> void drm_pagemap_destroy(struct drm_pagemap *dpagemap, bool
>>> is_atomic_or_reclaim);
>>>
>>> int drm_pagemap_reinit(struct drm_pagemap *dpagemap);
>>> +
>>> +#endif /* IS_ENABLED(CONFIG_ZONE_DEVICE) */
>>> +
>>> #endif
next prev parent reply other threads:[~2026-01-21 17:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 9:10 [PATCH v3 0/2] drm, drm/xe: Fix xe SVM configs Thomas Hellström
2026-01-21 9:10 ` [PATCH v3 1/2] drm, drm/xe: Fix xe userptr in the absence of CONFIG_DEVICE_PRIVATE Thomas Hellström
2026-01-21 17:19 ` Matthew Auld
2026-01-21 17:25 ` Thomas Hellström
2026-01-21 17:54 ` Matthew Auld [this message]
2026-01-22 8:30 ` Maarten Lankhorst
2026-01-21 9:10 ` [PATCH v3 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected Thomas Hellström
2026-01-21 17:59 ` Matthew Auld
2026-01-21 9:52 ` ✓ CI.KUnit: success for drm, drm/xe: Fix xe SVM configs (rev3) Patchwork
2026-01-21 10:38 ` ✓ Xe.CI.BAT: " Patchwork
2026-01-21 15:07 ` ✓ Xe.CI.Full: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19212684-a7f2-48f7-a498-9004aeefff04@intel.com \
--to=matthew.auld@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=stable@vger.kernel.org \
--cc=thomas.hellstrom@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox