From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BCC1C38145 for ; Sat, 3 Sep 2022 00:32:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4473080148; Fri, 2 Sep 2022 20:32:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F56380120; Fri, 2 Sep 2022 20:32:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 296AA80148; Fri, 2 Sep 2022 20:32:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1AD6C80120 for ; Fri, 2 Sep 2022 20:32:26 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id E1F4580829 for ; Sat, 3 Sep 2022 00:32:25 +0000 (UTC) X-FDA: 79868897850.23.CC4141E Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf23.hostedemail.com (Postfix) with ESMTP id 8D9D914006B for ; Sat, 3 Sep 2022 00:32:25 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id j9-20020a17090a3e0900b001fd9568b117so3572266pjc.3 for ; Fri, 02 Sep 2022 17:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=eXWYnyxhPH0CoGuPQMXkIJdBs25ElfLychj4S9dJ/VE=; b=mxTaPf9IC0LW0ZDjD3nkeWsggBdCu4/hzFmTLDw9bv4/BuFkX7vGKbmnhfI8fKWllx /fMreGtqzwo9953Wlwtng7Ht8LurgR499ji2PycmOwsf5kCS+dssCNbEiBdYqUARulBD H+tF+9yCPwzttuswA4DqfERe/UKJUzlx/BaL4lfRLLtiuSDs5rHVCnD7fUnzgM6Q/Ykr D9IEjm4mQkYgUV65NvudEmzN7LjgYm7KiHooitv6dCydGg4YCTFkgZE6kfqQkQbSbHqw iQa3beOXU0Ge3jW2n2r/bpvty3nwEu5AhBjVlmYDvaFuUsb4YwAF/oczWryWJq82m+r6 ZhDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=eXWYnyxhPH0CoGuPQMXkIJdBs25ElfLychj4S9dJ/VE=; b=p6Ho6tA8iYy35RNXcYAw7nhsN/INnUhD6ZUnmnPj5pLf79hIrguHUjqfVcJm7WsDtX /OkqSc/Kq3ZFCUlHOLUyKBcq7DU80nVFxraFtnNzadO/zqHggOuMPJvArapSCdfOcZAB T586Y+aYtYdkITitqg7GpwMwVTmw3pxWF40ryr4Y1ncF+rlG3UiwKZBWcACaHVVo4sWb 1xFq4wQuufY7oN2VBxpi6S/uC7/XSUxdKBNMB4y+qycsX8d2dJU6ksvV+lBszcUc6tyd d9HY6Egwp+dt1akbgneGSFx3gR9EufMKcgKxxP2xkfuHPSy5cQpeTbriao6CEyvXUFV7 83KQ== X-Gm-Message-State: ACgBeo1BCDZvWE8bJP2Q8qPGq3byXvZiViGnjZo3KtIlKbAWsd5xmm8s wlzY/150eFB8PfQ9DzNEAKiaxA== X-Google-Smtp-Source: AA6agR6f9vUw1TSSrrnZ0x8FV7zyQfrzcy6AOxNHaGhViBSTUO+E2hxcG/ow4bbxPf05Tx3jAeMJlQ== X-Received: by 2002:a17:90b:4f82:b0:1fe:4fd0:2850 with SMTP id qe2-20020a17090b4f8200b001fe4fd02850mr7428896pjb.131.1662165144124; Fri, 02 Sep 2022 17:32:24 -0700 (PDT) Received: from google.com (33.5.83.34.bc.googleusercontent.com. [34.83.5.33]) by smtp.gmail.com with ESMTPSA id p129-20020a622987000000b0052e6d5ee183sm2444555pfp.129.2022.09.02.17.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 17:32:23 -0700 (PDT) Date: Fri, 2 Sep 2022 17:32:20 -0700 From: Zach O'Keefe To: Andrew Morton Cc: kbuild-all@lists.01.org, Linux Memory Management List , Andrew Morton , Yang Shi Subject: Re: [linux-next:master 4278/4736] arch/mips/include/asm/pgtable.h:238:39: error: missing binary operator before token "(" Message-ID: References: <202209021349.F73i5d6X-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202209021349.F73i5d6X-lkp@intel.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662165145; a=rsa-sha256; cv=none; b=OE4MDAqTcy6rkVnYuY6rAO8AQh7vF2HO8owLSb26Wu5fwLn9ie0xz1VCKi2rSODO32dKA9 8wv7K/+CkAlbde1E8hBv9s8g2WMTuox0bkY9Vh8WGQbHOj4wE/5abL3VbnjibEABUyTA4m Vx9QR2dhxkQpna5aLA+AAwwPPjK5EL0= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=mxTaPf9I; spf=pass (imf23.hostedemail.com: domain of zokeefe@google.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=zokeefe@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662165145; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=eXWYnyxhPH0CoGuPQMXkIJdBs25ElfLychj4S9dJ/VE=; b=itQaveJaM+DtJBuvgIX788lyQNmyLjyTnGtEENsUKBYCIxvfqCpLUCZ8rCgz60EcLkCIZ7 UNLaUmbB/ocylfaZdXl/dO3v7vLAYvbMuV24U7aBRmXWGLDYbif7LU/NHxGOL1Y/V40Xrt b7nuDBEPPMLo9TPCvxjEMFMVHLZ0xeY= Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=mxTaPf9I; spf=pass (imf23.hostedemail.com: domain of zokeefe@google.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=zokeefe@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam12 X-Stat-Signature: irnt7u7n63q8fwky68dftusqi4ojos6e X-Rspamd-Queue-Id: 8D9D914006B X-HE-Tag: 1662165145-790170 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 > > 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 > :::::: CC: Ralf Baechle > > -- > 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