mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Xi Ruoyao <xry111@xry111.site>, loongarch@lists.linux.dev
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	WANG Xuerui <kernel@xen0n.name>,
	Huacai Chen <chenhuacai@kernel.org>,
	Youling Tang <tangyouling@loongson.cn>,
	Jinyang He <hejinyang@loongson.cn>,
	Xi Ruoyao <xry111@xry111.site>
Subject: Re: [PATCH v7 4/5] LoongArch: Support PC-relative relocations in modules
Date: Tue, 30 Aug 2022 20:59:38 +0800	[thread overview]
Message-ID: <202208302041.ANqQ0hQd-lkp@intel.com> (raw)
In-Reply-To: <20220830104806.128365-5-xry111@xry111.site>

Hi Xi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on kees/for-next/execve]
[also build test WARNING on linus/master v6.0-rc3 next-20220830]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Xi-Ruoyao/LoongArch-Support-toolchain-with-new-relocation-types/20220830-185350
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20220830/202208302041.ANqQ0hQd-lkp@intel.com/config)
compiler: loongarch64-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://github.com/intel-lab-lkp/linux/commit/529c0f36d2dad7dd4bcec3815f821547d9e9643c
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Xi-Ruoyao/LoongArch-Support-toolchain-with-new-relocation-types/20220830-185350
        git checkout 529c0f36d2dad7dd4bcec3815f821547d9e9643c
        # 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=loongarch SHELL=/bin/bash arch/loongarch/kernel/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

     366 |         [R_LARCH_NONE]                                       = apply_r_larch_none,
         |                                                                ^~~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:366:64: note: (near initialization for 'reloc_rela_handlers[0]')
   arch/loongarch/kernel/module.c:367:64: warning: initialized field overwritten [-Woverride-init]
     367 |         [R_LARCH_32]                                         = apply_r_larch_32,
         |                                                                ^~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:367:64: note: (near initialization for 'reloc_rela_handlers[1]')
   arch/loongarch/kernel/module.c:368:64: warning: initialized field overwritten [-Woverride-init]
     368 |         [R_LARCH_64]                                         = apply_r_larch_64,
         |                                                                ^~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:368:64: note: (near initialization for 'reloc_rela_handlers[2]')
   arch/loongarch/kernel/module.c:369:64: warning: initialized field overwritten [-Woverride-init]
     369 |         [R_LARCH_MARK_LA]                                    = apply_r_larch_none,
         |                                                                ^~~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:369:64: note: (near initialization for 'reloc_rela_handlers[20]')
   arch/loongarch/kernel/module.c:370:64: warning: initialized field overwritten [-Woverride-init]
     370 |         [R_LARCH_MARK_PCREL]                                 = apply_r_larch_none,
         |                                                                ^~~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:370:64: note: (near initialization for 'reloc_rela_handlers[21]')
   arch/loongarch/kernel/module.c:371:64: warning: initialized field overwritten [-Woverride-init]
     371 |         [R_LARCH_SOP_PUSH_PCREL]                             = apply_r_larch_sop_push_pcrel,
         |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:371:64: note: (near initialization for 'reloc_rela_handlers[22]')
   arch/loongarch/kernel/module.c:372:64: warning: initialized field overwritten [-Woverride-init]
     372 |         [R_LARCH_SOP_PUSH_ABSOLUTE]                          = apply_r_larch_sop_push_absolute,
         |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:372:64: note: (near initialization for 'reloc_rela_handlers[23]')
   arch/loongarch/kernel/module.c:373:64: warning: initialized field overwritten [-Woverride-init]
     373 |         [R_LARCH_SOP_PUSH_DUP]                               = apply_r_larch_sop_push_dup,
         |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:373:64: note: (near initialization for 'reloc_rela_handlers[24]')
   arch/loongarch/kernel/module.c:374:64: warning: initialized field overwritten [-Woverride-init]
     374 |         [R_LARCH_SOP_PUSH_PLT_PCREL]                         = apply_r_larch_sop_push_plt_pcrel,
         |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:374:64: note: (near initialization for 'reloc_rela_handlers[29]')
   arch/loongarch/kernel/module.c:375:64: warning: initialized field overwritten [-Woverride-init]
     375 |         [R_LARCH_SOP_SUB ... R_LARCH_SOP_IF_ELSE]            = apply_r_larch_sop,
         |                                                                ^~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:375:64: note: (near initialization for 'reloc_rela_handlers[32]')
   arch/loongarch/kernel/module.c:375:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:375:64: note: (near initialization for 'reloc_rela_handlers[33]')
   arch/loongarch/kernel/module.c:375:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:375:64: note: (near initialization for 'reloc_rela_handlers[34]')
   arch/loongarch/kernel/module.c:375:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:375:64: note: (near initialization for 'reloc_rela_handlers[35]')
   arch/loongarch/kernel/module.c:375:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:375:64: note: (near initialization for 'reloc_rela_handlers[36]')
   arch/loongarch/kernel/module.c:375:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:375:64: note: (near initialization for 'reloc_rela_handlers[37]')
   arch/loongarch/kernel/module.c:376:64: warning: initialized field overwritten [-Woverride-init]
     376 |         [R_LARCH_SOP_POP_32_S_10_5 ... R_LARCH_SOP_POP_32_U] = apply_r_larch_sop_imm_field,
         |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:376:64: note: (near initialization for 'reloc_rela_handlers[38]')
   arch/loongarch/kernel/module.c:376:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:376:64: note: (near initialization for 'reloc_rela_handlers[39]')
   arch/loongarch/kernel/module.c:376:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:376:64: note: (near initialization for 'reloc_rela_handlers[40]')
   arch/loongarch/kernel/module.c:376:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:376:64: note: (near initialization for 'reloc_rela_handlers[41]')
   arch/loongarch/kernel/module.c:376:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:376:64: note: (near initialization for 'reloc_rela_handlers[42]')
   arch/loongarch/kernel/module.c:376:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:376:64: note: (near initialization for 'reloc_rela_handlers[43]')
   arch/loongarch/kernel/module.c:376:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:376:64: note: (near initialization for 'reloc_rela_handlers[44]')
   arch/loongarch/kernel/module.c:376:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:376:64: note: (near initialization for 'reloc_rela_handlers[45]')
   arch/loongarch/kernel/module.c:376:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:376:64: note: (near initialization for 'reloc_rela_handlers[46]')
   arch/loongarch/kernel/module.c:377:64: warning: initialized field overwritten [-Woverride-init]
     377 |         [R_LARCH_ADD32 ... R_LARCH_SUB64]                    = apply_r_larch_add_sub,
         |                                                                ^~~~~~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:377:64: note: (near initialization for 'reloc_rela_handlers[50]')
   arch/loongarch/kernel/module.c:377:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:377:64: note: (near initialization for 'reloc_rela_handlers[51]')
   arch/loongarch/kernel/module.c:377:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:377:64: note: (near initialization for 'reloc_rela_handlers[52]')
   arch/loongarch/kernel/module.c:377:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:377:64: note: (near initialization for 'reloc_rela_handlers[53]')
   arch/loongarch/kernel/module.c:377:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:377:64: note: (near initialization for 'reloc_rela_handlers[54]')
   arch/loongarch/kernel/module.c:377:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:377:64: note: (near initialization for 'reloc_rela_handlers[55]')
   arch/loongarch/kernel/module.c:377:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:377:64: note: (near initialization for 'reloc_rela_handlers[56]')
   arch/loongarch/kernel/module.c:378:64: warning: initialized field overwritten [-Woverride-init]
     378 |         [R_LARCH_B26]                                        = apply_r_larch_b26,
         |                                                                ^~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:378:64: note: (near initialization for 'reloc_rela_handlers[66]')
   arch/loongarch/kernel/module.c:379:64: warning: initialized field overwritten [-Woverride-init]
     379 |         [R_LARCH_PCALA_HI20...R_LARCH_PCALA64_HI12]          = apply_r_larch_pcala,
         |                                                                ^~~~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:379:64: note: (near initialization for 'reloc_rela_handlers[71]')
   arch/loongarch/kernel/module.c:379:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:379:64: note: (near initialization for 'reloc_rela_handlers[72]')
   arch/loongarch/kernel/module.c:379:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:379:64: note: (near initialization for 'reloc_rela_handlers[73]')
   arch/loongarch/kernel/module.c:379:64: warning: initialized field overwritten [-Woverride-init]
   arch/loongarch/kernel/module.c:379:64: note: (near initialization for 'reloc_rela_handlers[74]')
   arch/loongarch/kernel/module.c: In function 'apply_r_larch_pcala':
