* Re: [PATCH] drm/xe: fix devcoredump chunk alignmnent calculation
[not found] <20250429073407.3505712-1-arnd@kernel.org>
@ 2025-05-07 7:07 ` kernel test robot
2025-05-07 18:10 ` kernel test robot
1 sibling, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-05-07 7:07 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: llvm, oe-kbuild-all
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/xe: fix devcoredump chunk alignmnent calculation
[not found] <20250429073407.3505712-1-arnd@kernel.org>
2025-05-07 7:07 ` [PATCH] drm/xe: fix devcoredump chunk alignmnent calculation kernel test robot
@ 2025-05-07 18:10 ` kernel test robot
1 sibling, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-05-07 18:10 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: llvm, oe-kbuild-all
Hi Arnd,
kernel test robot noticed the following build warnings:
[auto build test WARNING on drm-xe/drm-xe-next]
[cannot apply to linus/master v6.15-rc5 next-20250507]
[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: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250508/202505080202.PVZkksZk-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250508/202505080202.PVZkksZk-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/202505080202.PVZkksZk-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/xe/xe_devcoredump.c:205:6: warning: variable 'chunk_offset' is used uninitialized whenever 'if' condition is false [-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 warning generated.
vim +205 drivers/gpu/drm/xe/xe_devcoredump.c
c4a2e5f865b7230 Matthew Brost 2025-04-23 173
4f04d07c0a94b0b Matthew Brost 2024-08-01 174 static ssize_t xe_devcoredump_read(char *buffer, loff_t offset,
4f04d07c0a94b0b Matthew Brost 2024-08-01 175 size_t count, void *data, size_t datalen)
4f04d07c0a94b0b Matthew Brost 2024-08-01 176 {
4f04d07c0a94b0b Matthew Brost 2024-08-01 177 struct xe_devcoredump *coredump = data;
4f04d07c0a94b0b Matthew Brost 2024-08-01 178 struct xe_devcoredump_snapshot *ss;
4f04d07c0a94b0b Matthew Brost 2024-08-01 179 ssize_t byte_copied;
15ba154d0115c83 Arnd Bergmann 2025-04-29 180 u32 chunk_offset;
4f04d07c0a94b0b Matthew Brost 2024-08-01 181
4f04d07c0a94b0b Matthew Brost 2024-08-01 182 if (!coredump)
4f04d07c0a94b0b Matthew Brost 2024-08-01 183 return -ENODEV;
4f04d07c0a94b0b Matthew Brost 2024-08-01 184
4f04d07c0a94b0b Matthew Brost 2024-08-01 185 ss = &coredump->snapshot;
4f04d07c0a94b0b Matthew Brost 2024-08-01 186
4f04d07c0a94b0b Matthew Brost 2024-08-01 187 /* Ensure delayed work is captured before continuing */
4f04d07c0a94b0b Matthew Brost 2024-08-01 188 flush_work(&ss->work);
4f04d07c0a94b0b Matthew Brost 2024-08-01 189
c4a2e5f865b7230 Matthew Brost 2025-04-23 190 if (ss->read.size > XE_DEVCOREDUMP_CHUNK_MAX)
c4a2e5f865b7230 Matthew Brost 2025-04-23 191 xe_pm_runtime_get(gt_to_xe(ss->gt));
c4a2e5f865b7230 Matthew Brost 2025-04-23 192
906c4b306e9340f John Harrison 2024-11-28 193 mutex_lock(&coredump->lock);
906c4b306e9340f John Harrison 2024-11-28 194
906c4b306e9340f John Harrison 2024-11-28 195 if (!ss->read.buffer) {
906c4b306e9340f John Harrison 2024-11-28 196 mutex_unlock(&coredump->lock);
4f04d07c0a94b0b Matthew Brost 2024-08-01 197 return -ENODEV;
906c4b306e9340f John Harrison 2024-11-28 198 }
4f04d07c0a94b0b Matthew Brost 2024-08-01 199
906c4b306e9340f John Harrison 2024-11-28 200 if (offset >= ss->read.size) {
906c4b306e9340f John Harrison 2024-11-28 201 mutex_unlock(&coredump->lock);
4f04d07c0a94b0b Matthew Brost 2024-08-01 202 return 0;
906c4b306e9340f John Harrison 2024-11-28 203 }
4f04d07c0a94b0b Matthew Brost 2024-08-01 204
c4a2e5f865b7230 Matthew Brost 2025-04-23 @205 if (offset >= ss->read.chunk_position + XE_DEVCOREDUMP_CHUNK_MAX ||
c4a2e5f865b7230 Matthew Brost 2025-04-23 206 offset < ss->read.chunk_position) {
15ba154d0115c83 Arnd Bergmann 2025-04-29 207 ss->read.chunk_position = div_u64_rem(offset,
15ba154d0115c83 Arnd Bergmann 2025-04-29 208 XE_DEVCOREDUMP_CHUNK_MAX, &chunk_offset)
15ba154d0115c83 Arnd Bergmann 2025-04-29 209 * XE_DEVCOREDUMP_CHUNK_MAX;
c4a2e5f865b7230 Matthew Brost 2025-04-23 210
c4a2e5f865b7230 Matthew Brost 2025-04-23 211 __xe_devcoredump_read(ss->read.buffer,
c4a2e5f865b7230 Matthew Brost 2025-04-23 212 XE_DEVCOREDUMP_CHUNK_MAX,
c4a2e5f865b7230 Matthew Brost 2025-04-23 213 ss->read.chunk_position, coredump);
c4a2e5f865b7230 Matthew Brost 2025-04-23 214 }
c4a2e5f865b7230 Matthew Brost 2025-04-23 215
4f04d07c0a94b0b Matthew Brost 2024-08-01 216 byte_copied = count < ss->read.size - offset ? count :
4f04d07c0a94b0b Matthew Brost 2024-08-01 217 ss->read.size - offset;
15ba154d0115c83 Arnd Bergmann 2025-04-29 218 memcpy(buffer, ss->read.buffer + chunk_offset, byte_copied);
4f04d07c0a94b0b Matthew Brost 2024-08-01 219
906c4b306e9340f John Harrison 2024-11-28 220 mutex_unlock(&coredump->lock);
906c4b306e9340f John Harrison 2024-11-28 221
c4a2e5f865b7230 Matthew Brost 2025-04-23 222 if (ss->read.size > XE_DEVCOREDUMP_CHUNK_MAX)
c4a2e5f865b7230 Matthew Brost 2025-04-23 223 xe_pm_runtime_put(gt_to_xe(ss->gt));
c4a2e5f865b7230 Matthew Brost 2025-04-23 224
4f04d07c0a94b0b Matthew Brost 2024-08-01 225 return byte_copied;
4f04d07c0a94b0b Matthew Brost 2024-08-01 226 }
4f04d07c0a94b0b Matthew Brost 2024-08-01 227
--
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:[~2025-05-07 18:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250429073407.3505712-1-arnd@kernel.org>
2025-05-07 7:07 ` [PATCH] drm/xe: fix devcoredump chunk alignmnent calculation kernel test robot
2025-05-07 18:10 ` 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