All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH] drm/xe: fix devcoredump chunk alignmnent calculation
Date: Wed, 7 May 2025 15:07:17 +0800	[thread overview]
Message-ID: <202505071439.ugStPmtl-lkp@intel.com> (raw)
In-Reply-To: <20250429073407.3505712-1-arnd@kernel.org>

Hi Arnd,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-xe/drm-xe-next]
[cannot apply to linus/master v6.15-rc5 next-20250506]
[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/Arnd-Bergmann/drm-xe-fix-devcoredump-chunk-alignmnent-calculation/20250429-153441
base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link:    https://lore.kernel.org/r/20250429073407.3505712-1-arnd%40kernel.org
patch subject: [PATCH] drm/xe: fix devcoredump chunk alignmnent calculation
config: i386-randconfig-013-20250506 (https://download.01.org/0day-ci/archive/20250507/202505071439.ugStPmtl-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250507/202505071439.ugStPmtl-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/202505071439.ugStPmtl-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/xe/xe_devcoredump.c:205:6: error: variable 'chunk_offset' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
     205 |         if (offset >= ss->read.chunk_position + XE_DEVCOREDUMP_CHUNK_MAX ||
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     206 |             offset < ss->read.chunk_position) {
         |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/xe/xe_devcoredump.c:218:35: note: uninitialized use occurs here
     218 |         memcpy(buffer, ss->read.buffer + chunk_offset, byte_copied);
         |                                          ^~~~~~~~~~~~
   include/linux/fortify-string.h:690:50: note: expanded from macro 'memcpy'
     690 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
         |                                                  ^
   include/linux/fortify-string.h:645:23: note: expanded from macro '__fortify_memcpy_chk'
     645 |         __underlying_##op(p, q, __copy_size);                           \
         |                              ^
   drivers/gpu/drm/xe/xe_devcoredump.c:205:2: note: remove the 'if' if its condition is always true
     205 |         if (offset >= ss->read.chunk_position + XE_DEVCOREDUMP_CHUNK_MAX ||
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     206 |             offset < ss->read.chunk_position) {
         |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/xe/xe_devcoredump.c:180:18: note: initialize the variable 'chunk_offset' to silence this warning
     180 |         u32 chunk_offset;
         |                         ^
         |                          = 0
   1 error generated.


vim +205 drivers/gpu/drm/xe/xe_devcoredump.c

c4a2e5f865b723 Matthew Brost 2025-04-23  173  
4f04d07c0a94b0 Matthew Brost 2024-08-01  174  static ssize_t xe_devcoredump_read(char *buffer, loff_t offset,
4f04d07c0a94b0 Matthew Brost 2024-08-01  175  				   size_t count, void *data, size_t datalen)
4f04d07c0a94b0 Matthew Brost 2024-08-01  176  {
4f04d07c0a94b0 Matthew Brost 2024-08-01  177  	struct xe_devcoredump *coredump = data;
4f04d07c0a94b0 Matthew Brost 2024-08-01  178  	struct xe_devcoredump_snapshot *ss;
4f04d07c0a94b0 Matthew Brost 2024-08-01  179  	ssize_t byte_copied;
15ba154d0115c8 Arnd Bergmann 2025-04-29  180  	u32 chunk_offset;
4f04d07c0a94b0 Matthew Brost 2024-08-01  181  
4f04d07c0a94b0 Matthew Brost 2024-08-01  182  	if (!coredump)
4f04d07c0a94b0 Matthew Brost 2024-08-01  183  		return -ENODEV;
4f04d07c0a94b0 Matthew Brost 2024-08-01  184  
4f04d07c0a94b0 Matthew Brost 2024-08-01  185  	ss = &coredump->snapshot;
4f04d07c0a94b0 Matthew Brost 2024-08-01  186  
4f04d07c0a94b0 Matthew Brost 2024-08-01  187  	/* Ensure delayed work is captured before continuing */
4f04d07c0a94b0 Matthew Brost 2024-08-01  188  	flush_work(&ss->work);
4f04d07c0a94b0 Matthew Brost 2024-08-01  189  
c4a2e5f865b723 Matthew Brost 2025-04-23  190  	if (ss->read.size > XE_DEVCOREDUMP_CHUNK_MAX)
c4a2e5f865b723 Matthew Brost 2025-04-23  191  		xe_pm_runtime_get(gt_to_xe(ss->gt));
c4a2e5f865b723 Matthew Brost 2025-04-23  192  
906c4b306e9340 John Harrison 2024-11-28  193  	mutex_lock(&coredump->lock);
906c4b306e9340 John Harrison 2024-11-28  194  
906c4b306e9340 John Harrison 2024-11-28  195  	if (!ss->read.buffer) {
906c4b306e9340 John Harrison 2024-11-28  196  		mutex_unlock(&coredump->lock);
4f04d07c0a94b0 Matthew Brost 2024-08-01  197  		return -ENODEV;
906c4b306e9340 John Harrison 2024-11-28  198  	}
4f04d07c0a94b0 Matthew Brost 2024-08-01  199  
906c4b306e9340 John Harrison 2024-11-28  200  	if (offset >= ss->read.size) {
906c4b306e9340 John Harrison 2024-11-28  201  		mutex_unlock(&coredump->lock);
4f04d07c0a94b0 Matthew Brost 2024-08-01  202  		return 0;
906c4b306e9340 John Harrison 2024-11-28  203  	}
4f04d07c0a94b0 Matthew Brost 2024-08-01  204  
c4a2e5f865b723 Matthew Brost 2025-04-23 @205  	if (offset >= ss->read.chunk_position + XE_DEVCOREDUMP_CHUNK_MAX ||
c4a2e5f865b723 Matthew Brost 2025-04-23  206  	    offset < ss->read.chunk_position) {
15ba154d0115c8 Arnd Bergmann 2025-04-29  207  		ss->read.chunk_position = div_u64_rem(offset,
15ba154d0115c8 Arnd Bergmann 2025-04-29  208  			XE_DEVCOREDUMP_CHUNK_MAX, &chunk_offset)
15ba154d0115c8 Arnd Bergmann 2025-04-29  209  			* XE_DEVCOREDUMP_CHUNK_MAX;
c4a2e5f865b723 Matthew Brost 2025-04-23  210  
c4a2e5f865b723 Matthew Brost 2025-04-23  211  		__xe_devcoredump_read(ss->read.buffer,
c4a2e5f865b723 Matthew Brost 2025-04-23  212  				      XE_DEVCOREDUMP_CHUNK_MAX,
c4a2e5f865b723 Matthew Brost 2025-04-23  213  				      ss->read.chunk_position, coredump);
c4a2e5f865b723 Matthew Brost 2025-04-23  214  	}
c4a2e5f865b723 Matthew Brost 2025-04-23  215  
4f04d07c0a94b0 Matthew Brost 2024-08-01  216  	byte_copied = count < ss->read.size - offset ? count :
4f04d07c0a94b0 Matthew Brost 2024-08-01  217  		ss->read.size - offset;
15ba154d0115c8 Arnd Bergmann 2025-04-29  218  	memcpy(buffer, ss->read.buffer + chunk_offset, byte_copied);
4f04d07c0a94b0 Matthew Brost 2024-08-01  219  
906c4b306e9340 John Harrison 2024-11-28  220  	mutex_unlock(&coredump->lock);
906c4b306e9340 John Harrison 2024-11-28  221  
c4a2e5f865b723 Matthew Brost 2025-04-23  222  	if (ss->read.size > XE_DEVCOREDUMP_CHUNK_MAX)
c4a2e5f865b723 Matthew Brost 2025-04-23  223  		xe_pm_runtime_put(gt_to_xe(ss->gt));
c4a2e5f865b723 Matthew Brost 2025-04-23  224  
4f04d07c0a94b0 Matthew Brost 2024-08-01  225  	return byte_copied;
4f04d07c0a94b0 Matthew Brost 2024-08-01  226  }
4f04d07c0a94b0 Matthew Brost 2024-08-01  227  

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

  parent reply	other threads:[~2025-05-07  7:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-29  7:34 [PATCH] drm/xe: fix devcoredump chunk alignmnent calculation Arnd Bergmann
2025-04-29  8:13 ` ✓ CI.Patch_applied: success for " Patchwork
2025-04-29  8:13 ` ✗ CI.checkpatch: warning " Patchwork
2025-04-29  8:14 ` ✓ CI.KUnit: success " Patchwork
2025-04-29  8:31 ` ✓ CI.Build: " Patchwork
2025-04-29  8:34 ` ✓ CI.Hooks: " Patchwork
2025-04-29  8:38 ` ✓ CI.checksparse: " Patchwork
2025-04-29 10:19 ` ✗ Xe.CI.Full: failure " Patchwork
2025-04-29 17:51 ` [PATCH] " Matthew Brost
2025-04-29 17:55   ` Matthew Brost
2025-05-06  7:14 ` ✗ Xe.CI.BAT: failure for " Patchwork
2025-05-06  7:49 ` Patchwork
2025-05-07  7:07 ` kernel test robot [this message]
2025-05-07 18:10 ` [PATCH] " kernel test robot

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=202505071439.ugStPmtl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=arnd@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 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.