CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Babu Moger <[email protected]>
CC: Borislav Petkov <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/urgent
head:   064855a69003c24bd6b473b367d364e418c57625
commit: 064855a69003c24bd6b473b367d364e418c57625 [2/2] x86/resctrl: Fix default 
monitoring groups reporting
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago
config: i386-randconfig-m021-20210812 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
arch/x86/kernel/cpu/resctrl/monitor.c:310 __mon_event_count() error: 
uninitialized symbol 'm'.
arch/x86/kernel/cpu/resctrl/monitor.c:315 __mon_event_count() error: 
potentially dereferencing uninitialized 'm'.

vim +/m +310 arch/x86/kernel/cpu/resctrl/monitor.c

ba0f26d8529c2d arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2018-04-20  287  
064855a69003c2 arch/x86/kernel/cpu/resctrl/monitor.c   Babu Moger      
2021-08-02  288  static u64 __mon_event_count(u32 rmid, struct rmid_read *rr)
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  289  {
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       
2017-07-25  290          struct mbm_state *m;
ba0f26d8529c2d arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2018-04-20  291          u64 chunks, tval;
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  292  
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  293          tval = __rmid_read(rmid, rr->evtid);
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  294          if (tval & (RMID_VAL_ERROR | RMID_VAL_UNAVAIL)) {
064855a69003c2 arch/x86/kernel/cpu/resctrl/monitor.c   Babu Moger      
2021-08-02  295                  return tval;
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  296          }
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  297          switch (rr->evtid) {
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  298          case QOS_L3_OCCUP_EVENT_ID:
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  299                  rr->val += tval;
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  300                  return 0;
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       
2017-07-25  301          case QOS_L3_MBM_TOTAL_EVENT_ID:
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       
2017-07-25  302                  m = &rr->d->mbm_total[rmid];
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       
2017-07-25  303                  break;
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       
2017-07-25  304          case QOS_L3_MBM_LOCAL_EVENT_ID:
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       
2017-07-25  305                  m = &rr->d->mbm_local[rmid];
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       
2017-07-25  306                  break;
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  307          }
a4de1dfdd72653 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  308  
a4de1dfdd72653 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  309          if (rr->first) {
ba0f26d8529c2d arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2018-04-20 @310                  memset(m, 0, sizeof(struct mbm_state));
ba0f26d8529c2d arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2018-04-20  311                  m->prev_bw_msr = m->prev_msr = tval;
a4de1dfdd72653 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  312                  return 0;
a4de1dfdd72653 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  313          }
a4de1dfdd72653 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  314  
46637d4570e108 arch/x86/kernel/cpu/resctrl/monitor.c   Reinette Chatre 
2020-05-05 @315          chunks = mbm_overflow_count(m->prev_msr, tval, 
rr->r->mbm_width);
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       
2017-07-25  316          m->chunks += chunks;
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       
2017-07-25  317          m->prev_msr = tval;
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       
2017-07-25  318  
4868a61d498af3 arch/x86/kernel/cpu/resctrl/monitor.c   Fenghua Yu      
2020-10-14  319          rr->val += get_corrected_mbm_count(rmid, m->chunks);
4868a61d498af3 arch/x86/kernel/cpu/resctrl/monitor.c   Fenghua Yu      
2020-10-14  320  
9f52425ba303d9 arch/x86/kernel/cpu/intel_rdt_monitor.c Tony Luck       
2017-07-25  321          return 0;
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  322  }
d89b7379015fc5 arch/x86/kernel/cpu/intel_rdt_monitor.c Vikas Shivappa  
2017-07-25  323  

:::::: The code at line 310 was first introduced by commit
:::::: ba0f26d8529c2dfc9aa6d9e8a338180737f8c1be x86/intel_rdt/mba_sc: Prepare 
for feedback loop

:::::: TO: Vikas Shivappa <[email protected]>
:::::: CC: Thomas Gleixner <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to