Received: by 10.213.65.68 with SMTP id h4csp1540438imn; Thu, 15 Mar 2018 02:37:00 -0700 (PDT) X-Google-Smtp-Source: AG47ELuux7nkA8IU/S3d5KvpQmFo6u22oNgvznNRJSSOIuf7LMDS/W1UV3NcjLG9SN4HwoD30ZF8 X-Received: by 10.98.7.129 with SMTP id 1mr7156053pfh.133.1521106620123; Thu, 15 Mar 2018 02:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521106620; cv=none; d=google.com; s=arc-20160816; b=cWzp2OCzlSWskW3dagfO24BrXipCFIj6+TnN0VZcoi9J0vSu7d27G581vk08jBQimX 6w8X8mqFaBeXtcnkajgC37WrKH5GTA/7H+NRRgaImqgYJpYrR5TmKwpa9q7e427hrgwA OgyOI5r6ptNn8YA3gpJn43dmSOcmnxZnuGJLHroYnwT21wcmPu1ZNxMsXMQ+bHWQI0Z/ JenTZ0aASNhLymS9ezWXr88aRsAoE2rRtcRVXArjYU/fHfCqXFfuQ+feuA3ruE2+Tfkf ku8REikU59uSBuWDxFMHkekzIA+9mv5FPGIzjbHUmOjROPWK/Cw9YogWvfHNI9POV+FR GJbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=8pT0MnWL660PiDG+ViNSH4Q9v/FOA6YPlI7GG3+aoxU=; b=nW/fvGmxablTc862x9eBWGM6X5XJOYNGdt1h37CAxr89ElbsNItSTgRF0R+gk/0opF g/dWdrklsA2wROdrbfVzU1kyLxoF6YFKgf4kw3KA08dwWJxBDWKbDiD6YHy7+sO1aznP M+5afTkCB0B1AxjhjSntwNCAkXMeyXDmG7Flb6fA/2n4arqZu/f7jz8R6tFBQUx8uGST jWFbJaygEQInhtCqwN1urczRnTfz+8KiycMZ45W8qY6FdoJsuQXWlq7YRYgmk5aYkRcj CNdGWArX4IzB0Yl5T0YwO5x8yv4Xwp7AxpRWuDzDMmYHt9lHmPnaxpVeIrT5UmnaJS/i 4aEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rn2S8XPJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si2605073pgn.241.2018.03.15.02.36.45; Thu, 15 Mar 2018 02:37:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rn2S8XPJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751390AbeCOJfy (ORCPT + 99 others); Thu, 15 Mar 2018 05:35:54 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:33436 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750731AbeCOJfw (ORCPT ); Thu, 15 Mar 2018 05:35:52 -0400 Received: by mail-io0-f194.google.com with SMTP id f1so7811771iob.0 for ; Thu, 15 Mar 2018 02:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8pT0MnWL660PiDG+ViNSH4Q9v/FOA6YPlI7GG3+aoxU=; b=Rn2S8XPJz0kWMgi9bX0tGvE24V4lgAixKTTGCzdnUMpQT6UxhMl0MB3Dierhda5g2P tQgzuSEzg7Gk1Md3jlTnjbW6ZBo+Cez3S3oxZWbmOZV9VpsA3ZtAnXXb3mwTqcsTpUJB tI6ghV9LyfTkoZ3BmbxUkIbqIUX8VpkeCgQsv5u27/CA68b7dXO9L3P3zUIPJvwYM9/C PLVeyn8Ub4//SXlzOoWJaDqj+LdU9PwKoLsaLZs4MV6SupMnLVjBqaFVGDDlb2vTiLo0 cjFEfyS0q6p7a79P1uQeFNZZ+EnUBUmWVZmKHB2LKuzGeF8V9TfYxToTm3H+G94av6oV l9HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8pT0MnWL660PiDG+ViNSH4Q9v/FOA6YPlI7GG3+aoxU=; b=EFT982Crr548UpsGxK1CqjeD+1SH2q881QeuvFE5OPiJ+LwQYVIx6/Rsf/5aN1/46y cyWaAFjJT57bbUNeA7oT4yb6nl72d5R3py8nxMV7+JyNPVHlTdreU0POJrFo+6e7xnwD lyMDnHGjnq602zt2ROPsuJYdVGU8zDmMypslaA9fjObuB+LH9VmqBj5mh/FRQR2ifTUs CiyFkdjVILGHjxfgDqAcezKNFEwqNdL7+bkhXLGki+Hwx3tkqzqKPyCmv6XesJ0bYIZn kS9NbltZNdtkxNDnlr4/5IXeh78ePIHle+fBrSppD0sVZUJstne8npdpKDYdN2F6chOi mUXw== X-Gm-Message-State: AElRT7EMogI85YSBPx1jttEqb/K2siO3OkVGiMPQLs5e3UOe2ObzVvnz eVPvC6AMXRA/s7hL4JwvN38QuS/fgsLHoRi1Hg4= X-Received: by 10.107.201.142 with SMTP id z136mr8749588iof.122.1521106549135; Thu, 15 Mar 2018 02:35:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.69.149 with HTTP; Thu, 15 Mar 2018 02:35:48 -0700 (PDT) In-Reply-To: <201803150146.vzdp4sme%fengguang.wu@intel.com> References: <66eb534368782f411021e1a59f3292761d6576cd.1520928420.git.zong@andestech.com> <201803150146.vzdp4sme%fengguang.wu@intel.com> From: Zong Li Date: Thu, 15 Mar 2018 17:35:48 +0800 Message-ID: Subject: Re: [PATCH 02/11] RISC-V: Add section of GOT.PLT for kernel module To: kbuild test robot Cc: Zong Li , kbuild-all@01.org, Palmer Dabbelt , albert@sifive.com, linux-riscv@lists.infradead.org, Linux Kernel Mailing List , greentime@andestech.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-03-15 1:34 GMT+08:00 kbuild test robot : > Hi Zong, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on linus/master] > [also build test ERROR on v4.16-rc5 next-20180314] > [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/Zong-Li/RISC-V-Resolve-the-issue-of-loadable-module-on-64-bit/20180314-203750 > config: riscv-defconfig (attached as .config) > compiler: riscv64-linux-gcc (GCC) 7.2.0 > 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=riscv > > All errors (new ones prefixed by >>): > > In file included from include/linux/module.h:25:0, > from fs/notify/fsnotify.c:23: > arch/riscv/include/asm/module.h:38:25: warning: 'struct mod_section' declared inside parameter list will not be visible outside of this definition or declaration > const struct mod_section *sec) > ^~~~~~~~~~~ > arch/riscv/include/asm/module.h: In function 'get_got_entry': > arch/riscv/include/asm/module.h:40:49: error: dereferencing pointer to incomplete type 'const struct mod_section' > struct got_entry *got = (struct got_entry *)sec->shdr->sh_addr; > ^~ > arch/riscv/include/asm/module.h: At top level: > arch/riscv/include/asm/module.h:89:57: warning: 'struct mod_section' declared inside parameter list will not be visible outside of this definition or declaration > static inline int get_got_plt_idx(u64 val, const struct mod_section *sec) > ^~~~~~~~~~~ > arch/riscv/include/asm/module.h: In function 'get_got_plt_idx': > arch/riscv/include/asm/module.h:91:53: error: dereferencing pointer to incomplete type 'const struct mod_section' > struct got_entry *got_plt = (struct got_entry *)sec->shdr->sh_addr; > ^~ > arch/riscv/include/asm/module.h: At top level: > arch/riscv/include/asm/module.h:101:24: warning: 'struct mod_section' declared inside parameter list will not be visible outside of this definition or declaration > const struct mod_section *sec_plt, > ^~~~~~~~~~~ > arch/riscv/include/asm/module.h: In function 'get_plt_entry': > arch/riscv/include/asm/module.h:104:53: error: dereferencing pointer to incomplete type 'const struct mod_section' > struct plt_entry *plt = (struct plt_entry *)sec_plt->shdr->sh_addr; > ^~ >>> arch/riscv/include/asm/module.h:105:41: error: passing argument 2 of 'get_got_plt_idx' from incompatible pointer type [-Werror=incompatible-pointer-types] > int got_plt_idx = get_got_plt_idx(val, sec_got_plt); > ^~~~~~~~~~~ > arch/riscv/include/asm/module.h:89:19: note: expected 'const struct mod_section *' but argument is of type 'const struct mod_section *' > static inline int get_got_plt_idx(u64 val, const struct mod_section *sec) > ^~~~~~~~~~~~~~~ > cc1: some warnings being treated as errors > > vim +/get_got_plt_idx +105 arch/riscv/include/asm/module.h > > 99 > 100 static inline struct plt_entry *get_plt_entry(u64 val, > > 101 const struct mod_section *sec_plt, > 102 const struct mod_section *sec_got_plt) > 103 { > 104 struct plt_entry *plt = (struct plt_entry *)sec_plt->shdr->sh_addr; > > 105 int got_plt_idx = get_got_plt_idx(val, sec_got_plt); > 106 if (got_plt_idx >= 0) > 107 return plt + got_plt_idx; > 108 else > 109 return NULL; > 110 } > 111 > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation The config default is enable the MODULES, but also need to consider the MODULES disable situation. Modify the include/asm/module.h in PATCH v2 +u64 module_emit_got_entry(struct module *mod, u64 val); +u64 module_emit_plt_entry(struct module *mod, u64 val); #ifdef CONFIG_MODULE_SECTIONS struct mod_section { @@ -23,6 +21,10 @@ struct mod_arch_specific { struct mod_section plt; struct mod_section got_plt; }; -#endif -u64 module_emit_got_entry(struct module *mod, u64 val); -u64 module_emit_plt_entry(struct module *mod, u64 val); struct got_entry { u64 symbol_addr; /* the real variable address */ @@ -108,6 +109,5 @@ static inline struct plt_entry *get_plt_entry(u64 val, return NULL; } +#endif /* CONFIG_MODULE_SECTIONS */ #endif /* _ASM_RISCV_MODULE_H */