On Sun, Jun 07, 2020 at 02:18:26PM +0800, kernel test robot wrote: > tree: https://github.com/hnaz/linux-mm master > head: 82f0963cec9bc87571b9666fee12a6a2e47d1193 > commit: aecd6390e2fec5d15dea7c20a8d44d3a00ace96e [432/544] mm: consolidate pgd_index() and pgd_offset{_k}() definitions > config: powerpc-randconfig-r035-20200607 (attached as .config) > compiler: powerpc-linux-gcc (GCC) 9.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 > git checkout aecd6390e2fec5d15dea7c20a8d44d3a00ace96e > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot <lkp@xxxxxxxxx> > > All error/warnings (new ones prefixed by >>, old ones prefixed by <<): > > In file included from arch/powerpc/include/asm/nohash/pgtable.h:8, > from arch/powerpc/include/asm/pgtable.h:20, > from include/linux/pgtable.h:6, > from arch/powerpc/include/asm/kup.h:42, > from arch/powerpc/include/asm/uaccess.h:9, > from include/linux/uaccess.h:11, > from include/linux/crypto.h:21, > from include/crypto/hash.h:11, > from include/linux/uio.h:10, > from include/linux/socket.h:8, > from include/linux/compat.h:15, > from arch/powerpc/kernel/asm-offsets.c:14: > arch/powerpc/include/asm/nohash/32/pgtable.h: In function 'pte_update': > << from arch/powerpc/include/asm/nohash/32/pgtable.h:5, > >> arch/powerpc/include/asm/nohash/32/pgtable.h:237:37: error: implicit declaration of function 'pgd_offset'; did you mean 'pmd_offset'? [-Werror=implicit-function-declaration] > 237 | pmd_t *pmd = pmd_offset(pud_offset(pgd_offset(mm, addr), addr), addr); > | ^~~~~~~~~~ > | pmd_offset > << from arch/powerpc/include/asm/nohash/32/pgtable.h:5, > >> arch/powerpc/include/asm/nohash/32/pgtable.h:237:37: warning: passing argument 1 of 'pud_offset' makes pointer from integer without a cast [-Wint-conversion] > 237 | pmd_t *pmd = pmd_offset(pud_offset(pgd_offset(mm, addr), addr), addr); > | ^~~~~~~~~~~~~~~~~~~~ > | | > | int Argh, this didn't show up just a few days ago...:( All I can suggest is to restore pgd_index() and pgd_offset() macros like Stephen did in next-20200605 and then look for a better solution after merge window is over... >From 84a833eaacd3593c2487fc6ce5b5dfe5873dfed6 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> Date: Thu, 4 Jun 2020 21:06:11 +1000 Subject: [PATCH] mm-consolidate-pgd_index-and-pgd_offset_k-definitions-fix-3 Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> --- arch/powerpc/include/asm/nohash/32/pgtable.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/nohash/32/pgtable.h b/arch/powerpc/include/asm/nohash/32/pgtable.h index 7e60bcb8fc26..1927e1b653f2 100644 --- a/arch/powerpc/include/asm/nohash/32/pgtable.h +++ b/arch/powerpc/include/asm/nohash/32/pgtable.h @@ -205,6 +205,9 @@ static inline void pmd_clear(pmd_t *pmdp) *pmdp = __pmd(0); } +/* to find an entry in a page-table-directory */ +#define pgd_index(address) ((address) >> PGDIR_SHIFT) +#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) /* * PTE updates. This function is called whenever an existing @@ -234,7 +237,7 @@ static inline pte_basic_t pte_update(struct mm_struct *mm, unsigned long addr, p pte_basic_t old = pte_val(*p); pte_basic_t new = (old & ~(pte_basic_t)clr) | set; int num, i; - pmd_t *pmd = pmd_offset(pud_offset(pgd_offset(mm, addr), addr), addr); + pmd_t *pmd = pmd_offset(pud_offset(p4d_offset(pgd_offset(mm, addr), addr), addr), addr); if (!huge) num = PAGE_SIZE / SZ_4K; -- 2.26.2 > In file included from include/asm-generic/pgtable-nopmd.h:7, > from arch/powerpc/include/asm/nohash/32/pgtable.h:5, > from arch/powerpc/include/asm/nohash/pgtable.h:8, > from arch/powerpc/include/asm/pgtable.h:20, > from include/linux/pgtable.h:6, > from arch/powerpc/include/asm/kup.h:42, > from arch/powerpc/include/asm/uaccess.h:9, > from include/linux/uaccess.h:11, > from include/linux/crypto.h:21, > from include/crypto/hash.h:11, > from include/linux/uio.h:10, > from include/linux/socket.h:8, > from include/linux/compat.h:15, > from arch/powerpc/kernel/asm-offsets.c:14: > include/asm-generic/pgtable-nopud.h:42:40: note: expected 'p4d_t *' {aka 'struct <anonymous> *'} but argument is of type 'int' > 42 | static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address) > | ~~~~~~~^~~ > cc1: some warnings being treated as errors > make[2]: *** [scripts/Makefile.build:114: arch/powerpc/kernel/asm-offsets.s] Error 1 > make[2]: Target '__build' not remade because of errors. > make[1]: *** [Makefile:1168: prepare0] Error 2 > make[1]: Target 'prepare' not remade because of errors. > make: *** [Makefile:185: __sub-make] Error 2 > > vim +237 arch/powerpc/include/asm/nohash/32/pgtable.h > > f281b5d50c87ec arch/powerpc/include/asm/pgtable-ppc32.h Aneesh Kumar K.V 2015-12-01 207 > f281b5d50c87ec arch/powerpc/include/asm/pgtable-ppc32.h Aneesh Kumar K.V 2015-12-01 208 > f88df14b1f15cd include/asm-powerpc/pgtable-ppc32.h David Gibson 2007-04-30 209 /* > c605782b1c3f1c arch/powerpc/include/asm/pgtable-ppc32.h Benjamin Herrenschmidt 2009-03-10 210 * PTE updates. This function is called whenever an existing > c605782b1c3f1c arch/powerpc/include/asm/pgtable-ppc32.h Benjamin Herrenschmidt 2009-03-10 211 * valid PTE is updated. This does -not- include set_pte_at() > c605782b1c3f1c arch/powerpc/include/asm/pgtable-ppc32.h Benjamin Herrenschmidt 2009-03-10 212 * which nowadays only sets a new PTE. > c605782b1c3f1c arch/powerpc/include/asm/pgtable-ppc32.h Benjamin Herrenschmidt 2009-03-10 213 * > c605782b1c3f1c arch/powerpc/include/asm/pgtable-ppc32.h Benjamin Herrenschmidt 2009-03-10 214 * Depending on the type of MMU, we may need to use atomic updates > c605782b1c3f1c arch/powerpc/include/asm/pgtable-ppc32.h Benjamin Herrenschmidt 2009-03-10 215 * and the PTE may be either 32 or 64 bit wide. In the later case, > c605782b1c3f1c arch/powerpc/include/asm/pgtable-ppc32.h Benjamin Herrenschmidt 2009-03-10 216 * when using atomic updates, only the low part of the PTE is > c605782b1c3f1c arch/powerpc/include/asm/pgtable-ppc32.h Benjamin Herrenschmidt 2009-03-10 217 * accessed atomically. > f88df14b1f15cd include/asm-powerpc/pgtable-ppc32.h David Gibson 2007-04-30 218 * > c605782b1c3f1c arch/powerpc/include/asm/pgtable-ppc32.h Benjamin Herrenschmidt 2009-03-10 219 * In addition, on 44x, we also maintain a global flag indicating > c605782b1c3f1c arch/powerpc/include/asm/pgtable-ppc32.h Benjamin Herrenschmidt 2009-03-10 220 * that an executable user mapping was modified, which is needed > c605782b1c3f1c arch/powerpc/include/asm/pgtable-ppc32.h Benjamin Herrenschmidt 2009-03-10 221 * to properly flush the virtually tagged instruction cache of > c605782b1c3f1c arch/powerpc/include/asm/pgtable-ppc32.h Benjamin Herrenschmidt 2009-03-10 222 * those implementations. > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 223 * > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 224 * On the 8xx, the page tables are a bit special. For 16k pages, we have > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 225 * 4 identical entries. For 512k pages, we have 128 entries as if it was > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 226 * 4k pages, but they are flagged as 512k pages for the hardware. > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 227 * For other page sizes, we have a single entry in the table. > f88df14b1f15cd include/asm-powerpc/pgtable-ppc32.h David Gibson 2007-04-30 228 */ > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 229 #ifdef CONFIG_PPC_8xx > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 230 static inline pte_basic_t pte_update(struct mm_struct *mm, unsigned long addr, pte_t *p, > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 231 unsigned long clr, unsigned long set, int huge) > f88df14b1f15cd include/asm-powerpc/pgtable-ppc32.h David Gibson 2007-04-30 232 { > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 233 pte_basic_t *entry = &p->pte; > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 234 pte_basic_t old = pte_val(*p); > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 235 pte_basic_t new = (old & ~(pte_basic_t)clr) | set; > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 236 int num, i; > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 @237 pmd_t *pmd = pmd_offset(pud_offset(pgd_offset(mm, addr), addr), addr); > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 238 > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 239 if (!huge) > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 240 num = PAGE_SIZE / SZ_4K; > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 241 else if ((pmd_val(*pmd) & _PMD_PAGE_MASK) != _PMD_PAGE_8M) > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 242 num = SZ_512K / SZ_4K; > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 243 else > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 244 num = 1; > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 245 > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 246 for (i = 0; i < num; i++, entry++, new += SZ_4K) > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 247 *entry = new; > 1bc54c03117b90 include/asm-powerpc/pgtable-ppc32.h Benjamin Herrenschmidt 2008-07-08 248 > f88df14b1f15cd include/asm-powerpc/pgtable-ppc32.h David Gibson 2007-04-30 249 return old; > f88df14b1f15cd include/asm-powerpc/pgtable-ppc32.h David Gibson 2007-04-30 250 } > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 251 #else > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 252 static inline pte_basic_t pte_update(struct mm_struct *mm, unsigned long addr, pte_t *p, > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 253 unsigned long clr, unsigned long set, int huge) > f88df14b1f15cd include/asm-powerpc/pgtable-ppc32.h David Gibson 2007-04-30 254 { > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 255 pte_basic_t old = pte_val(*p); > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 256 pte_basic_t new = (old & ~(pte_basic_t)clr) | set; > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 257 > 1158b8c9d53efa arch/powerpc/include/asm/nohash/32/pgtable.h Andrew Morton 2020-06-04 258 *p = __pte(new); > 1bc54c03117b90 include/asm-powerpc/pgtable-ppc32.h Benjamin Herrenschmidt 2008-07-08 259 > > :::::: The code at line 237 was first introduced by commit > :::::: 1158b8c9d53efaf6059d77ccc8cf9b9bcdab8437 linux-next > > :::::: TO: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> > :::::: CC: Johannes Weiner <hannes@xxxxxxxxxxx> > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx -- Sincerely yours, Mike.