dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] drm, drm/xe: Fix xe SVM configs
@ 2026-01-20 14:34 Thomas Hellström
  2026-01-20 14:34 ` [PATCH v2 1/2] drm, drm/xe: Fix xe userptr in the absence of CONFIG_DEVICE_PRIVATE Thomas Hellström
  2026-01-20 14:34 ` [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected Thomas Hellström
  0 siblings, 2 replies; 8+ messages in thread
From: Thomas Hellström @ 2026-01-20 14:34 UTC (permalink / raw)
  To: intel-xe
  Cc: Thomas Hellström, Matthew Auld, Himal Prasad Ghimiray,
	Matthew Brost, Rodrigo Vivi, dri-devel

The first patch fixes the problem of xe userptr not being enabled if
CONFIG_DEVICE_PRIVATE or CONFIG_ZONE_DEVICE is missing.

Second patch explicitly selects CONFIG_DEVICE_PRIVATE and
CONFIG_ZONE_DEVICE if DRM_XE_GPUSVM is enabled, which is probably what
most distros want. This patch is not Fixes: tags since some configurations
may actively want to exclude CONFIG_DEVICE_PRIVATE / CONFIG_ZONE_DEVICE
and it's undesirable if a stable update breaks those.

v2:
- Also take CONFIG_ZONE_DEVICE into account. (Xe CI)

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

Thomas Hellström (2):
  drm, drm/xe: Fix xe userptr in the absence of CONFIG_DEVICE_PRIVATE
  drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected

 drivers/gpu/drm/Kconfig    |  2 +-
 drivers/gpu/drm/Makefile   |  4 +++-
 drivers/gpu/drm/xe/Kconfig |  5 +++--
 include/drm/drm_pagemap.h  | 18 ++++++++++++++----
 4 files changed, 21 insertions(+), 8 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 1/2] drm, drm/xe: Fix xe userptr in the absence of CONFIG_DEVICE_PRIVATE
  2026-01-20 14:34 [PATCH v2 0/2] drm, drm/xe: Fix xe SVM configs Thomas Hellström
@ 2026-01-20 14:34 ` Thomas Hellström
  2026-01-20 18:05   ` Matthew Brost
  2026-01-20 14:34 ` [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected Thomas Hellström
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Hellström @ 2026-01-20 14:34 UTC (permalink / raw)
  To: intel-xe
  Cc: Thomas Hellström, Matthew Auld, Himal Prasad Ghimiray,
	Matthew Brost, Rodrigo Vivi, dri-devel, stable

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>
---
 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
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected
  2026-01-20 14:34 [PATCH v2 0/2] drm, drm/xe: Fix xe SVM configs Thomas Hellström
  2026-01-20 14:34 ` [PATCH v2 1/2] drm, drm/xe: Fix xe userptr in the absence of CONFIG_DEVICE_PRIVATE Thomas Hellström
@ 2026-01-20 14:34 ` Thomas Hellström
  2026-01-20 20:15   ` kernel test robot
                     ` (2 more replies)
  1 sibling, 3 replies; 8+ messages in thread
From: Thomas Hellström @ 2026-01-20 14:34 UTC (permalink / raw)
  To: intel-xe
  Cc: Thomas Hellström, Matthew Auld, Matthew Brost, Rodrigo Vivi,
	dri-devel

CONFIG_DEVICE_PRIVATE is a prerequisite for DRM_XE_GPUSVM.
Explicitly select it so that DRM_XE_GPUSVM is not unintentionally
left out from distro configs not explicitly enabling
CONFIG_DEVICE_PRIVATE.

v2:
- Select also CONFIG_ZONE_DEVICE since it's needed by
  CONFIG_DEVICE_PRIVATE.

Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: <dri-devel@lists.freedesktop.org>
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/xe/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
index c34be1be155b..39edcdc6d33c 100644
--- a/drivers/gpu/drm/xe/Kconfig
+++ b/drivers/gpu/drm/xe/Kconfig
@@ -80,8 +80,9 @@ config DRM_XE_GPUSVM
 	bool "Enable CPU to GPU address mirroring"
 	depends on DRM_XE
 	depends on !UML
-	depends on DEVICE_PRIVATE
 	default y
+	select ZONE_DEVICE
+	select DEVICE_PRIVATE
 	select DRM_GPUSVM
 	help
 	  Enable this option if you want support for CPU to GPU address
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] drm, drm/xe: Fix xe userptr in the absence of CONFIG_DEVICE_PRIVATE
  2026-01-20 14:34 ` [PATCH v2 1/2] drm, drm/xe: Fix xe userptr in the absence of CONFIG_DEVICE_PRIVATE Thomas Hellström
