Re: [PATCH v2 1/6] powerpc/code-patching: Implement generic text patching function
From: kernel test robot <hidden>
Date: 2022-09-26 08:57:40
Hi Benjamin, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on 3d7a198cfdb47405cfb4a3ea523876569fe341e6] url: https://github.com/intel-lab-lkp/linux/commits/Benjamin-Gray/Out-of-line-static-calls-for-powerpc64-ELF-V2/20220926-145009 base: 3d7a198cfdb47405cfb4a3ea523876569fe341e6 config: powerpc-allyesconfig compiler: powerpc-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/7e7a5738456329ebbc24558228fb729ce5236f60 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Benjamin-Gray/Out-of-line-static-calls-for-powerpc64-ELF-V2/20220926-145009 git checkout 7e7a5738456329ebbc24558228fb729ce5236f60 # 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=powerpc SHELL=/bin/bash arch/powerpc/lib/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot [off-list ref] All warnings (new ones prefixed by >>):
quoted
arch/powerpc/lib/code-patching.c:18:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
18 | static int __always_inline ___patch_memory(void *patch_addr,
| ^~~~~~
vim +/inline +18 arch/powerpc/lib/code-patching.c
17
> 18 static int __always_inline ___patch_memory(void *patch_addr,
19 unsigned long data,
20 void *prog_addr,
21 size_t size)
22 {
23 switch (size) {
24 case 1:
25 __put_kernel_nofault(patch_addr, &data, u8, failed);
26 break;
27 case 2:
28 __put_kernel_nofault(patch_addr, &data, u16, failed);
29 break;
30 case 4:
31 __put_kernel_nofault(patch_addr, &data, u32, failed);
32 break;
33 #ifdef CONFIG_PPC64
34 case 8:
35 __put_kernel_nofault(patch_addr, &data, u64, failed);
36 break;
37 #endif
38 default:
39 unreachable();
40 }
41
42 dcbst(patch_addr);
43 dcbst(patch_addr + size - 1); /* Last byte of data may cross a cacheline */
44
45 mb(); /* sync */
46
47 /* Flush on the EA that may be executed in case of a non-coherent icache */
48 icbi(prog_addr);
49
50 /* Also flush the last byte of the instruction if it may be a
51 * prefixed instruction and we aren't assuming minimum 64-byte
52 * cacheline sizes
53 */
54 if (IS_ENABLED(CONFIG_PPC64) && L1_CACHE_BYTES < 64)
55 icbi(prog_addr + size - 1);
56
57 mb(); /* sync */
58 isync();
59
60 return 0;
61
62 failed:
63 return -EPERM;
64 }
65
--
0-DAY CI Kernel Test Service
https://01.org/lkp