[PATCH v2 5/5] powerpc/cacheinfo: Print correct cache-sibling map/list for L2 cache

kernel test robot lkp at intel.com
Thu Dec 10 10:58:12 AEDT 2020


Hi "Gautham,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on powerpc/next]
[also build test WARNING on v5.10-rc7 next-20201209]
[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]

url:    https://github.com/0day-ci/linux/commits/Gautham-R-Shenoy/Extend-Parsing-ibm-thread-groups-for-Shared-L2-information/20201210-011226
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc64-randconfig-r031-20201209 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 1968804ac726e7674d5de22bc2204b45857da344)
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
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/61bd9b188793d5009b5cdf310149e498264e6d57
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Gautham-R-Shenoy/Extend-Parsing-ibm-thread-groups-for-Shared-L2-information/20201210-011226
        git checkout 61bd9b188793d5009b5cdf310149e498264e6d57
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:125:1: note: expanded from here
   __do_insb
   ^
   arch/powerpc/include/asm/io.h:556:56: note: expanded from macro '__do_insb'
   #define __do_insb(p, b, n)      readsb((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/kernel/cacheinfo.c:21:
   In file included from arch/powerpc/include/asm/prom.h:21:
   In file included from include/linux/of_address.h:7:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:127:1: note: expanded from here
   __do_insw
   ^
   arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
   #define __do_insw(p, b, n)      readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/kernel/cacheinfo.c:21:
   In file included from arch/powerpc/include/asm/prom.h:21:
   In file included from include/linux/of_address.h:7:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:129:1: note: expanded from here
   __do_insl
   ^
   arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
   #define __do_insl(p, b, n)      readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/kernel/cacheinfo.c:21:
   In file included from arch/powerpc/include/asm/prom.h:21:
   In file included from include/linux/of_address.h:7:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:131:1: note: expanded from here
   __do_outsb
   ^
   arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
   #define __do_outsb(p, b, n)     writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/kernel/cacheinfo.c:21:
   In file included from arch/powerpc/include/asm/prom.h:21:
   In file included from include/linux/of_address.h:7:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:133:1: note: expanded from here
   __do_outsw
   ^
   arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
   #define __do_outsw(p, b, n)     writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/kernel/cacheinfo.c:21:
   In file included from arch/powerpc/include/asm/prom.h:21:
   In file included from include/linux/of_address.h:7:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:135:1: note: expanded from here
   __do_outsl
   ^
   arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
   #define __do_outsl(p, b, n)     writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   arch/powerpc/kernel/cacheinfo.c:679:28: error: use of undeclared identifier 'thread_group_shares_l2'; did you mean 'thread_group_leader'?
                   if (cache->level == 2 && thread_group_shares_l2)
                                            ^~~~~~~~~~~~~~~~~~~~~~
                                            thread_group_leader
   include/linux/sched/signal.h:652:20: note: 'thread_group_leader' declared here
   static inline bool thread_group_leader(struct task_struct *p)
                      ^
>> arch/powerpc/kernel/cacheinfo.c:679:28: warning: address of function 'thread_group_leader' will always evaluate to 'true' [-Wpointer-bool-conversion]
                   if (cache->level == 2 && thread_group_shares_l2)
                                         ~~ ^~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/kernel/cacheinfo.c:679:28: note: prefix with the address-of operator to silence this warning
                   if (cache->level == 2 && thread_group_shares_l2)
                                            ^
                                            &
   arch/powerpc/kernel/cacheinfo.c:680:11: error: implicit declaration of function 'cpu_l2_cache_mask' [-Werror,-Wimplicit-function-declaration]
                           return cpu_l2_cache_mask(cpu);
                                  ^
>> arch/powerpc/kernel/cacheinfo.c:680:11: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'const struct cpumask *' [-Wint-conversion]
                           return cpu_l2_cache_mask(cpu);
                                  ^~~~~~~~~~~~~~~~~~~~~~
   14 warnings and 2 errors generated.

vim +679 arch/powerpc/kernel/cacheinfo.c

   655	
   656	/*
   657	 * On big-core systems, each core has two groups of CPUs each of which
   658	 * has its own L1-cache. The thread-siblings which share l1-cache with
   659	 * @cpu can be obtained via cpu_smallcore_mask().
   660	 *
   661	 * On some big-core systems, the L2 cache is shared only between some
   662	 * groups of siblings. This is already parsed and encoded in
   663	 * cpu_l2_cache_mask().
   664	 *
   665	 * TODO: cache_lookup_or_instantiate() needs to be made aware of the
   666	 *       "ibm,thread-groups" property so that cache->shared_cpu_map
   667	 *       reflects the correct siblings on platforms that have this
   668	 *       device-tree property. This helper function is only a stop-gap
   669	 *       solution so that we report the correct siblings to the
   670	 *       userspace via sysfs.
   671	 */
   672	static const struct cpumask *get_shared_cpu_map(struct cache_index_dir *index, struct cache *cache)
   673	{
   674	#ifdef CONFIG_PPC64
   675		if (has_big_cores) {
   676			int cpu = index_dir_to_cpu(index);
   677			if (cache->level == 1)
   678				return cpu_smallcore_mask(cpu);
 > 679			if (cache->level == 2 && thread_group_shares_l2)
 > 680				return cpu_l2_cache_mask(cpu);
   681		}
   682	#endif
   683	
   684		return &cache->shared_cpu_map;
   685	}
   686	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 37110 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20201210/779707d9/attachment-0001.gz>


More information about the Linuxppc-dev mailing list