>> arch/loongarch/kernel/module.c:336:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
     336 |                 v = offset_rem >> 52;
         |                 ~~^~~~~~~~~~~~~~~~~~
   arch/loongarch/kernel/module.c:338:9: note: here
     338 |         case R_LARCH_PCALA_LO12:
         |         ^~~~


vim +336 arch/loongarch/kernel/module.c

   315	
   316	static int apply_r_larch_pcala(struct module *mod, u32 *location, Elf_Addr v,
   317				s64 *rela_stack, size_t *rela_stack_top, unsigned int type)
   318	{
   319		union loongarch_instruction *insn = (union loongarch_instruction *)location;
   320		/* Use s32 for a sign-extension deliberately. */
   321		s32 offset_hi20 = (void *)((v + 0x800) & ~0xfff) -
   322			(void *)((Elf_Addr)location & ~0xfff);
   323		Elf_Addr anchor = (((Elf_Addr)location) & ~0xfff) + offset_hi20;
   324		ptrdiff_t offset_rem = (void *)v - (void *)anchor;
   325	
   326		switch (type) {
   327		case R_LARCH_PCALA_HI20:
   328			v = offset_hi20 >> 12;
   329			insn->reg1i20_format.immediate = v & 0xfffff;
   330			break;
   331		case R_LARCH_PCALA64_LO20:
   332			v = offset_rem >> 32;
   333			insn->reg1i20_format.immediate = v & 0xfffff;
   334			break;
   335		case R_LARCH_PCALA64_HI12:
 > 336			v = offset_rem >> 52;
   337			/* fall through */
   338		case R_LARCH_PCALA_LO12:
   339			insn->reg2i12_format.immediate = v & 0xfff;
   340			break;
   341		default:
   342			pr_err("%s: Unsupport relocation type %u\n", mod->name, type);
   343			return -EINVAL;
   344		}
   345	
   346		return 0;
   347	}
   348	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

  reply	other threads:[~2022-08-30 13:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 10:48 [PATCH v7 0/5] LoongArch: Support toolchain with new relocation types Xi Ruoyao
2022-08-30 10:48 ` [PATCH v7 1/5] LoongArch: Add CONFIG_AS_HAS_EXPLICIT_RELOCS Xi Ruoyao
2022-08-30 10:48 ` [PATCH v7 2/5] LoongArch: Adjust symbol addressing for CONFIG_AS_HAS_EXPLICIT_RELOCS Xi Ruoyao
2022-08-30 10:48 ` [PATCH v7 3/5] LoongArch: Define ELF relocation types added in v2.00 ABI Xi Ruoyao
2022-08-30 10:48 ` [PATCH v7 4/5] LoongArch: Support PC-relative relocations in modules Xi Ruoyao
2022-08-30 12:59   ` kernel test robot [this message]
2022-08-30 10:48 ` [PATCH v7 5/5] LoongArch: Support R_LARCH_GOT_PC* " Xi Ruoyao
2022-08-30 13:05 ` [PATCH v7 0/5] LoongArch: Support toolchain with new relocation types Huacai Chen
2022-08-30 14:48   ` Xi Ruoyao
2022-08-30 16:37   ` WANG Xuerui
2022-08-31  5:44     ` Huacai Chen
2022-08-31  6:10       ` Xi Ruoyao
2022-08-31  6:58         ` Jinyang He
2022-08-31  8:08           ` Xi Ruoyao
2022-08-31 14:40             ` Huacai Chen
2022-08-31 15:14               ` Xi Ruoyao
2022-09-01  2:17                 ` Huacai Chen
2022-09-01  2:26                   ` Xi Ruoyao
2022-09-06  0:32                   ` Xi Ruoyao
2022-09-06  1:52                     ` Huacai Chen
2022-09-06  4:26                       ` Xi Ruoyao
2022-09-06  4:43                         ` Huacai Chen
2022-09-06  5:01                           ` Xi Ruoyao
2022-09-06  5:57                             ` Huacai Chen
2022-09-06  7:18                           ` Ard Biesheuvel
2022-09-06  8:20                             ` Huacai Chen
2022-09-06  8:59                               ` Huacai Chen
2022-09-06 10:16                                 ` Ard Biesheuvel

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=202208302041.ANqQ0hQd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=chenhuacai@kernel.org \
    --cc=hejinyang@loongson.cn \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel@xen0n.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=tangyouling@loongson.cn \
    --cc=xry111@xry111.site \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®