All of lore.kernel.org
 help / color / mirror / Atom feed
* [ammarfaizi2-block:google/android/kernel/common/android12-kiwi-5.10 6824/9999] arch/x86/events/intel/pt.c:475:44: warning: shift by count ('32') >= precision of type ('32')
@ 2022-07-08 19:48 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-07-08 19:48 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 10448 bytes --]

:::::: 
:::::: Manual check reason: "low confidence bisect report"
:::::: Manual check reason: "low confidence static check first_new_problem: arch/x86/events/intel/pt.c:475:44: warning: shift by count ('32') >= precision of type ('32') [-Wanalyzer-shift-count-overflow]"
:::::: 

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
TO: Ammar Faizi <ammarfaizi2@gnuweeb.org>

tree:   https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android12-kiwi-5.10
head:   edf4da79d443f97049926ace891b5d6d235f7539
commit: c108d79a122aa94d1c5fe6305be8c4fec4b64ec5 [6824/9999] UPSTREAM: ubsan: disable object-size sanitizer under GCC
:::::: branch date: 3 months ago
:::::: commit date: 9 months ago
config: i386-randconfig-c001 (https://download.01.org/0day-ci/archive/20220709/202207090313.a7NETolk-lkp(a)intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
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://github.com/ammarfaizi2/linux-block/commit/c108d79a122aa94d1c5fe6305be8c4fec4b64ec5
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block google/android/kernel/common/android12-kiwi-5.10
        git checkout c108d79a122aa94d1c5fe6305be8c4fec4b64ec5
        # save the config file
         ARCH=i386 KBUILD_USERCFLAGS='-fanalyzer -Wno-error' 

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>


gcc-analyzer warnings: (new ones prefixed by >>)
   arch/x86/events/intel/pt.c: In function 'pt_config_filters':
>> arch/x86/events/intel/pt.c:475:44: warning: shift by count ('32') >= precision of type ('32') [-Wanalyzer-shift-count-overflow]
     475 |                 rtit_ctl |= filter->config << pt_address_ranges[range].reg_off;
         |                                            ^~
     'pt_event_add.part.0': events 1-2
       |
       | 1634 | static int pt_event_add(struct perf_event *event, int mode)
       |      |            ^~~~~~~~~~~~
       |      |            |
       |      |            (1) entry to 'pt_event_add.part.0'
       |......
       | 1644 |                 pt_event_start(event, 0);
       |      |                 ~~~~~~~~~~~~~~~~~~~~~~~~
       |      |                 |
       |      |                 (2) calling 'pt_event_start' from 'pt_event_add.part.0'
       |
       +--> 'pt_event_start': events 3-6
              |
              | 1513 | static void pt_event_start(struct perf_event *event, int mode)
              |      |             ^~~~~~~~~~~~~~
              |      |             |
              |      |             (3) entry to 'pt_event_start'
              |......
              | 1520 |         if (!buf)
              |      |            ~ 
              |      |            |
              |      |            (4) following 'false' branch (when 'buf' is non-NULL)...
              |......
              | 1523 |         pt_buffer_reset_offsets(buf, pt->handle.head);
              |      |         ~~~~~~~~~~~~~~~~~~~~~~~
              |      |         |
              |      |         (5) ...to here
              |......
              | 1533 |         pt_config(event);
              |      |         ~~~~~~~~~~~~~~~~
              |      |         |
              |      |         (6) calling 'pt_config' from 'pt_event_start'
              |
              +--> 'pt_config': events 7-8
                     |
                     |  481 | static void pt_config(struct perf_event *event)
                     |      |             ^~~~~~~~~
                     |      |             |
                     |      |             (7) entry to 'pt_config'
                     |......
                     |  493 |         reg = pt_config_filters(event);
                     |      |               ~~~~~~~~~~~~~~~~~~~~~~~~
                     |      |               |
                     |      |               (8) calling 'pt_config_filters' from 'pt_config'
                     |
                     +--> 'pt_config_filters': events 9-16
                            |
                            |  440 | static u64 pt_config_filters(struct perf_event *event)
                            |      |            ^~~~~~~~~~~~~~~~~
                            |      |            |
                            |      |            (9) entry to 'pt_config_filters'
                            |......
                            |  447 |         if (!filters)
                            |      |            ~
                            |      |            |
                            |      |            (10) following 'false' branch (when 'filters' is non-NULL)...
                            |......
                            |  450 |         perf_event_addr_filters_sync(event);
                            |      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            |      |         |
                            |      |         (11) ...to here
                            |  451 | 
                            |  452 |         for (range = 0; range < filters->nr_filters; range++) {
                            |      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            |      |                               |
                            |      |                               (12) following 'true' branch...
                            |  453 |                 struct pt_filter *filter = &filters->filter[range];
                            |      |                 ~~~~~~
                            |      |                 |
                            |      |                 (13) ...to here
                            |......
                            |  475 |                 rtit_ctl |= filter->config << pt_address_ranges[range].reg_off;
                            |      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            |      |                                            |                   |
                            |      |                                            |                   (15) ...to here
                            |      |                                            (14) following 'true' branch...
                            |      |                                            (16) shift by count '32' here
                            |

vim +475 arch/x86/events/intel/pt.c

eadf48cab4b6b0a Alexander Shishkin 2016-04-27  439  
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  440  static u64 pt_config_filters(struct perf_event *event)
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  441  {
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  442  	struct pt_filters *filters = event->hw.addr_filters;
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  443  	struct pt *pt = this_cpu_ptr(&pt_ctx);
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  444  	unsigned int range = 0;
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  445  	u64 rtit_ctl = 0;
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  446  
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  447  	if (!filters)
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  448  		return 0;
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  449  
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  450  	perf_event_addr_filters_sync(event);
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  451  
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  452  	for (range = 0; range < filters->nr_filters; range++) {
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  453  		struct pt_filter *filter = &filters->filter[range];
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  454  
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  455  		/*
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  456  		 * Note, if the range has zero start/end addresses due
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  457  		 * to its dynamic object not being loaded yet, we just
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  458  		 * go ahead and program zeroed range, which will simply
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  459  		 * produce no data. Note^2: if executable code at 0x0
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  460  		 * is a concern, we can set up an "invalid" configuration
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  461  		 * such as msr_b < msr_a.
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  462  		 */
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  463  
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  464  		/* avoid redundant msr writes */
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  465  		if (pt->filters.filter[range].msr_a != filter->msr_a) {
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  466  			wrmsrl(pt_address_ranges[range].msr_a, filter->msr_a);
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  467  			pt->filters.filter[range].msr_a = filter->msr_a;
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  468  		}
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  469  
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  470  		if (pt->filters.filter[range].msr_b != filter->msr_b) {
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  471  			wrmsrl(pt_address_ranges[range].msr_b, filter->msr_b);
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  472  			pt->filters.filter[range].msr_b = filter->msr_b;
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  473  		}
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  474  
eadf48cab4b6b0a Alexander Shishkin 2016-04-27 @475  		rtit_ctl |= filter->config << pt_address_ranges[range].reg_off;
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  476  	}
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  477  
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  478  	return rtit_ctl;
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  479  }
eadf48cab4b6b0a Alexander Shishkin 2016-04-27  480  

:::::: The code@line 475 was first introduced by commit
:::::: eadf48cab4b6b0ab8bcd53feb7d52a71e72debd0 perf/x86/intel/pt: Add support for address range filtering in PT

:::::: TO: Alexander Shishkin <alexander.shishkin@linux.intel.com>
:::::: CC: Ingo Molnar <mingo@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-08 19:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-08 19:48 [ammarfaizi2-block:google/android/kernel/common/android12-kiwi-5.10 6824/9999] arch/x86/events/intel/pt.c:475:44: warning: shift by count ('32') >= precision of type ('32') 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.