All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zach O'Keefe <zokeefe@google.com>
To: kbuild-all@lists.01.org
Subject: Re: [linux-next:master 4278/4736] arch/mips/include/asm/pgtable.h:238:39: error: missing binary operator before token "("
Date: Fri, 02 Sep 2022 17:32:20 -0700	[thread overview]
Message-ID: <YxKglGWKcBfFy9M4@google.com> (raw)
In-Reply-To: <202209021349.F73i5d6X-lkp@intel.com>

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

On Sep 02 13:19, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   e47eb90a0a9ae20b82635b9b99a8d0979b757ad8
> commit: 2abbc27432878c26759d2913a22a7a15a66b96fd [4278/4736] mm/khugepaged: use minimal bits to store num page < HPAGE_PMD_NR
> config: mips-randconfig-r013-20220901 (https://download.01.org/0day-ci/archive/20220902/202209021349.F73i5d6X-lkp(a)intel.com/config)
> compiler: mips-linux-gcc (GCC) 12.1.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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=2abbc27432878c26759d2913a22a7a15a66b96fd
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout 2abbc27432878c26759d2913a22a7a15a66b96fd
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All error/warnings (new ones prefixed by >>):
> 
>    In file included from include/linux/pgtable.h:6,
>                     from include/linux/mm.h:29,
>                     from mm/khugepaged.c:4:
> >> arch/mips/include/asm/pgtable.h:238:26: warning: "__builtin_ffs" is not defined, evaluates to 0 [-Wundef]
>      238 | #define PTE_T_LOG2      (__builtin_ffs(sizeof(pte_t)) - 1)
>          |                          ^~~~~~~~~~~~~
>    arch/mips/include/asm/pgtable-32.h:65:43: note: in expansion of macro 'PTE_T_LOG2'
>       65 | # define PGDIR_SHIFT    (2 * PAGE_SHIFT - PTE_T_LOG2 - 1)
>          |                                           ^~~~~~~~~~
>    include/asm-generic/pgtable-nop4d.h:11:33: note: in expansion of macro 'PGDIR_SHIFT'
>       11 | #define P4D_SHIFT               PGDIR_SHIFT
>          |                                 ^~~~~~~~~~~
>    include/asm-generic/pgtable-nopud.h:18:25: note: in expansion of macro 'P4D_SHIFT'
>       18 | #define PUD_SHIFT       P4D_SHIFT
>          |                         ^~~~~~~~~
>    include/asm-generic/pgtable-nopmd.h:20:25: note: in expansion of macro 'PUD_SHIFT'
>       20 | #define PMD_SHIFT       PUD_SHIFT
>          |                         ^~~~~~~~~
>    include/linux/huge_mm.h:109:25: note: in expansion of macro 'PMD_SHIFT'
>      109 | #define HPAGE_PMD_SHIFT PMD_SHIFT
>          |                         ^~~~~~~~~
>    include/linux/huge_mm.h:105:26: note: in expansion of macro 'HPAGE_PMD_SHIFT'
>      105 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
>          |                          ^~~~~~~~~~~~~~~
>    mm/khugepaged.c:90:5: note: in expansion of macro 'HPAGE_PMD_ORDER'
>       90 | #if HPAGE_PMD_ORDER < 16
>          |     ^~~~~~~~~~~~~~~
> >> arch/mips/include/asm/pgtable.h:238:39: error: missing binary operator before token "("
>      238 | #define PTE_T_LOG2      (__builtin_ffs(sizeof(pte_t)) - 1)
>          |                                       ^
>    arch/mips/include/asm/pgtable-32.h:65:43: note: in expansion of macro 'PTE_T_LOG2'
>       65 | # define PGDIR_SHIFT    (2 * PAGE_SHIFT - PTE_T_LOG2 - 1)
>          |                                           ^~~~~~~~~~
>    include/asm-generic/pgtable-nop4d.h:11:33: note: in expansion of macro 'PGDIR_SHIFT'
>       11 | #define P4D_SHIFT               PGDIR_SHIFT
>          |                                 ^~~~~~~~~~~
>    include/asm-generic/pgtable-nopud.h:18:25: note: in expansion of macro 'P4D_SHIFT'
>       18 | #define PUD_SHIFT       P4D_SHIFT
>          |                         ^~~~~~~~~
>    include/asm-generic/pgtable-nopmd.h:20:25: note: in expansion of macro 'PUD_SHIFT'
>       20 | #define PMD_SHIFT       PUD_SHIFT
>          |                         ^~~~~~~~~
>    include/linux/huge_mm.h:109:25: note: in expansion of macro 'PMD_SHIFT'
>      109 | #define HPAGE_PMD_SHIFT PMD_SHIFT
>          |                         ^~~~~~~~~
>    include/linux/huge_mm.h:105:26: note: in expansion of macro 'HPAGE_PMD_SHIFT'
>      105 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
>          |                          ^~~~~~~~~~~~~~~
>    mm/khugepaged.c:90:5: note: in expansion of macro 'HPAGE_PMD_ORDER'
>       90 | #if HPAGE_PMD_ORDER < 16
>          |     ^~~~~~~~~~~~~~~
> 
> 
> vim +238 arch/mips/include/asm/pgtable.h
> 
> ^1da177e4c3f41 include/asm-mips/pgtable.h Linus Torvalds 2005-04-16  235  
> 5ff974720abec2 include/asm-mips/pgtable.h Ralf Baechle   2007-08-01  236  #define PGD_T_LOG2	(__builtin_ffs(sizeof(pgd_t)) - 1)
> 5ff974720abec2 include/asm-mips/pgtable.h Ralf Baechle   2007-08-01  237  #define PMD_T_LOG2	(__builtin_ffs(sizeof(pmd_t)) - 1)
> 5ff974720abec2 include/asm-mips/pgtable.h Ralf Baechle   2007-08-01 @238  #define PTE_T_LOG2	(__builtin_ffs(sizeof(pte_t)) - 1)
> ^1da177e4c3f41 include/asm-mips/pgtable.h Linus Torvalds 2005-04-16  239  
> 
> :::::: The code at line 238 was first introduced by commit
> :::::: 5ff974720abec255c17af6f3732dd410d364e367 [MIPS] Fix computation of {PGD,PMD,PTE}_T_LOG2.
> 
> :::::: TO: Ralf Baechle <ralf@linux-mips.org>
> :::::: CC: Ralf Baechle <ralf@linux-mips.org>
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://01.org/lkp
> 

Sorry about this - have been trying to figure out what exactly is happening.

AFAICT this config doesn't even build on v5.19 with the repro steps / compiler.

---8<---
	../arch/mips/mm/init.c:454:9: note: in expansion of macro 'BUILD_BUG_ON'
	  454 |         BUILD_BUG_ON(IS_ENABLED(CONFIG_32BIT) && (_PFN_SHIFT > PAGE_SHIFT));
	      |         ^~~~~~~~~~~~
---8<---

Though if I set 64 bit kernel it builds 2abbc27432878c26759d2913a22a7a15a66b96fd
fine - though I haven't gone through all levels of macros to see how that has
changed the expansion of HPAGE_PMD_ORDER.

Seems to be something specific to the "#if" directive as the compiler doesn't
seem to complain about, for example, defining an int[HPAGE_PMD_ORDER] array
in this struct. No fix yet, but just wanted to put this out there so it's known
I'm looking into it.

Thanks,
Zach


WARNING: multiple messages have this Message-ID (diff)
From: Zach O'Keefe <zokeefe@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Yang Shi <shy828301@gmail.com>
Subject: Re: [linux-next:master 4278/4736] arch/mips/include/asm/pgtable.h:238:39: error: missing binary operator before token "("
Date: Fri, 2 Sep 2022 17:32:20 -0700	[thread overview]
Message-ID: <YxKglGWKcBfFy9M4@google.com> (raw)
In-Reply-To: <202209021349.F73i5d6X-lkp@intel.com>

On Sep 02 13:19, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   e47eb90a0a9ae20b82635b9b99a8d0979b757ad8
> commit: 2abbc27432878c26759d2913a22a7a15a66b96fd [4278/4736] mm/khugepaged: use minimal bits to store num page < HPAGE_PMD_NR
> config: mips-randconfig-r013-20220901 (https://download.01.org/0day-ci/archive/20220902/202209021349.F73i5d6X-lkp@intel.com/config)
> compiler: mips-linux-gcc (GCC) 12.1.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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=2abbc27432878c26759d2913a22a7a15a66b96fd
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout 2abbc27432878c26759d2913a22a7a15a66b96fd
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All error/warnings (new ones prefixed by >>):
> 
>    In file included from include/linux/pgtable.h:6,
>                     from include/linux/mm.h:29,
>                     from mm/khugepaged.c:4:
> >> arch/mips/include/asm/pgtable.h:238:26: warning: "__builtin_ffs" is not defined, evaluates to 0 [-Wundef]
>      238 | #define PTE_T_LOG2      (__builtin_ffs(sizeof(pte_t)) - 1)
>          |                          ^~~~~~~~~~~~~
>    arch/mips/include/asm/pgtable-32.h:65:43: note: in expansion of macro 'PTE_T_LOG2'
>       65 | # define PGDIR_SHIFT    (2 * PAGE_SHIFT - PTE_T_LOG2 - 1)
>          |                                           ^~~~~~~~~~
>    include/asm-generic/pgtable-nop4d.h:11:33: note: in expansion of macro 'PGDIR_SHIFT'
>       11 | #define P4D_SHIFT               PGDIR_SHIFT
>          |                                 ^~~~~~~~~~~
>    include/asm-generic/pgtable-nopud.h:18:25: note: in expansion of macro 'P4D_SHIFT'
>       18 | #define PUD_SHIFT       P4D_SHIFT
>          |                         ^~~~~~~~~
>    include/asm-generic/pgtable-nopmd.h:20:25: note: in expansion of macro 'PUD_SHIFT'
>       20 | #define PMD_SHIFT       PUD_SHIFT
>          |                         ^~~~~~~~~
>    include/linux/huge_mm.h:109:25: note: in expansion of macro 'PMD_SHIFT'
>      109 | #define HPAGE_PMD_SHIFT PMD_SHIFT
>          |                         ^~~~~~~~~
>    include/linux/huge_mm.h:105:26: note: in expansion of macro 'HPAGE_PMD_SHIFT'
>      105 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
>          |                          ^~~~~~~~~~~~~~~
>    mm/khugepaged.c:90:5: note: in expansion of macro 'HPAGE_PMD_ORDER'
>       90 | #if HPAGE_PMD_ORDER < 16
>          |     ^~~~~~~~~~~~~~~
> >> arch/mips/include/asm/pgtable.h:238:39: error: missing binary operator before token "("
>      238 | #define PTE_T_LOG2      (__builtin_ffs(sizeof(pte_t)) - 1)
>          |                                       ^
>    arch/mips/include/asm/pgtable-32.h:65:43: note: in expansion of macro 'PTE_T_LOG2'
>       65 | # define PGDIR_SHIFT    (2 * PAGE_SHIFT - PTE_T_LOG2 - 1)
>          |                                           ^~~~~~~~~~
>    include/asm-generic/pgtable-nop4d.h:11:33: note: in expansion of macro 'PGDIR_SHIFT'
>       11 | #define P4D_SHIFT               PGDIR_SHIFT
>          |                                 ^~~~~~~~~~~
>    include/asm-generic/pgtable-nopud.h:18:25: note: in expansion of macro 'P4D_SHIFT'
>       18 | #define PUD_SHIFT       P4D_SHIFT
>          |                         ^~~~~~~~~
>    include/asm-generic/pgtable-nopmd.h:20:25: note: in expansion of macro 'PUD_SHIFT'
>       20 | #define PMD_SHIFT       PUD_SHIFT
>          |                         ^~~~~~~~~
>    include/linux/huge_mm.h:109:25: note: in expansion of macro 'PMD_SHIFT'
>      109 | #define HPAGE_PMD_SHIFT PMD_SHIFT
>          |                         ^~~~~~~~~
>    include/linux/huge_mm.h:105:26: note: in expansion of macro 'HPAGE_PMD_SHIFT'
>      105 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
>          |                          ^~~~~~~~~~~~~~~
>    mm/khugepaged.c:90:5: note: in expansion of macro 'HPAGE_PMD_ORDER'
>       90 | #if HPAGE_PMD_ORDER < 16
>          |     ^~~~~~~~~~~~~~~
> 
> 
> vim +238 arch/mips/include/asm/pgtable.h
> 
> ^1da177e4c3f41 include/asm-mips/pgtable.h Linus Torvalds 2005-04-16  235  
> 5ff974720abec2 include/asm-mips/pgtable.h Ralf Baechle   2007-08-01  236  #define PGD_T_LOG2	(__builtin_ffs(sizeof(pgd_t)) - 1)
> 5ff974720abec2 include/asm-mips/pgtable.h Ralf Baechle   2007-08-01  237  #define PMD_T_LOG2	(__builtin_ffs(sizeof(pmd_t)) - 1)
> 5ff974720abec2 include/asm-mips/pgtable.h Ralf Baechle   2007-08-01 @238  #define PTE_T_LOG2	(__builtin_ffs(sizeof(pte_t)) - 1)
> ^1da177e4c3f41 include/asm-mips/pgtable.h Linus Torvalds 2005-04-16  239  
> 
> :::::: The code at line 238 was first introduced by commit
> :::::: 5ff974720abec255c17af6f3732dd410d364e367 [MIPS] Fix computation of {PGD,PMD,PTE}_T_LOG2.
> 
> :::::: TO: Ralf Baechle <ralf@linux-mips.org>
> :::::: CC: Ralf Baechle <ralf@linux-mips.org>
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://01.org/lkp
> 

Sorry about this - have been trying to figure out what exactly is happening.

AFAICT this config doesn't even build on v5.19 with the repro steps / compiler.

---8<---
	../arch/mips/mm/init.c:454:9: note: in expansion of macro 'BUILD_BUG_ON'
	  454 |         BUILD_BUG_ON(IS_ENABLED(CONFIG_32BIT) && (_PFN_SHIFT > PAGE_SHIFT));
	      |         ^~~~~~~~~~~~
---8<---

Though if I set 64 bit kernel it builds 2abbc27432878c26759d2913a22a7a15a66b96fd
fine - though I haven't gone through all levels of macros to see how that has
changed the expansion of HPAGE_PMD_ORDER.

Seems to be something specific to the "#if" directive as the compiler doesn't
seem to complain about, for example, defining an int[HPAGE_PMD_ORDER] array
in this struct. No fix yet, but just wanted to put this out there so it's known
I'm looking into it.

Thanks,
Zach




  reply	other threads:[~2022-09-03  0:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02  5:19 [linux-next:master 4278/4736] arch/mips/include/asm/pgtable.h:238:39: error: missing binary operator before token "(" kernel test robot
2022-09-03  0:32 ` Zach O'Keefe [this message]
2022-09-03  0:32   ` Zach O'Keefe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YxKglGWKcBfFy9M4@google.com \
    --to=zokeefe@google.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.