lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202301100530.i6ucrHOM-lkp@intel.com>
Date:   Tue, 10 Jan 2023 05:52:29 +0800
From:   kernel test robot <lkp@...el.com>
To:     Youling Tang <tangyouling@...ngson.cn>,
        Huacai Chen <chenhuacai@...nel.org>,
        Xi Ruoyao <xry111@...111.site>,
        Jinyang He <hejinyang@...ngson.cn>
Cc:     oe-kbuild-all@...ts.linux.dev, Xuerui Wang <kernel@...0n.name>,
        loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] LoongArch: Add support for kernel relocation

Hi Youling,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.2-rc3 next-20230109]
[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/Youling-Tang/LoongArch-Use-trampoline-for-exception-handlers-and-kill-la-abs/20230109-171344
patch link:    https://lore.kernel.org/r/1673255274-18238-4-git-send-email-tangyouling%40loongson.cn
patch subject: [PATCH 3/4] LoongArch: Add support for kernel relocation
config: loongarch-allmodconfig
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/35b3031ab84fc4832dd66a381f37fb2dcec8e5c1
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Youling-Tang/LoongArch-Use-trampoline-for-exception-handlers-and-kill-la-abs/20230109-171344
        git checkout 35b3031ab84fc4832dd66a381f37fb2dcec8e5c1
        # 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 olddefconfig
        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@...el.com>

Note: functions only called from assembly code should be annotated with the asmlinkage attribute
All warnings (new ones prefixed by >>):

>> arch/loongarch/kernel/relocate.c:44:14: warning: no previous prototype for 'relocate_kernel' [-Wmissing-prototypes]
      44 | void *__init relocate_kernel(void)
         |              ^~~~~~~~~~~~~~~
   arch/loongarch/kernel/relocate.c: In function 'relocate_kernel':
>> arch/loongarch/kernel/relocate.c:82:48: warning: assignment to 'Elf64_Addr' {aka 'long long unsigned int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
      82 |                                 relocated_addr = RELOCATED(relocated_addr);
         |                                                ^
   arch/loongarch/kernel/relocate.c:94:1: warning: label 'out' defined but not used [-Wunused-label]
      94 | out:
         | ^~~
   arch/loongarch/kernel/relocate.c:50:13: warning: unused variable 'res' [-Wunused-variable]
      50 |         int res = 1;
         |             ^~~


vim +/relocate_kernel +44 arch/loongarch/kernel/relocate.c

    43	
  > 44	void *__init relocate_kernel(void)
    45	{
    46		Elf64_Rela *rela, *rela_end;
    47		void *loc_new;
    48		unsigned long kernel_length;
    49		long offset = 0;
    50		int res = 1;
    51		/* Default to original kernel entry point */
    52		void *kernel_entry = start_kernel;
    53	
    54		kernel_length = (long)(_end) - (long)(_text);
    55	
    56		loc_new = determine_relocation_address();
    57	
    58		/* Sanity check relocation address */
    59		if (relocation_addr_valid(loc_new))
    60			offset = (unsigned long)loc_new - (unsigned long)(_text);
    61	
    62		if (offset) {
    63			/* Copy the kernel to it's new location */
    64			memcpy(loc_new, _text, kernel_length);
    65	
    66			/* Sync the caches ready for execution of new kernel */
    67			__asm__ __volatile__ (
    68				"ibar 0 \t\n"
    69				"dbar 0 \t\n");
    70	
    71			rela = (Elf64_Rela *)RELOCATED(&__rela_dyn_start);
    72			rela_end = (Elf64_Rela *)RELOCATED(&__rela_dyn_end);
    73	
    74			for ( ; rela < rela_end; rela++) {
    75				Elf64_Addr addr = rela->r_offset;
    76				Elf64_Addr relocated_addr = rela->r_addend;
    77	
    78				if (rela->r_info != R_LARCH_RELATIVE)
    79					continue;
    80	
    81				if (relocated_addr >= VMLINUX_LOAD_ADDRESS)
  > 82					relocated_addr = RELOCATED(relocated_addr);

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

View attachment "config" of type "text/plain" (326846 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