Subject: Re: [PATCH v3] powerpc/xmon: Support dumping software pagetables

From: kbuild test robot <[email-masked]>
Date: Thu, 12 Oct 2017 16:57:56 +0800

Hi Balbir,

[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.14-rc4 next-20171009]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Michael-Ellerman/powerpc-xmon-Support-dumping-software-pagetables/20171012-124024
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-ppc64e_defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=powerpc 

All error/warnings (new ones prefixed by >>):

   In file included from arch/powerpc/include/asm/nohash/pgtable.h:5:0,
                    from arch/powerpc/include/asm/pgtable.h:18,
                    from include/linux/memremap.h:7,
                    from include/linux/mm.h:26,
                    from arch/powerpc/xmon/xmon.c:18:
   arch/powerpc/xmon/xmon.c: In function 'show_pte':
>> arch/powerpc/include/asm/nohash/64/pgtable.h:158:40: error: right shift count >= width of type [-Werror=shift-count-overflow]
    #define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & (PTRS_PER_PGD - 1))
                                           ^
>> arch/powerpc/include/asm/nohash/64/pgtable.h:160:47: note: in expansion of macro 'pgd_index'
    #define pgd_offset(mm, address)  ((mm)->pgd + pgd_index(address))
                                                  ^~~~~~~~~
>> arch/powerpc/include/asm/nohash/64/pgtable.h:173:31: note: in expansion of macro 'pgd_offset'
    #define pgd_offset_k(address) pgd_offset(&init_mm, address)
                                  ^~~~~~~~~~
>> arch/powerpc/xmon/xmon.c:2992:11: note: in expansion of macro 'pgd_offset_k'
      pgdir = pgd_offset_k(0);
              ^~~~~~~~~~~~
>> arch/powerpc/include/asm/nohash/64/pgtable.h:158:40: error: right shift count >= width of type [-Werror=shift-count-overflow]
    #define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & (PTRS_PER_PGD - 1))
                                           ^
>> arch/powerpc/include/asm/nohash/64/pgtable.h:160:47: note: in expansion of macro 'pgd_index'
    #define pgd_offset(mm, address)  ((mm)->pgd + pgd_index(address))
                                                  ^~~~~~~~~
>> arch/powerpc/xmon/xmon.c:2995:11: note: in expansion of macro 'pgd_offset'
      pgdir = pgd_offset(mm, 0);
              ^~~~~~~~~~
   cc1: all warnings being treated as errors

vim +/pgd_offset +173 arch/powerpc/include/asm/nohash/64/pgtable.h

f281b5d5 arch/powerpc/include/asm/pgtable-ppc64.h Aneesh Kumar K.V 2015-12-01  153  
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  154  /*
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  155   * Find an entry in a page-table-directory.  We combine the address region
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  156   * (the high order N bits) and the pgd portion of the address.
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  157   */
0e5f35d0 arch/powerpc/include/asm/pgtable-ppc64.h Aneesh Kumar K.V 2013-04-28 @158  #define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & (PTRS_PER_PGD - 1))
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  159  
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30 @160  #define pgd_offset(mm, address)	 ((mm)->pgd + pgd_index(address))
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  161  
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  162  #define pmd_offset(pudp,addr) \
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  163    (((pmd_t *) pud_page_vaddr(*(pudp))) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  164  
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  165  #define pte_offset_kernel(dir,addr) \
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  166    (((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  167  
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  168  #define pte_offset_map(dir,addr)	pte_offset_kernel((dir), (addr))
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  169  #define pte_unmap(pte)			do { } while(0)
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  170  
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  171  /* to find an entry in a kernel page-table-directory */
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  172  /* This now only contains the vmalloc pages */
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30 @173  #define pgd_offset_k(address) pgd_offset(&init_mm, address)
78f1dbde arch/powerpc/include/asm/pgtable-ppc64.h Aneesh Kumar K.V 2012-09-10  174  extern void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
78f1dbde arch/powerpc/include/asm/pgtable-ppc64.h Aneesh Kumar K.V 2012-09-10  175  			    pte_t *ptep, unsigned long pte, int huge);
f88df14b include/asm-powerpc/pgtable-ppc64.h      David Gibson     2007-04-30  176  

:::::: The code at line 173 was first introduced by commit
:::::: f88df14b1f15cdeffa060580a40c1ce3e13bb79e [POWERPC] Remove arch/powerpc's dependence on asm-ppc/pg{alloc,table}.h

:::::: TO: David Gibson <[email-masked]>
:::::: CC: Paul Mackerras <[email-masked]>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation