CC: [email protected] CC: [email protected] CC: [email protected] TO: Sudeep Holla <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git v5.15/pcc_type3 head: db918d7c13901646937da28423737c14528b9379 commit: 6eca3b7aff77252d2cf75ebc9c97697413e3500f [11/14] mailbox: pcc: Drop handling invalid bit-width in {read,write}_register :::::: branch date: 8 days ago :::::: commit date: 8 days ago config: i386-randconfig-c001-20211021 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 3cea2505fd8d99a9ba0cb625aecfe28a47c4e3f8) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/commit/?id=6eca3b7aff77252d2cf75ebc9c97697413e3500f git remote add sudeep-holla https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git git fetch --no-tags sudeep-holla v5.15/pcc_type3 git checkout 6eca3b7aff77252d2cf75ebc9c97697413e3500f # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) VERBOSE_TOROUT_STRING("cxt.lwsa: Out of memory"); ^ include/linux/torture.h:34:34: note: expanded from macro 'VERBOSE_TOROUT_STRING' #define VERBOSE_TOROUT_STRING(s) \ ^ kernel/locking/locktorture.c:977:4: note: Control jumps to line 1107 goto unwind; ^ kernel/locking/locktorture.c:1108:2: note: Calling 'lock_torture_cleanup' lock_torture_cleanup(); ^~~~~~~~~~~~~~~~~~~~~~ kernel/locking/locktorture.c:844:6: note: Assuming the condition is false if (torture_cleanup_begin()) ^~~~~~~~~~~~~~~~~~~~~~~ kernel/locking/locktorture.c:844:2: note: Taking false branch if (torture_cleanup_begin()) ^ kernel/locking/locktorture.c:854:6: note: Assuming field 'lwsa' is non-null if (!cxt.lwsa && !cxt.lrsa) ^~~~~~~~~ kernel/locking/locktorture.c:854:16: note: Left side of '&&' is false if (!cxt.lwsa && !cxt.lrsa) ^ kernel/locking/locktorture.c:857:6: note: Assuming 'writer_tasks' is null if (writer_tasks) { ^~~~~~~~~~~~ kernel/locking/locktorture.c:857:2: note: Taking false branch if (writer_tasks) { ^ kernel/locking/locktorture.c:865:6: note: Assuming 'reader_tasks' is null if (reader_tasks) { ^~~~~~~~~~~~ kernel/locking/locktorture.c:865:2: note: Taking false branch if (reader_tasks) { ^ kernel/locking/locktorture.c:874:2: note: Calling 'lock_torture_stats_print' lock_torture_stats_print(); /* -After- the stats thread is stopped! */ ^~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/locking/locktorture.c:781:6: note: Assuming field 'readlock' is null if (cxt.cur_ops->readlock) ^~~~~~~~~~~~~~~~~~~~~ kernel/locking/locktorture.c:781:2: note: Taking false branch if (cxt.cur_ops->readlock) ^ kernel/locking/locktorture.c:784:8: note: Calling 'kmalloc' buf = kmalloc(size, GFP_KERNEL); ^~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/slab.h:579:2: note: Taking false branch if (__builtin_constant_p(size)) { ^ include/linux/slab.h:596:9: note: Value assigned to 'cxt.lwsa' return __kmalloc(size, flags); ^~~~~~~~~~~~~~~~~~~~~~ include/linux/slab.h:596:2: note: Returning pointer, which participates in a condition later return __kmalloc(size, flags); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/locking/locktorture.c:784:8: note: Returning from 'kmalloc' buf = kmalloc(size, GFP_KERNEL); ^~~~~~~~~~~~~~~~~~~~~~~~~ kernel/locking/locktorture.c:785:6: note: Assuming 'buf' is non-null if (!buf) { ^~~~ kernel/locking/locktorture.c:785:2: note: Taking false branch if (!buf) { ^ kernel/locking/locktorture.c:791:29: note: Passing value via 2nd parameter 'statp' __torture_print_stats(buf, cxt.lwsa, true); ^~~~~~~~ kernel/locking/locktorture.c:791:2: note: Calling '__torture_print_stats' __torture_print_stats(buf, cxt.lwsa, true); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/locking/locktorture.c:744:22: note: Assuming 'statp' is null long max = 0, min = statp ? data_race(statp[0].n_lock_acquired) : 0; ^~~~~ kernel/locking/locktorture.c:744:22: note: '?' condition is false kernel/locking/locktorture.c:747:13: note: 'write' is true n_stress = write ? cxt.nrealwriters_stress : cxt.nrealreaders_stress; ^~~~~ kernel/locking/locktorture.c:747:13: note: '?' condition is true kernel/locking/locktorture.c:748:14: note: Assuming 'i' is < 'n_stress' for (i = 0; i < n_stress; i++) { ^~~~~~~~~~~~ kernel/locking/locktorture.c:748:2: note: Loop condition is true. Entering loop body for (i = 0; i < n_stress; i++) { ^ kernel/locking/locktorture.c:749:17: note: Dereference of null pointer if (data_race(statp[i].n_lock_fail)) ^ include/linux/compiler.h:218:3: note: expanded from macro 'data_race' expr; \ ^~~~ kernel/locking/locktorture.c:758:2: warning: Value stored to 'page' is never read [clang-analyzer-deadcode.DeadStores] page += sprintf(page, ^ ~~~~~~~~~~~~~ kernel/locking/locktorture.c:758:2: note: Value stored to 'page' is never read page += sprintf(page, ^ ~~~~~~~~~~~~~ Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. >> drivers/mailbox/pcc.c:190:6: warning: The left expression of the compound >> assignment is an uninitialized value. The computed value will also be >> garbage [clang-analyzer-core.uninitialized.Assign] val &= reg->preserve_mask; ^ drivers/mailbox/pcc.c:345:9: note: Calling 'pcc_chan_reg_read_modify_write' return pcc_chan_reg_read_modify_write(&pchan->db); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mailbox/pcc.c:184:2: note: 'val' declared without an initial value u64 val; ^~~~~~~ drivers/mailbox/pcc.c:186:8: note: Calling 'pcc_chan_reg_read' ret = pcc_chan_reg_read(reg, &val); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mailbox/pcc.c:153:6: note: Assuming field 'gas' is non-null, which participates in a condition later if (!reg->gas) { ^~~~~~~~~ drivers/mailbox/pcc.c:153:2: note: Taking false branch if (!reg->gas) { ^ drivers/mailbox/pcc.c:158:6: note: Assuming field 'vaddr' is non-null if (reg->vaddr) ^~~~~~~~~~ drivers/mailbox/pcc.c:158:2: note: Taking true branch if (reg->vaddr) ^ drivers/mailbox/pcc.c:159:3: note: Calling 'read_register' read_register(reg->vaddr, val, reg->gas->bit_width); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mailbox/pcc.c:115:2: note: 'Default' branch taken. Execution continues on line 115 switch (bit_width) { ^ drivers/mailbox/pcc.c:129:1: note: Returning without writing to '*val' } ^ drivers/mailbox/pcc.c:159:3: note: Returning from 'read_register' read_register(reg->vaddr, val, reg->gas->bit_width); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mailbox/pcc.c:163:2: note: Returning without writing to '*val' return ret; ^ drivers/mailbox/pcc.c:163:2: note: Returning zero (loaded from 'ret'), which participates in a condition later return ret; ^~~~~~~~~~ drivers/mailbox/pcc.c:186:8: note: Returning from 'pcc_chan_reg_read' ret = pcc_chan_reg_read(reg, &val); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mailbox/pcc.c:187:6: note: 'ret' is 0 if (ret) ^~~ drivers/mailbox/pcc.c:187:2: note: Taking false branch if (ret) ^ drivers/mailbox/pcc.c:190:6: note: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage val &= reg->preserve_mask; ~~~ ^ Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. vim +190 drivers/mailbox/pcc.c 3cae27675219cd5 Sudeep Holla 2021-07-08 180 3cae27675219cd5 Sudeep Holla 2021-07-08 181 static int pcc_chan_reg_read_modify_write(struct pcc_chan_reg *reg) 3cae27675219cd5 Sudeep Holla 2021-07-08 182 { 3cae27675219cd5 Sudeep Holla 2021-07-08 183 int ret = 0; 3cae27675219cd5 Sudeep Holla 2021-07-08 184 u64 val; 3cae27675219cd5 Sudeep Holla 2021-07-08 185 3cae27675219cd5 Sudeep Holla 2021-07-08 186 ret = pcc_chan_reg_read(reg, &val); 3cae27675219cd5 Sudeep Holla 2021-07-08 187 if (ret) 3cae27675219cd5 Sudeep Holla 2021-07-08 188 return ret; 3cae27675219cd5 Sudeep Holla 2021-07-08 189 3cae27675219cd5 Sudeep Holla 2021-07-08 @190 val &= reg->preserve_mask; 3cae27675219cd5 Sudeep Holla 2021-07-08 191 val |= reg->set_mask; 3cae27675219cd5 Sudeep Holla 2021-07-08 192 3cae27675219cd5 Sudeep Holla 2021-07-08 193 return pcc_chan_reg_write(reg, val); 3cae27675219cd5 Sudeep Holla 2021-07-08 194 } 3cae27675219cd5 Sudeep Holla 2021-07-08 195 :::::: The code at line 190 was first introduced by commit :::::: 3cae27675219cd587c6a31a63719110c1307fa3a mailbox: pcc: Add PCC register bundle and associated accessor functions :::::: TO: Sudeep Holla <[email protected]> :::::: CC: Sudeep Holla <[email protected]> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
