All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/gpu/drm/drm_gpusvm.c:933 drm_gpusvm_range_chunk_size() error: uninitialized symbol 'end'.
@ 2026-01-10  6:57 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-01-10  6:57 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Alistair Popple <apopple@nvidia.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: "Björn Töpel" <bjorn@rivosinc.com>
CC: Jason Gunthorpe <jgg@nvidia.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   cb2076b0910f3b19036ec7d50530113fcb9736c8
commit: d438d273417055241ebaaf1ba3be23459fc27cba mm: remove devmap related functions and page table bits
date:   6 months ago
:::::: branch date: 5 hours ago
:::::: commit date: 6 months ago
config: s390-randconfig-r072-20260109 (https://download.01.org/0day-ci/archive/20260110/202601101402.IFPyfaRc-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
smatch version: v0.5.0-8985-g2614ff1a

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202601101402.IFPyfaRc-lkp@intel.com/

New smatch warnings:
drivers/gpu/drm/drm_gpusvm.c:933 drm_gpusvm_range_chunk_size() error: uninitialized symbol 'end'.
drivers/gpu/drm/drm_gpusvm.c:933 drm_gpusvm_range_chunk_size() error: uninitialized symbol 'start'.

Old smatch warnings:
drivers/gpu/drm/drm_gpusvm.c:1427 drm_gpusvm_range_get_pages() error: uninitialized symbol 'pagemap'.
drivers/gpu/drm/drm_gpusvm.c:1446 drm_gpusvm_range_get_pages() error: uninitialized symbol 'dpagemap'.

vim +/end +933 drivers/gpu/drm/drm_gpusvm.c

99624bdff86707 Matthew Brost 2025-03-05  885  
99624bdff86707 Matthew Brost 2025-03-05  886  /**
99624bdff86707 Matthew Brost 2025-03-05  887   * drm_gpusvm_range_chunk_size() - Determine chunk size for GPU SVM range
99624bdff86707 Matthew Brost 2025-03-05  888   * @gpusvm: Pointer to the GPU SVM structure
99624bdff86707 Matthew Brost 2025-03-05  889   * @notifier: Pointer to the GPU SVM notifier structure
99624bdff86707 Matthew Brost 2025-03-05  890   * @vas: Pointer to the virtual memory area structure
99624bdff86707 Matthew Brost 2025-03-05  891   * @fault_addr: Fault address
99624bdff86707 Matthew Brost 2025-03-05  892   * @gpuva_start: Start address of GPUVA which mirrors CPU
99624bdff86707 Matthew Brost 2025-03-05  893   * @gpuva_end: End address of GPUVA which mirrors CPU
99624bdff86707 Matthew Brost 2025-03-05  894   * @check_pages_threshold: Check CPU pages for present threshold
99624bdff86707 Matthew Brost 2025-03-05  895   *
99624bdff86707 Matthew Brost 2025-03-05  896   * This function determines the chunk size for the GPU SVM range based on the
99624bdff86707 Matthew Brost 2025-03-05  897   * fault address, GPU SVM chunk sizes, existing GPU SVM ranges, and the virtual
99624bdff86707 Matthew Brost 2025-03-05  898   * memory area boundaries.
99624bdff86707 Matthew Brost 2025-03-05  899   *
99624bdff86707 Matthew Brost 2025-03-05  900   * Return: Chunk size on success, LONG_MAX on failure.
99624bdff86707 Matthew Brost 2025-03-05  901   */
99624bdff86707 Matthew Brost 2025-03-05  902  static unsigned long
99624bdff86707 Matthew Brost 2025-03-05  903  drm_gpusvm_range_chunk_size(struct drm_gpusvm *gpusvm,
99624bdff86707 Matthew Brost 2025-03-05  904  			    struct drm_gpusvm_notifier *notifier,
99624bdff86707 Matthew Brost 2025-03-05  905  			    struct vm_area_struct *vas,
99624bdff86707 Matthew Brost 2025-03-05  906  			    unsigned long fault_addr,
99624bdff86707 Matthew Brost 2025-03-05  907  			    unsigned long gpuva_start,
99624bdff86707 Matthew Brost 2025-03-05  908  			    unsigned long gpuva_end,
99624bdff86707 Matthew Brost 2025-03-05  909  			    unsigned long check_pages_threshold)
99624bdff86707 Matthew Brost 2025-03-05  910  {
99624bdff86707 Matthew Brost 2025-03-05  911  	unsigned long start, end;
99624bdff86707 Matthew Brost 2025-03-05  912  	int i = 0;
99624bdff86707 Matthew Brost 2025-03-05  913  
99624bdff86707 Matthew Brost 2025-03-05  914  retry:
99624bdff86707 Matthew Brost 2025-03-05  915  	for (; i < gpusvm->num_chunks; ++i) {
99624bdff86707 Matthew Brost 2025-03-05  916  		start = ALIGN_DOWN(fault_addr, gpusvm->chunk_sizes[i]);
99624bdff86707 Matthew Brost 2025-03-05  917  		end = ALIGN(fault_addr + 1, gpusvm->chunk_sizes[i]);
99624bdff86707 Matthew Brost 2025-03-05  918  
99624bdff86707 Matthew Brost 2025-03-05  919  		if (start >= vas->vm_start && end <= vas->vm_end &&
99624bdff86707 Matthew Brost 2025-03-05  920  		    start >= drm_gpusvm_notifier_start(notifier) &&
99624bdff86707 Matthew Brost 2025-03-05  921  		    end <= drm_gpusvm_notifier_end(notifier) &&
99624bdff86707 Matthew Brost 2025-03-05  922  		    start >= gpuva_start && end <= gpuva_end)
99624bdff86707 Matthew Brost 2025-03-05  923  			break;
99624bdff86707 Matthew Brost 2025-03-05  924  	}
99624bdff86707 Matthew Brost 2025-03-05  925  
99624bdff86707 Matthew Brost 2025-03-05  926  	if (i == gpusvm->num_chunks)
99624bdff86707 Matthew Brost 2025-03-05  927  		return LONG_MAX;
99624bdff86707 Matthew Brost 2025-03-05  928  
99624bdff86707 Matthew Brost 2025-03-05  929  	/*
99624bdff86707 Matthew Brost 2025-03-05  930  	 * If allocation more than page, ensure not to overlap with existing
99624bdff86707 Matthew Brost 2025-03-05  931  	 * ranges.
99624bdff86707 Matthew Brost 2025-03-05  932  	 */
99624bdff86707 Matthew Brost 2025-03-05 @933  	if (end - start != SZ_4K) {
99624bdff86707 Matthew Brost 2025-03-05  934  		struct drm_gpusvm_range *range;
99624bdff86707 Matthew Brost 2025-03-05  935  
99624bdff86707 Matthew Brost 2025-03-05  936  		range = drm_gpusvm_range_find(notifier, start, end);
99624bdff86707 Matthew Brost 2025-03-05  937  		if (range) {
99624bdff86707 Matthew Brost 2025-03-05  938  			++i;
99624bdff86707 Matthew Brost 2025-03-05  939  			goto retry;
99624bdff86707 Matthew Brost 2025-03-05  940  		}
99624bdff86707 Matthew Brost 2025-03-05  941  
99624bdff86707 Matthew Brost 2025-03-05  942  		/*
99624bdff86707 Matthew Brost 2025-03-05  943  		 * XXX: Only create range on pages CPU has faulted in. Without
99624bdff86707 Matthew Brost 2025-03-05  944  		 * this check, or prefault, on BMG 'xe_exec_system_allocator --r
99624bdff86707 Matthew Brost 2025-03-05  945  		 * process-many-malloc' fails. In the failure case, each process
99624bdff86707 Matthew Brost 2025-03-05  946  		 * mallocs 16k but the CPU VMA is ~128k which results in 64k SVM
99624bdff86707 Matthew Brost 2025-03-05  947  		 * ranges. When migrating the SVM ranges, some processes fail in
99624bdff86707 Matthew Brost 2025-03-05  948  		 * drm_gpusvm_migrate_to_devmem with 'migrate.cpages != npages'
99624bdff86707 Matthew Brost 2025-03-05  949  		 * and then upon drm_gpusvm_range_get_pages device pages from
99624bdff86707 Matthew Brost 2025-03-05  950  		 * other processes are collected + faulted in which creates all
99624bdff86707 Matthew Brost 2025-03-05  951  		 * sorts of problems. Unsure exactly how this happening, also
99624bdff86707 Matthew Brost 2025-03-05  952  		 * problem goes away if 'xe_exec_system_allocator --r
99624bdff86707 Matthew Brost 2025-03-05  953  		 * process-many-malloc' mallocs at least 64k at a time.
99624bdff86707 Matthew Brost 2025-03-05  954  		 */
99624bdff86707 Matthew Brost 2025-03-05  955  		if (end - start <= check_pages_threshold &&
99624bdff86707 Matthew Brost 2025-03-05  956  		    !drm_gpusvm_check_pages(gpusvm, notifier, start, end)) {
99624bdff86707 Matthew Brost 2025-03-05  957  			++i;
99624bdff86707 Matthew Brost 2025-03-05  958  			goto retry;
99624bdff86707 Matthew Brost 2025-03-05  959  		}
99624bdff86707 Matthew Brost 2025-03-05  960  	}
99624bdff86707 Matthew Brost 2025-03-05  961  
99624bdff86707 Matthew Brost 2025-03-05  962  	return end - start;
99624bdff86707 Matthew Brost 2025-03-05  963  }
99624bdff86707 Matthew Brost 2025-03-05  964  

:::::: The code at line 933 was first introduced by commit
:::::: 99624bdff8670795b678eafa6509aaad3a5c0175 drm/gpusvm: Add support for GPU Shared Virtual Memory

:::::: TO: Matthew Brost <matthew.brost@intel.com>
:::::: CC: Matthew Brost <matthew.brost@intel.com>

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

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

* drivers/gpu/drm/drm_gpusvm.c:933 drm_gpusvm_range_chunk_size() error: uninitialized symbol 'end'.
@ 2026-01-10 20:13 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-01-10 20:13 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Alistair Popple <apopple@nvidia.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: "Björn Töpel" <bjorn@rivosinc.com>
CC: Jason Gunthorpe <jgg@nvidia.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   97313d6113ab4362ad15076f65560e65288fbcb8
commit: d438d273417055241ebaaf1ba3be23459fc27cba mm: remove devmap related functions and page table bits
date:   6 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 6 months ago
config: s390-randconfig-r072-20260109 (https://download.01.org/0day-ci/archive/20260111/202601110432.5RH1Bfes-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
smatch version: v0.5.0-8985-g2614ff1a

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202601110432.5RH1Bfes-lkp@intel.com/

New smatch warnings:
drivers/gpu/drm/drm_gpusvm.c:933 drm_gpusvm_range_chunk_size() error: uninitialized symbol 'end'.
drivers/gpu/drm/drm_gpusvm.c:933 drm_gpusvm_range_chunk_size() error: uninitialized symbol 'start'.

Old smatch warnings:
drivers/gpu/drm/drm_gpusvm.c:1427 drm_gpusvm_range_get_pages() error: uninitialized symbol 'pagemap'.
drivers/gpu/drm/drm_gpusvm.c:1446 drm_gpusvm_range_get_pages() error: uninitialized symbol 'dpagemap'.

vim +/end +933 drivers/gpu/drm/drm_gpusvm.c

99624bdff86707 Matthew Brost 2025-03-05  885  
99624bdff86707 Matthew Brost 2025-03-05  886  /**
99624bdff86707 Matthew Brost 2025-03-05  887   * drm_gpusvm_range_chunk_size() - Determine chunk size for GPU SVM range
99624bdff86707 Matthew Brost 2025-03-05  888   * @gpusvm: Pointer to the GPU SVM structure
99624bdff86707 Matthew Brost 2025-03-05  889   * @notifier: Pointer to the GPU SVM notifier structure
99624bdff86707 Matthew Brost 2025-03-05  890   * @vas: Pointer to the virtual memory area structure
99624bdff86707 Matthew Brost 2025-03-05  891   * @fault_addr: Fault address
99624bdff86707 Matthew Brost 2025-03-05  892   * @gpuva_start: Start address of GPUVA which mirrors CPU
99624bdff86707 Matthew Brost 2025-03-05  893   * @gpuva_end: End address of GPUVA which mirrors CPU
99624bdff86707 Matthew Brost 2025-03-05  894   * @check_pages_threshold: Check CPU pages for present threshold
99624bdff86707 Matthew Brost 2025-03-05  895   *
99624bdff86707 Matthew Brost 2025-03-05  896   * This function determines the chunk size for the GPU SVM range based on the
99624bdff86707 Matthew Brost 2025-03-05  897   * fault address, GPU SVM chunk sizes, existing GPU SVM ranges, and the virtual
99624bdff86707 Matthew Brost 2025-03-05  898   * memory area boundaries.
99624bdff86707 Matthew Brost 2025-03-05  899   *
99624bdff86707 Matthew Brost 2025-03-05  900   * Return: Chunk size on success, LONG_MAX on failure.
99624bdff86707 Matthew Brost 2025-03-05  901   */
99624bdff86707 Matthew Brost 2025-03-05  902  static unsigned long
99624bdff86707 Matthew Brost 2025-03-05  903  drm_gpusvm_range_chunk_size(struct drm_gpusvm *gpusvm,
99624bdff86707 Matthew Brost 2025-03-05  904  			    struct drm_gpusvm_notifier *notifier,
99624bdff86707 Matthew Brost 2025-03-05  905  			    struct vm_area_struct *vas,
99624bdff86707 Matthew Brost 2025-03-05  906  			    unsigned long fault_addr,
99624bdff86707 Matthew Brost 2025-03-05  907  			    unsigned long gpuva_start,
99624bdff86707 Matthew Brost 2025-03-05  908  			    unsigned long gpuva_end,
99624bdff86707 Matthew Brost 2025-03-05  909  			    unsigned long check_pages_threshold)
99624bdff86707 Matthew Brost 2025-03-05  910  {
99624bdff86707 Matthew Brost 2025-03-05  911  	unsigned long start, end;
99624bdff86707 Matthew Brost 2025-03-05  912  	int i = 0;
99624bdff86707 Matthew Brost 2025-03-05  913  
99624bdff86707 Matthew Brost 2025-03-05  914  retry:
99624bdff86707 Matthew Brost 2025-03-05  915  	for (; i < gpusvm->num_chunks; ++i) {
99624bdff86707 Matthew Brost 2025-03-05  916  		start = ALIGN_DOWN(fault_addr, gpusvm->chunk_sizes[i]);
99624bdff86707 Matthew Brost 2025-03-05  917  		end = ALIGN(fault_addr + 1, gpusvm->chunk_sizes[i]);
99624bdff86707 Matthew Brost 2025-03-05  918  
99624bdff86707 Matthew Brost 2025-03-05  919  		if (start >= vas->vm_start && end <= vas->vm_end &&
99624bdff86707 Matthew Brost 2025-03-05  920  		    start >= drm_gpusvm_notifier_start(notifier) &&
99624bdff86707 Matthew Brost 2025-03-05  921  		    end <= drm_gpusvm_notifier_end(notifier) &&
99624bdff86707 Matthew Brost 2025-03-05  922  		    start >= gpuva_start && end <= gpuva_end)
99624bdff86707 Matthew Brost 2025-03-05  923  			break;
99624bdff86707 Matthew Brost 2025-03-05  924  	}
99624bdff86707 Matthew Brost 2025-03-05  925  
99624bdff86707 Matthew Brost 2025-03-05  926  	if (i == gpusvm->num_chunks)
99624bdff86707 Matthew Brost 2025-03-05  927  		return LONG_MAX;
99624bdff86707 Matthew Brost 2025-03-05  928  
99624bdff86707 Matthew Brost 2025-03-05  929  	/*
99624bdff86707 Matthew Brost 2025-03-05  930  	 * If allocation more than page, ensure not to overlap with existing
99624bdff86707 Matthew Brost 2025-03-05  931  	 * ranges.
99624bdff86707 Matthew Brost 2025-03-05  932  	 */
99624bdff86707 Matthew Brost 2025-03-05 @933  	if (end - start != SZ_4K) {
99624bdff86707 Matthew Brost 2025-03-05  934  		struct drm_gpusvm_range *range;
99624bdff86707 Matthew Brost 2025-03-05  935  
99624bdff86707 Matthew Brost 2025-03-05  936  		range = drm_gpusvm_range_find(notifier, start, end);
99624bdff86707 Matthew Brost 2025-03-05  937  		if (range) {
99624bdff86707 Matthew Brost 2025-03-05  938  			++i;
99624bdff86707 Matthew Brost 2025-03-05  939  			goto retry;
99624bdff86707 Matthew Brost 2025-03-05  940  		}
99624bdff86707 Matthew Brost 2025-03-05  941  
99624bdff86707 Matthew Brost 2025-03-05  942  		/*
99624bdff86707 Matthew Brost 2025-03-05  943  		 * XXX: Only create range on pages CPU has faulted in. Without
99624bdff86707 Matthew Brost 2025-03-05  944  		 * this check, or prefault, on BMG 'xe_exec_system_allocator --r
99624bdff86707 Matthew Brost 2025-03-05  945  		 * process-many-malloc' fails. In the failure case, each process
99624bdff86707 Matthew Brost 2025-03-05  946  		 * mallocs 16k but the CPU VMA is ~128k which results in 64k SVM
99624bdff86707 Matthew Brost 2025-03-05  947  		 * ranges. When migrating the SVM ranges, some processes fail in
99624bdff86707 Matthew Brost 2025-03-05  948  		 * drm_gpusvm_migrate_to_devmem with 'migrate.cpages != npages'
99624bdff86707 Matthew Brost 2025-03-05  949  		 * and then upon drm_gpusvm_range_get_pages device pages from
99624bdff86707 Matthew Brost 2025-03-05  950  		 * other processes are collected + faulted in which creates all
99624bdff86707 Matthew Brost 2025-03-05  951  		 * sorts of problems. Unsure exactly how this happening, also
99624bdff86707 Matthew Brost 2025-03-05  952  		 * problem goes away if 'xe_exec_system_allocator --r
99624bdff86707 Matthew Brost 2025-03-05  953  		 * process-many-malloc' mallocs at least 64k at a time.
99624bdff86707 Matthew Brost 2025-03-05  954  		 */
99624bdff86707 Matthew Brost 2025-03-05  955  		if (end - start <= check_pages_threshold &&
99624bdff86707 Matthew Brost 2025-03-05  956  		    !drm_gpusvm_check_pages(gpusvm, notifier, start, end)) {
99624bdff86707 Matthew Brost 2025-03-05  957  			++i;
99624bdff86707 Matthew Brost 2025-03-05  958  			goto retry;
99624bdff86707 Matthew Brost 2025-03-05  959  		}
99624bdff86707 Matthew Brost 2025-03-05  960  	}
99624bdff86707 Matthew Brost 2025-03-05  961  
99624bdff86707 Matthew Brost 2025-03-05  962  	return end - start;
99624bdff86707 Matthew Brost 2025-03-05  963  }
99624bdff86707 Matthew Brost 2025-03-05  964  

:::::: The code at line 933 was first introduced by commit
:::::: 99624bdff8670795b678eafa6509aaad3a5c0175 drm/gpusvm: Add support for GPU Shared Virtual Memory

:::::: TO: Matthew Brost <matthew.brost@intel.com>
:::::: CC: Matthew Brost <matthew.brost@intel.com>

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

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

end of thread, other threads:[~2026-01-10 20:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-10  6:57 drivers/gpu/drm/drm_gpusvm.c:933 drm_gpusvm_range_chunk_size() error: uninitialized symbol 'end' kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-01-10 20:13 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.