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 X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C32EC07E94 for ; Fri, 4 Jun 2021 14:13:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 81C1A6140B for ; Fri, 4 Jun 2021 14:13:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81C1A6140B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=mail.ustc.edu.cn Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 155B86B0085; Fri, 4 Jun 2021 10:13:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 105B86B0087; Fri, 4 Jun 2021 10:13:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9A8C6B0088; Fri, 4 Jun 2021 10:13:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id B55E76B0085 for ; Fri, 4 Jun 2021 10:13:46 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 446B810FAA for ; Fri, 4 Jun 2021 14:13:46 +0000 (UTC) X-FDA: 78216234852.17.FA01473 Received: from ustc.edu.cn (smtp2.ustc.edu.cn [202.38.64.46]) by imf29.hostedemail.com (Postfix) with ESMTP id 6D75A2BD3 for ; Fri, 4 Jun 2021 14:13:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ustc.edu.cn; s=dkim; h=Received:Date:From:To:Cc:Subject: Message-ID:In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=nDRA24Bm3F87fSwv7WCWLNP2zdjPygHIbn lVGZjzT/E=; b=xUPShDQqykYg5DF9V8bADvkAWNpOahP2dcRLjsNeYVU3Ie3b92 Fy1B9bXOv5ZKWg2SHSkp+CMwlh2YfnK6wWhkn9u0WlgwXLWvek7H/lNgxJER6dWS w6JGXqJbf/UBulLxsDlRSnROLBUZCN26LsuVgG91IYlaKlUjYQw4Cageg= Received: from xhacker (unknown [101.86.20.15]) by newmailweb.ustc.edu.cn (Coremail) with SMTP id LkAmygBHbqQINbpgx7eQAA--.34741S2; Fri, 04 Jun 2021 22:13:28 +0800 (CST) Date: Fri, 4 Jun 2021 22:08:01 +0800 From: Jisheng Zhang To: kernel test robot Cc: Jisheng Zhang , kbuild-all@lists.01.org, Linux Memory Management List , Palmer Dabbelt Subject: Re: [linux-next:master 5094/7430] arch/riscv/mm/init.c:454:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__inidata' Message-ID: <20210604220801.462ebdff@xhacker> In-Reply-To: <202106042036.yyJtC9qB-lkp@intel.com> References: <202106042036.yyJtC9qB-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CM-TRANSID:LkAmygBHbqQINbpgx7eQAA--.34741S2 X-Coremail-Antispam: 1UD129KBjvJXoWxKF45tF1fKw1ruF4kGF4xXrb_yoW3GFWkpa n8Cr1kK3yrW348urs2y3Wj9347Xws8W3sIyryxurykuay2qFy8tr1qgwsI9ryvgF4qga40 gr17Wa90934UZ3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUyEb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwV C2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC 0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr 1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JMxAIw28IcxkI7VAKI48JMxC20s02 6xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_Jr I_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIccxYrVCFb41lIxkGc2Ij64vIr41lIxAIcVC0 I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04 k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY 1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IUog0eJUUUUU== X-CM-SenderInfo: xmv2xttqjtqzxdloh3xvwfhvlgxou0/ X-Stat-Signature: bnqqk6itdqx9qpr73c811cnz9f6bfgr4 X-Rspamd-Queue-Id: 6D75A2BD3 X-Rspamd-Server: rspam02 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=mail.ustc.edu.cn header.s=dkim header.b=xUPShDQq; dmarc=pass (policy=quarantine) header.from=mail.ustc.edu.cn; spf=pass (imf29.hostedemail.com: domain of jszhang3@mail.ustc.edu.cn designates 202.38.64.46 as permitted sender) smtp.mailfrom=jszhang3@mail.ustc.edu.cn X-HE-Tag: 1622816000-284939 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 Fri, 4 Jun 2021 20:59:42 +0800 kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: ccc252d2e818f6a479441119ad453c3ce7c7c461 > commit: 010623568222bd144eb73aa9f3b46c79b63d7676 [5094/7430] riscv: mm: init: Consolidate vars, functions > config: riscv-randconfig-r002-20210604 (attached as .config) > compiler: riscv32-linux-gcc (GCC) 9.3.0 This is the key, RV32GC platform! the pfn_pmd() is only defined in pgtable-64.h, so we need one more fix patch for commit e88b333142e ("riscv: mm: add THP support on 64-bit"). I'll send out a fix > 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=010623568222bd144eb73aa9f3b46c79b63d7676 > 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 010623568222bd144eb73aa9f3b46c79b63d7676 > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All errors (new ones prefixed by >>): > > In file included from include/linux/pgtable.h:6, > from include/linux/mm.h:33, > from arch/riscv/mm/init.c:10: > arch/riscv/include/asm/pgtable.h: In function 'mk_pmd': > arch/riscv/include/asm/pgtable.h:518:9: error: implicit declaration of function 'pfn_pmd'; did you mean 'pfn_pgd'? [-Werror=implicit-function-declaration] > 518 | return pfn_pmd(page_to_pfn(page), prot); > | ^~~~~~~ > | pfn_pgd > In file included from arch/riscv/include/asm/page.h:185, > from arch/riscv/include/asm/thread_info.h:11, > from include/linux/thread_info.h:59, > from include/asm-generic/preempt.h:5, > from ./arch/riscv/include/generated/asm/preempt.h:1, > from include/linux/preempt.h:78, > from include/linux/spinlock.h:51, > from include/linux/mmzone.h:8, > from include/linux/gfp.h:6, > from include/linux/mm.h:10, > from arch/riscv/mm/init.c:10: > include/asm-generic/memory_model.h:64:14: error: implicit declaration of function 'page_to_section'; did you mean 'present_section'? [-Werror=implicit-function-declaration] > 64 | int __sec = page_to_section(__pg); \ > | ^~~~~~~~~~~~~~~ > include/asm-generic/memory_model.h:81:21: note: in expansion of macro '__page_to_pfn' > 81 | #define page_to_pfn __page_to_pfn > | ^~~~~~~~~~~~~ > arch/riscv/include/asm/pgtable.h:518:17: note: in expansion of macro 'page_to_pfn' > 518 | return pfn_pmd(page_to_pfn(page), prot); > | ^~~~~~~~~~~ > In file included from include/linux/pgtable.h:6, > from include/linux/mm.h:33, > from arch/riscv/mm/init.c:10: > arch/riscv/include/asm/pgtable.h:518:9: error: incompatible types when returning type 'int' but 'pmd_t' {aka 'struct '} was expected > 518 | return pfn_pmd(page_to_pfn(page), prot); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from arch/riscv/mm/init.c:10: > include/linux/mm.h: At top level: > include/linux/mm.h:1552:29: error: conflicting types for 'page_to_section' > 1552 | static inline unsigned long page_to_section(const struct page *page) > | ^~~~~~~~~~~~~~~ > In file included from arch/riscv/include/asm/page.h:185, > from arch/riscv/include/asm/thread_info.h:11, > from include/linux/thread_info.h:59, > from include/asm-generic/preempt.h:5, > from ./arch/riscv/include/generated/asm/preempt.h:1, > from include/linux/preempt.h:78, > from include/linux/spinlock.h:51, > from include/linux/mmzone.h:8, > from include/linux/gfp.h:6, > from include/linux/mm.h:10, > from arch/riscv/mm/init.c:10: > include/asm-generic/memory_model.h:64:14: note: previous implicit declaration of 'page_to_section' was here > 64 | int __sec = page_to_section(__pg); \ > | ^~~~~~~~~~~~~~~ > include/asm-generic/memory_model.h:81:21: note: in expansion of macro '__page_to_pfn' > 81 | #define page_to_pfn __page_to_pfn > | ^~~~~~~~~~~~~ > arch/riscv/include/asm/pgtable.h:518:17: note: in expansion of macro 'page_to_pfn' > 518 | return pfn_pmd(page_to_pfn(page), prot); > | ^~~~~~~~~~~ > In file included from include/linux/kexec.h:28, > from include/linux/crash_dump.h:5, > from arch/riscv/mm/init.c:20: > arch/riscv/include/asm/kexec.h:45:1: warning: 'extern' is not at beginning of declaration [-Wold-style-declaration] > 45 | const extern unsigned char riscv_kexec_relocate[]; > | ^~~~~ > arch/riscv/include/asm/kexec.h:46:1: warning: 'extern' is not at beginning of declaration [-Wold-style-declaration] > 46 | const extern unsigned int riscv_kexec_relocate_size; > | ^~~~~ > >> arch/riscv/mm/init.c:454:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__inidata' > 454 | static uintptr_t xiprom __inidata; Vitaly has sent a patch to fix this typo. > | ^~~~~~~~~ > In file included from include/linux/pgtable.h:6, > from include/linux/mm.h:33, > from arch/riscv/mm/init.c:10: > arch/riscv/mm/init.c: In function 'create_kernel_page_table': > >> arch/riscv/mm/init.c:457:51: error: 'xiprom' undeclared (first use in this function); did you mean '_xiprom'? > 457 | #define xiprom (*((uintptr_t *)XIP_FIXUP(&xiprom))) > | ^~~~~~ > arch/riscv/include/asm/pgtable.h:98:30: note: in definition of macro 'XIP_FIXUP' > 98 | uintptr_t __a = (uintptr_t)(addr); \ > | ^~~~ > arch/riscv/mm/init.c:467:8: note: in expansion of macro 'xiprom' > 467 | xiprom + (va - kernel_virt_addr), > | ^~~~~~ > arch/riscv/mm/init.c:457:51: note: each undeclared identifier is reported only once for each function it appears in > 457 | #define xiprom (*((uintptr_t *)XIP_FIXUP(&xiprom))) > | ^~~~~~ > arch/riscv/include/asm/pgtable.h:98:30: note: in definition of macro 'XIP_FIXUP' > 98 | uintptr_t __a = (uintptr_t)(addr); \ > | ^~~~ > arch/riscv/mm/init.c:467:8: note: in expansion of macro 'xiprom' > 467 | xiprom + (va - kernel_virt_addr), > | ^~~~~~ > arch/riscv/mm/init.c: In function 'setup_vm': > >> arch/riscv/mm/init.c:457:51: error: 'xiprom' undeclared (first use in this function); did you mean '_xiprom'? > 457 | #define xiprom (*((uintptr_t *)XIP_FIXUP(&xiprom))) > | ^~~~~~ > arch/riscv/include/asm/pgtable.h:98:30: note: in definition of macro 'XIP_FIXUP' > 98 | uintptr_t __a = (uintptr_t)(addr); \ > | ^~~~ > arch/riscv/mm/init.c:499:2: note: in expansion of macro 'xiprom' > 499 | xiprom = (uintptr_t)CONFIG_XIP_PHYS_ADDR; > | ^~~~~~ > cc1: some warnings being treated as errors > > > vim +454 arch/riscv/mm/init.c > > 452 > 453 #ifdef CONFIG_XIP_KERNEL > > 454 static uintptr_t xiprom __inidata; > 455 static uintptr_t xiprom_sz __initdata; > 456 #define xiprom_sz (*((uintptr_t *)XIP_FIXUP(&xiprom_sz))) > > 457 #define xiprom (*((uintptr_t *)XIP_FIXUP(&xiprom))) > 458 > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org