@ 2026-01-20 18:05   ` Matthew Brost
  2026-01-23 13:34     ` Thomas Hellström
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Brost @ 2026-01-20 18:05 UTC (permalink / raw)
  To: Thomas Hellström
  Cc: intel-xe, Matthew Auld, Himal Prasad Ghimiray, Rodrigo Vivi,
	dri-devel, stable

On Tue, Jan 20, 2026 at 03:34:58PM +0100, 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>
> ---
>  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)
> +

What happens if we select ZONE_DEVICE but not DEVICE_PRIVATE?

Matt

>  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
> -- 
> 2.52.0
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected
  2026-01-20 14:34 ` [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected Thomas Hellström
@ 2026-01-20 20:15   ` kernel test robot
  2026-01-20 20:59   ` kernel test robot
  2026-01-20 23:16   ` kernel test robot
  2 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2026-01-20 20:15 UTC (permalink / raw)
  To: Thomas Hellström, intel-xe
  Cc: oe-kbuild-all, Thomas Hellström, Matthew Auld, Matthew Brost,
	Rodrigo Vivi, dri-devel

Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-xe/drm-xe-next]
[also build test WARNING on drm/drm-next drm-i915/for-linux-next drm-tip/drm-tip next-20260120]
[cannot apply to drm-misc/drm-misc-next daeinki-drm-exynos/exynos-drm-next drm-i915/for-linux-next-fixes linus/master v6.19-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Hellstr-m/drm-drm-xe-Fix-xe-userptr-in-the-absence-of-CONFIG_DEVICE_PRIVATE/20260120-223858
base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link:    https://lore.kernel.org/r/20260120143459.9485-3-thomas.hellstrom%40linux.intel.com
patch subject: [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected
config: csky-allmodconfig (https://download.01.org/0day-ci/archive/20260121/202601210441.tOGeZQTP-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260121/202601210441.tOGeZQTP-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601210441.tOGeZQTP-lkp@intel.com/

All warnings (new ones prefixed by >>):

   mm/memremap.c: In function 'memremap_compat_align':
   mm/memremap.c:36:16: error: 'SUBSECTION_SIZE' undeclared (first use in this function); did you mean 'SECTOR_SIZE'?
      36 |         return SUBSECTION_SIZE;
         |                ^~~~~~~~~~~~~~~
         |                SECTOR_SIZE
   mm/memremap.c:36:16: note: each undeclared identifier is reported only once for each function it appears in
   mm/memremap.c: In function 'pageunmap_range':
   mm/memremap.c:96:9: error: implicit declaration of function 'remove_pfn_range_from_zone'; did you mean 'remap_pfn_range_complete'? [-Wimplicit-function-declaration]
      96 |         remove_pfn_range_from_zone(page_zone(first_page), PHYS_PFN(range->start),
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
         |         remap_pfn_range_complete
   mm/memremap.c:99:17: error: implicit declaration of function '__remove_pages'; did you mean 'move_pages'? [-Wimplicit-function-declaration]
      99 |                 __remove_pages(PHYS_PFN(range->start),
         |                 ^~~~~~~~~~~~~~
         |                 move_pages
   mm/memremap.c:102:17: error: implicit declaration of function 'arch_remove_memory'; did you mean 'remove_memory'? [-Wimplicit-function-declaration]
     102 |                 arch_remove_memory(range->start, range_len(range),
         |                 ^~~~~~~~~~~~~~~~~~
         |                 remove_memory
   mm/memremap.c: At top level:
   mm/memremap.c:144:60: warning: 'struct mhp_params' declared inside parameter list will not be visible outside of this definition or declaration
     144 | static int pagemap_range(struct dev_pagemap *pgmap, struct mhp_params *params,
         |                                                            ^~~~~~~~~~
   mm/memremap.c: In function 'pagemap_range':
   mm/memremap.c:189:37: error: invalid use of undefined type 'struct mhp_params'
     189 |                              &params->pgprot);
         |                                     ^~
   mm/memremap.c:193:14: error: implicit declaration of function 'mhp_range_allowed' [-Wimplicit-function-declaration]
     193 |         if (!mhp_range_allowed(range->start, range_len(range), !is_private)) {
         |              ^~~~~~~~~~~~~~~~~
   mm/memremap.c:212:25: error: implicit declaration of function 'add_pages'; did you mean 'dir_pages'? [-Wimplicit-function-declaration]
     212 |                 error = add_pages(nid, PHYS_PFN(range->start),
         |                         ^~~~~~~~~
         |                         dir_pages
   mm/memremap.c:221:25: error: implicit declaration of function 'arch_add_memory' [-Wimplicit-function-declaration]
     221 |                 error = arch_add_memory(nid, range->start, range_len(range),
         |                         ^~~~~~~~~~~~~~~
   mm/memremap.c:229:17: error: implicit declaration of function 'move_pfn_range_to_zone' [-Wimplicit-function-declaration]
     229 |                 move_pfn_range_to_zone(zone, PHYS_PFN(range->start),
         |                 ^~~~~~~~~~~~~~~~~~~~~~
   mm/memremap.c:230:67: error: invalid use of undefined type 'struct mhp_params'
     230 |                                 PHYS_PFN(range_len(range)), params->altmap,
         |                                                                   ^~
   mm/memremap.c: In function 'memremap_pages':
   mm/memremap.c:268:16: error: variable 'params' has initializer but incomplete type
     268 |         struct mhp_params params = {
         |                ^~~~~~~~~~
   mm/memremap.c:269:18: error: 'struct mhp_params' has no member named 'altmap'
     269 |                 .altmap = pgmap_altmap(pgmap),
         |                  ^~~~~~
   mm/memremap.c:269:27: warning: excess elements in struct initializer
     269 |                 .altmap = pgmap_altmap(pgmap),
         |                           ^~~~~~~~~~~~
   mm/memremap.c:269:27: note: (near initialization for 'params')
   mm/memremap.c:270:18: error: 'struct mhp_params' has no member named 'pgmap'
     270 |                 .pgmap = pgmap,
         |                  ^~~~~
   mm/memremap.c:270:26: warning: excess elements in struct initializer
     270 |                 .pgmap = pgmap,
         |                          ^~~~~
   mm/memremap.c:270:26: note: (near initialization for 'params')
   mm/memremap.c:271:18: error: 'struct mhp_params' has no member named 'pgprot'
     271 |                 .pgprot = PAGE_KERNEL,
         |                  ^~~~~~
   In file included from arch/csky/include/asm/thread_info.h:9,
                    from include/linux/thread_info.h:60,
                    from include/asm-generic/current.h:6,
                    from ./arch/csky/include/generated/asm/current.h:1,
                    from include/linux/sched.h:12,
                    from include/linux/ratelimit.h:6,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from mm/memremap.c:3:
>> arch/csky/include/asm/page.h:62:25: warning: excess elements in struct initializer
      62 | #define __pgprot(x)     ((pgprot_t) { (x) })
         |                         ^
   arch/csky/include/asm/pgtable.h:62:25: note: in expansion of macro '__pgprot'
      62 | #define PAGE_KERNEL     __pgprot(_PAGE_BASE | _PAGE_READ | _PAGE_VALID | \
         |                         ^~~~~~~~
   mm/memremap.c:271:27: note: in expansion of macro 'PAGE_KERNEL'
     271 |                 .pgprot = PAGE_KERNEL,
         |                           ^~~~~~~~~~~
   arch/csky/include/asm/page.h:62:25: note: (near initialization for 'params')
      62 | #define __pgprot(x)     ((pgprot_t) { (x) })
         |                         ^
   arch/csky/include/asm/pgtable.h:62:25: note: in expansion of macro '__pgprot'
      62 | #define PAGE_KERNEL     __pgprot(_PAGE_BASE | _PAGE_READ | _PAGE_VALID | \
         |                         ^~~~~~~~
   mm/memremap.c:271:27: note: in expansion of macro 'PAGE_KERNEL'
     271 |                 .pgprot = PAGE_KERNEL,
         |                           ^~~~~~~~~~~
   mm/memremap.c:268:27: error: storage size of 'params' isn't known
     268 |         struct mhp_params params = {
         |                           ^~~~~~
   mm/memremap.c:268:27: warning: unused variable 'params' [-Wunused-variable]

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for ZONE_DEVICE
   Depends on [n]: MEMORY_HOTPLUG [=n] && MEMORY_HOTREMOVE [=n] && SPARSEMEM_VMEMMAP [=n]
   Selected by [m]:
   - DRM_XE_GPUSVM [=y] && HAS_IOMEM [=y] && DRM [=m] && DRM_XE [=m] && !UML


vim +62 arch/csky/include/asm/page.h

013de2d6671d89 Guo Ren 2018-09-05  59  
013de2d6671d89 Guo Ren 2018-09-05  60  #define __pte(x)	((pte_t) { (x) })
013de2d6671d89 Guo Ren 2018-09-05  61  #define __pgd(x)	((pgd_t) { (x) })
013de2d6671d89 Guo Ren 2018-09-05 @62  #define __pgprot(x)	((pgprot_t) { (x) })
013de2d6671d89 Guo Ren 2018-09-05  63  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected
  2026-01-20 14:34 ` [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected Thomas Hellström
  2026-01-20 20:15   ` kernel test robot
@ 2026-01-20 20:59   ` kernel test robot
  2026-01-20 23:16   ` kernel test robot
  2 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2026-01-20 20:59 UTC (permalink / raw)
  To: Thomas Hellström, intel-xe
  Cc: oe-kbuild-all, Thomas Hellström, Matthew Auld, Matthew Brost,
	Rodrigo Vivi, dri-devel

Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-xe/drm-xe-next]
[also build test WARNING on drm/drm-next drm-i915/for-linux-next drm-tip/drm-tip next-20260120]
[cannot apply to drm-misc/drm-misc-next daeinki-drm-exynos/exynos-drm-next drm-i915/for-linux-next-fixes linus/master v6.19-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Hellstr-m/drm-drm-xe-Fix-xe-userptr-in-the-absence-of-CONFIG_DEVICE_PRIVATE/20260120-223858
base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link:    https://lore.kernel.org/r/20260120143459.9485-3-thomas.hellstrom%40linux.intel.com
patch subject: [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20260121/202601210419.6HhGDdqP-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260121/202601210419.6HhGDdqP-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601210419.6HhGDdqP-lkp@intel.com/

All warnings (new ones prefixed by >>):

   mm/memremap.c: In function 'memremap_compat_align':
   mm/memremap.c:36:16: error: 'SUBSECTION_SIZE' undeclared (first use in this function); did you mean 'SECTOR_SIZE'?
      36 |         return SUBSECTION_SIZE;
         |                ^~~~~~~~~~~~~~~
         |                SECTOR_SIZE
   mm/memremap.c:36:16: note: each undeclared identifier is reported only once for each function it appears in
   mm/memremap.c: In function 'pageunmap_range':
   mm/memremap.c:96:9: error: implicit declaration of function 'remove_pfn_range_from_zone'; did you mean 'remap_pfn_range_complete'? [-Wimplicit-function-declaration]
      96 |         remove_pfn_range_from_zone(page_zone(first_page), PHYS_PFN(range->start),
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
         |         remap_pfn_range_complete
   mm/memremap.c:99:17: error: implicit declaration of function '__remove_pages'; did you mean 'move_pages'? [-Wimplicit-function-declaration]
      99 |                 __remove_pages(PHYS_PFN(range->start),
         |                 ^~~~~~~~~~~~~~
         |                 move_pages
   mm/memremap.c:102:17: error: implicit declaration of function 'arch_remove_memory'; did you mean 'remove_memory'? [-Wimplicit-function-declaration]
     102 |                 arch_remove_memory(range->start, range_len(range),
         |                 ^~~~~~~~~~~~~~~~~~
         |                 remove_memory
   mm/memremap.c: At top level:
   mm/memremap.c:144:60: warning: 'struct mhp_params' declared inside parameter list will not be visible outside of this definition or declaration
     144 | static int pagemap_range(struct dev_pagemap *pgmap, struct mhp_params *params,
         |                                                            ^~~~~~~~~~
   mm/memremap.c: In function 'pagemap_range':
   mm/memremap.c:189:37: error: invalid use of undefined type 'struct mhp_params'
     189 |                              &params->pgprot);
         |                                     ^~
   mm/memremap.c:193:14: error: implicit declaration of function 'mhp_range_allowed' [-Wimplicit-function-declaration]
     193 |         if (!mhp_range_allowed(range->start, range_len(range), !is_private)) {
         |              ^~~~~~~~~~~~~~~~~
   mm/memremap.c:212:25: error: implicit declaration of function 'add_pages'; did you mean 'dir_pages'? [-Wimplicit-function-declaration]
     212 |                 error = add_pages(nid, PHYS_PFN(range->start),
         |                         ^~~~~~~~~
         |                         dir_pages
   mm/memremap.c:221:25: error: implicit declaration of function 'arch_add_memory' [-Wimplicit-function-declaration]
     221 |                 error = arch_add_memory(nid, range->start, range_len(range),
         |                         ^~~~~~~~~~~~~~~
   mm/memremap.c:229:17: error: implicit declaration of function 'move_pfn_range_to_zone' [-Wimplicit-function-declaration]
     229 |                 move_pfn_range_to_zone(zone, PHYS_PFN(range->start),
         |                 ^~~~~~~~~~~~~~~~~~~~~~
   mm/memremap.c:230:67: error: invalid use of undefined type 'struct mhp_params'
     230 |                                 PHYS_PFN(range_len(range)), params->altmap,
         |                                                                   ^~
   mm/memremap.c: In function 'memremap_pages':
   mm/memremap.c:268:16: error: variable 'params' has initializer but incomplete type
     268 |         struct mhp_params params = {
         |                ^~~~~~~~~~
   mm/memremap.c:269:18: error: 'struct mhp_params' has no member named 'altmap'
     269 |                 .altmap = pgmap_altmap(pgmap),
         |                  ^~~~~~
   mm/memremap.c:269:27: warning: excess elements in struct initializer
     269 |                 .altmap = pgmap_altmap(pgmap),
         |                           ^~~~~~~~~~~~
   mm/memremap.c:269:27: note: (near initialization for 'params')
   mm/memremap.c:270:18: error: 'struct mhp_params' has no member named 'pgmap'
     270 |                 .pgmap = pgmap,
         |                  ^~~~~
   mm/memremap.c:270:26: warning: excess elements in struct initializer
     270 |                 .pgmap = pgmap,
         |                          ^~~~~
   mm/memremap.c:270:26: note: (near initialization for 'params')
   mm/memremap.c:271:18: error: 'struct mhp_params' has no member named 'pgprot'
     271 |                 .pgprot = PAGE_KERNEL,
         |                  ^~~~~~
   In file included from include/linux/shm.h:6,
                    from include/linux/sched.h:23,
                    from include/linux/ratelimit.h:6,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from mm/memremap.c:3:
>> arch/mips/include/asm/page.h:137:25: warning: excess elements in struct initializer
     137 | #define __pgprot(x)     ((pgprot_t) { (x) } )
         |                         ^
   arch/mips/include/asm/pgtable.h:30:25: note: in expansion of macro '__pgprot'
      30 | #define PAGE_KERNEL     __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
         |                         ^~~~~~~~
   mm/memremap.c:271:27: note: in expansion of macro 'PAGE_KERNEL'
     271 |                 .pgprot = PAGE_KERNEL,
         |                           ^~~~~~~~~~~
   arch/mips/include/asm/page.h:137:25: note: (near initialization for 'params')
     137 | #define __pgprot(x)     ((pgprot_t) { (x) } )
         |                         ^
   arch/mips/include/asm/pgtable.h:30:25: note: in expansion of macro '__pgprot'
      30 | #define PAGE_KERNEL     __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
         |                         ^~~~~~~~
   mm/memremap.c:271:27: note: in expansion of macro 'PAGE_KERNEL'
     271 |                 .pgprot = PAGE_KERNEL,
         |                           ^~~~~~~~~~~
   mm/memremap.c:268:27: error: storage size of 'params' isn't known
     268 |         struct mhp_params params = {
         |                           ^~~~~~
   mm/memremap.c:268:27: warning: unused variable 'params' [-Wunused-variable]

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for ZONE_DEVICE
   Depends on [n]: MEMORY_HOTPLUG [=n] && MEMORY_HOTREMOVE [=n] && SPARSEMEM_VMEMMAP [=n]
   Selected by [y]:
   - DRM_XE_GPUSVM [=y] && HAS_IOMEM [=y] && DRM [=y] && DRM_XE [=y] && !UML


vim +137 arch/mips/include/asm/page.h

c6e8b587718c486 include/asm-mips/page.h      Ralf Baechle   2005-02-10  131  
c6e8b587718c486 include/asm-mips/page.h      Ralf Baechle   2005-02-10  132  /*
c6e8b587718c486 include/asm-mips/page.h      Ralf Baechle   2005-02-10  133   * Manipulate page protection bits
c6e8b587718c486 include/asm-mips/page.h      Ralf Baechle   2005-02-10  134   */
c6e8b587718c486 include/asm-mips/page.h      Ralf Baechle   2005-02-10  135  typedef struct { unsigned long pgprot; } pgprot_t;
c6e8b587718c486 include/asm-mips/page.h      Ralf Baechle   2005-02-10  136  #define pgprot_val(x)	((x).pgprot)
^1da177e4c3f415 include/asm-mips/page.h      Linus Torvalds 2005-04-16 @137  #define __pgprot(x)	((pgprot_t) { (x) } )
b3a428b4b18d495 arch/mips/include/asm/page.h Hassan Naveed  2018-10-29  138  #define pte_pgprot(x)	__pgprot(pte_val(x) & ~_PFN_MASK)
^1da177e4c3f415 include/asm-mips/page.h      Linus Torvalds 2005-04-16  139  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected
  2026-01-20 14:34 ` [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected Thomas Hellström
  2026-01-20 20:15   ` kernel test robot
  2026-01-20 20:59   ` kernel test robot
@ 2026-01-20 23:16   ` kernel test robot
  2 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2026-01-20 23:16 UTC (permalink / raw)
  To: Thomas Hellström, intel-xe
  Cc: oe-kbuild-all, Thomas Hellström, Matthew Auld, Matthew Brost,
	Rodrigo Vivi, dri-devel

Hi Thomas,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-xe/drm-xe-next]
[also build test ERROR on drm/drm-next drm-i915/for-linux-next drm-tip/drm-tip next-20260120]
[cannot apply to drm-misc/drm-misc-next daeinki-drm-exynos/exynos-drm-next drm-i915/for-linux-next-fixes linus/master v6.19-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Hellstr-m/drm-drm-xe-Fix-xe-userptr-in-the-absence-of-CONFIG_DEVICE_PRIVATE/20260120-223858
base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link:    https://lore.kernel.org/r/20260120143459.9485-3-thomas.hellstrom%40linux.intel.com
patch subject: [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected
config: parisc-allmodconfig (https://download.01.org/0day-ci/archive/20260121/202601210629.wmt9lHUu-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260121/202601210629.wmt9lHUu-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601210629.wmt9lHUu-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   fs/dax.c: In function 'copy_cow_page_dax':
>> fs/dax.c:1018:9: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Wimplicit-function-declaration]
    1018 |         copy_user_page(vto, kaddr, vmf->address, vmf->cow_page);
         |         ^~~~~~~~~~~~~~
         |         copy_to_user_page
--
   mm/memremap.c: In function 'memremap_compat_align':
>> mm/memremap.c:36:16: error: 'SUBSECTION_SIZE' undeclared (first use in this function); did you mean 'SECTOR_SIZE'?
      36 |         return SUBSECTION_SIZE;
         |                ^~~~~~~~~~~~~~~
         |                SECTOR_SIZE
   mm/memremap.c:36:16: note: each undeclared identifier is reported only once for each function it appears in
   mm/memremap.c: In function 'pageunmap_range':
>> mm/memremap.c:96:9: error: implicit declaration of function 'remove_pfn_range_from_zone'; did you mean 'remap_pfn_range_complete'? [-Wimplicit-function-declaration]
      96 |         remove_pfn_range_from_zone(page_zone(first_page), PHYS_PFN(range->start),
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
         |         remap_pfn_range_complete
>> mm/memremap.c:99:17: error: implicit declaration of function '__remove_pages'; did you mean 'move_pages'? [-Wimplicit-function-declaration]
      99 |                 __remove_pages(PHYS_PFN(range->start),
         |                 ^~~~~~~~~~~~~~
         |                 move_pages
>> mm/memremap.c:102:17: error: implicit declaration of function 'arch_remove_memory'; did you mean 'remove_memory'? [-Wimplicit-function-declaration]
     102 |                 arch_remove_memory(range->start, range_len(range),
         |                 ^~~~~~~~~~~~~~~~~~
         |                 remove_memory
   mm/memremap.c: At top level:
>> mm/memremap.c:144:60: warning: 'struct mhp_params' declared inside parameter list will not be visible outside of this definition or declaration
     144 | static int pagemap_range(struct dev_pagemap *pgmap, struct mhp_params *params,
         |                                                            ^~~~~~~~~~
   mm/memremap.c: In function 'pagemap_range':
>> mm/memremap.c:189:37: error: invalid use of undefined type 'struct mhp_params'
     189 |                              &params->pgprot);
         |                                     ^~
>> mm/memremap.c:193:14: error: implicit declaration of function 'mhp_range_allowed' [-Wimplicit-function-declaration]
     193 |         if (!mhp_range_allowed(range->start, range_len(range), !is_private)) {
         |              ^~~~~~~~~~~~~~~~~
>> mm/memremap.c:212:25: error: implicit declaration of function 'add_pages'; did you mean 'dir_pages'? [-Wimplicit-function-declaration]
     212 |                 error = add_pages(nid, PHYS_PFN(range->start),
         |                         ^~~~~~~~~
         |                         dir_pages
>> mm/memremap.c:221:25: error: implicit declaration of function 'arch_add_memory' [-Wimplicit-function-declaration]
     221 |                 error = arch_add_memory(nid, range->start, range_len(range),
         |                         ^~~~~~~~~~~~~~~
>> mm/memremap.c:229:17: error: implicit declaration of function 'move_pfn_range_to_zone' [-Wimplicit-function-declaration]
     229 |                 move_pfn_range_to_zone(zone, PHYS_PFN(range->start),
         |                 ^~~~~~~~~~~~~~~~~~~~~~
   mm/memremap.c:230:67: error: invalid use of undefined type 'struct mhp_params'
     230 |                                 PHYS_PFN(range_len(range)), params->altmap,
         |                                                                   ^~
   mm/memremap.c: In function 'memremap_pages':
>> mm/memremap.c:268:16: error: variable 'params' has initializer but incomplete type
     268 |         struct mhp_params params = {
         |                ^~~~~~~~~~
>> mm/memremap.c:269:18: error: 'struct mhp_params' has no member named 'altmap'
     269 |                 .altmap = pgmap_altmap(pgmap),
         |                  ^~~~~~
>> mm/memremap.c:269:27: warning: excess elements in struct initializer
     269 |                 .altmap = pgmap_altmap(pgmap),
         |                           ^~~~~~~~~~~~
   mm/memremap.c:269:27: note: (near initialization for 'params')
>> mm/memremap.c:270:18: error: 'struct mhp_params' has no member named 'pgmap'
     270 |                 .pgmap = pgmap,
         |                  ^~~~~
   mm/memremap.c:270:26: warning: excess elements in struct initializer
     270 |                 .pgmap = pgmap,
         |                          ^~~~~
   mm/memremap.c:270:26: note: (near initialization for 'params')
>> mm/memremap.c:271:18: error: 'struct mhp_params' has no member named 'pgprot'
     271 |                 .pgprot = PAGE_KERNEL,
         |                  ^~~~~~
   In file included from include/linux/shm.h:6,
                    from include/linux/sched.h:23,
                    from include/linux/ratelimit.h:6,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from mm/memremap.c:3:
>> arch/parisc/include/asm/page.h:54:25: warning: excess elements in struct initializer
      54 | #define __pgprot(x)     ((pgprot_t) { (x) } )
         |                         ^
   arch/parisc/include/asm/pgtable.h:241:25: note: in expansion of macro '__pgprot'
     241 | #define PAGE_KERNEL     __pgprot(_PAGE_KERNEL)
         |                         ^~~~~~~~
   mm/memremap.c:271:27: note: in expansion of macro 'PAGE_KERNEL'
     271 |                 .pgprot = PAGE_KERNEL,
         |                           ^~~~~~~~~~~
   arch/parisc/include/asm/page.h:54:25: note: (near initialization for 'params')
      54 | #define __pgprot(x)     ((pgprot_t) { (x) } )
         |                         ^
   arch/parisc/include/asm/pgtable.h:241:25: note: in expansion of macro '__pgprot'
     241 | #define PAGE_KERNEL     __pgprot(_PAGE_KERNEL)
         |                         ^~~~~~~~
   mm/memremap.c:271:27: note: in expansion of macro 'PAGE_KERNEL'
     271 |                 .pgprot = PAGE_KERNEL,
         |                           ^~~~~~~~~~~
>> mm/memremap.c:268:27: error: storage size of 'params' isn't known
     268 |         struct mhp_params params = {
         |                           ^~~~~~
>> mm/memremap.c:268:27: warning: unused variable 'params' [-Wunused-variable]

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for ZONE_DEVICE
   Depends on [n]: MEMORY_HOTPLUG [=n] && MEMORY_HOTREMOVE [=n] && SPARSEMEM_VMEMMAP [=n]
   Selected by [m]:
   - DRM_XE_GPUSVM [=y] && HAS_IOMEM [=y] && DRM [=m] && DRM_XE [=m] && !UML


vim +1018 fs/dax.c

429f8de70d9872 Christoph Hellwig 2021-11-29  1002  
429f8de70d9872 Christoph Hellwig 2021-11-29  1003  static int copy_cow_page_dax(struct vm_fault *vmf, const struct iomap_iter *iter)
429f8de70d9872 Christoph Hellwig 2021-11-29  1004  {
60696eb26a37ab Christoph Hellwig 2021-11-29  1005  	pgoff_t pgoff = dax_iomap_pgoff(&iter->iomap, iter->pos);
cccbce67158290 Dan Williams      2017-01-27  1006  	void *vto, *kaddr;
cccbce67158290 Dan Williams      2017-01-27  1007  	long rc;
cccbce67158290 Dan Williams      2017-01-27  1008  	int id;
cccbce67158290 Dan Williams      2017-01-27  1009  
cccbce67158290 Dan Williams      2017-01-27  1010  	id = dax_read_lock();
e511c4a3d2a1f6 Jane Chu          2022-05-13  1011  	rc = dax_direct_access(iter->iomap.dax_dev, pgoff, 1, DAX_ACCESS,
e511c4a3d2a1f6 Jane Chu          2022-05-13  1012  				&kaddr, NULL);
cccbce67158290 Dan Williams      2017-01-27  1013  	if (rc < 0) {
cccbce67158290 Dan Williams      2017-01-27  1014  		dax_read_unlock(id);
cccbce67158290 Dan Williams      2017-01-27  1015  		return rc;
cccbce67158290 Dan Williams      2017-01-27  1016  	}
429f8de70d9872 Christoph Hellwig 2021-11-29  1017  	vto = kmap_atomic(vmf->cow_page);
429f8de70d9872 Christoph Hellwig 2021-11-29 @1018  	copy_user_page(vto, kaddr, vmf->address, vmf->cow_page);
f7ca90b160307d Matthew Wilcox    2015-02-16  1019  	kunmap_atomic(vto);
cccbce67158290 Dan Williams      2017-01-27  1020  	dax_read_unlock(id);
f7ca90b160307d Matthew Wilcox    2015-02-16  1021  	return 0;
f7ca90b160307d Matthew Wilcox    2015-02-16  1022  }
f7ca90b160307d Matthew Wilcox    2015-02-16  1023  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] drm, drm/xe: Fix xe userptr in the absence of CONFIG_DEVICE_PRIVATE
  2026-01-20 18:05   ` Matthew Brost
@ 2026-01-23 13:34     ` Thomas Hellström
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Hellström @ 2026-01-23 13:34 UTC (permalink / raw)
  To: Matthew Brost
  Cc: intel-xe, Matthew Auld, Himal Prasad Ghimiray, Rodrigo Vivi,
	dri-devel, stable

On Tue, 2026-01-20 at 10:05 -0800, Matthew Brost wrote:
> On Tue, Jan 20, 2026 at 03:34:58PM +0100, 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>
> > ---
> >  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)
> > +
> 
> What happens if we select ZONE_DEVICE but not DEVICE_PRIVATE?

This code builds, and in theory would work for DEVICE_COHERENT but the
device-private checks in the code always return false as I understand
it. 

So should be safe for our userptr code, and SVM still requires /
selects DEVICE_PRIVATE.

Thomas


> 
> Matt
> 
> >  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
> > -- 
> > 2.52.0
> > 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-01-23 13:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-20 14:34 [PATCH v2 0/2] drm, drm/xe: Fix xe SVM configs Thomas Hellström
2026-01-20 14:34 ` [PATCH v2 1/2] drm, drm/xe: Fix xe userptr in the absence of CONFIG_DEVICE_PRIVATE Thomas Hellström
2026-01-20 18:05   ` Matthew Brost
2026-01-23 13:34     ` Thomas Hellström
2026-01-20 14:34 ` [PATCH v2 2/2] drm/xe: Select CONFIG_DEVICE_PRIVATE when DRM_XE_GPUSVM is selected Thomas Hellström
2026-01-20 20:15   ` kernel test robot
2026-01-20 20:59   ` kernel test robot
2026-01-20 23:16   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox