Hi Ganesh,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on powerpc/next]
[also build test ERROR on v5.9-rc5 next-20200916]
[cannot apply to scottwood/next mpe/next]
[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]
url:
https://github.com/0day-ci/linux/commits/Ganesh-Goudar/powerpc-mce-Fix-mc...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-randconfig-r021-20200917 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/powerpc/sysdev/mce_error_inject.c: In function 'get_slb_index':
> arch/powerpc/sysdev/mce_error_inject.c:17:10: error: implicit
declaration of function 'get_paca' [-Werror=implicit-function-declaration]
17 | index = get_paca()->stab_rr;
| ^~~~~~~~
> arch/powerpc/sysdev/mce_error_inject.c:17:20: error: invalid type
argument of '->' (have 'int')
17 | index =
get_paca()->stab_rr;
| ^~
> arch/powerpc/sysdev/mce_error_inject.c:22:15: error:
'mmu_slb_size' undeclared (first use in this function)
22 | if (index
< (mmu_slb_size - 1))
| ^~~~~~~~~~~~
arch/powerpc/sysdev/mce_error_inject.c:22:15: note: each undeclared identifier is
reported only once for each function it appears in
> arch/powerpc/sysdev/mce_error_inject.c:25:11: error:
'SLB_NUM_BOLTED' undeclared (first use in this function)
25 | index
= SLB_NUM_BOLTED;
| ^~~~~~~~~~~~~~
arch/powerpc/sysdev/mce_error_inject.c:26:12: error: invalid type argument of
'->' (have 'int')
26 | get_paca()->stab_rr = index;
| ^~
arch/powerpc/sysdev/mce_error_inject.c: In function 'mk_esid_data':
> arch/powerpc/sysdev/mce_error_inject.c:31:15: error:
'MMU_SEGSIZE_256M' undeclared (first use in this function); did you mean
'MMU_PAGE_256M'?
31 | (((ssize) == MMU_SEGSIZE_256M) ? ESID_MASK :
ESID_MASK_1T)
| ^~~~~~~~~~~~~~~~
arch/powerpc/sysdev/mce_error_inject.c:36:15: note: in expansion of macro
'slb_esid_mask'
36 | return (ea & slb_esid_mask(ssize)) | SLB_ESID_V | slot;
| ^~~~~~~~~~~~~
> arch/powerpc/sysdev/mce_error_inject.c:31:35: error:
'ESID_MASK' undeclared (first use in this function); did you mean
'NMI_MASK'?
31 | (((ssize) == MMU_SEGSIZE_256M) ? ESID_MASK :
ESID_MASK_1T)
| ^~~~~~~~~
arch/powerpc/sysdev/mce_error_inject.c:36:15: note: in expansion of macro
'slb_esid_mask'
36 | return (ea & slb_esid_mask(ssize)) | SLB_ESID_V | slot;
| ^~~~~~~~~~~~~
> arch/powerpc/sysdev/mce_error_inject.c:31:47: error:
'ESID_MASK_1T' undeclared (first use in this function)
31 | (((ssize)
== MMU_SEGSIZE_256M) ? ESID_MASK : ESID_MASK_1T)
| ^~~~~~~~~~~~
arch/powerpc/sysdev/mce_error_inject.c:36:15: note: in expansion of macro
'slb_esid_mask'
36 | return (ea & slb_esid_mask(ssize)) | SLB_ESID_V | slot;
| ^~~~~~~~~~~~~
> arch/powerpc/sysdev/mce_error_inject.c:36:39: error:
'SLB_ESID_V' undeclared (first use in this function)
36 | return (ea
& slb_esid_mask(ssize)) | SLB_ESID_V | slot;
| ^~~~~~~~~~
arch/powerpc/sysdev/mce_error_inject.c: In function 'mk_vsid_data':
> arch/powerpc/sysdev/mce_error_inject.c:45:10: error: implicit
declaration of function 'get_kernel_vsid' [-Werror=implicit-function-declaration]
45 | return (get_kernel_vsid(ea, ssize) << slb_vsid_shift(ssize)) |
flags |
| ^~~~~~~~~~~~~~~
arch/powerpc/sysdev/mce_error_inject.c:40:14: error: 'MMU_SEGSIZE_256M'
undeclared (first use in this function); did you mean 'MMU_PAGE_256M'?
40 | ((ssize) == MMU_SEGSIZE_256M ? SLB_VSID_SHIFT : SLB_VSID_SHIFT_1T)
| ^~~~~~~~~~~~~~~~
arch/powerpc/sysdev/mce_error_inject.c:45:40: note: in expansion of macro
'slb_vsid_shift'
45 | return (get_kernel_vsid(ea, ssize) << slb_vsid_shift(ssize)) | flags |
| ^~~~~~~~~~~~~~
> arch/powerpc/sysdev/mce_error_inject.c:40:33: error:
'SLB_VSID_SHIFT' undeclared (first use in this function)
40 |
((ssize) == MMU_SEGSIZE_256M ? SLB_VSID_SHIFT : SLB_VSID_SHIFT_1T)
| ^~~~~~~~~~~~~~
arch/powerpc/sysdev/mce_error_inject.c:45:40: note: in expansion of macro
'slb_vsid_shift'
45 | return (get_kernel_vsid(ea, ssize) << slb_vsid_shift(ssize)) | flags |
| ^~~~~~~~~~~~~~
> arch/powerpc/sysdev/mce_error_inject.c:40:50: error:
'SLB_VSID_SHIFT_1T' undeclared (first use in this function)
40 |
((ssize) == MMU_SEGSIZE_256M ? SLB_VSID_SHIFT : SLB_VSID_SHIFT_1T)
| ^~~~~~~~~~~~~~~~~
arch/powerpc/sysdev/mce_error_inject.c:45:40: note: in expansion of macro
'slb_vsid_shift'
45 | return (get_kernel_vsid(ea, ssize) << slb_vsid_shift(ssize)) | flags |
| ^~~~~~~~~~~~~~
> arch/powerpc/sysdev/mce_error_inject.c:46:28: error:
'SLB_VSID_SSIZE_SHIFT' undeclared (first use in this function)
46 |
((unsigned long)ssize << SLB_VSID_SSIZE_SHIFT);
| ^~~~~~~~~~~~~~~~~~~~
arch/powerpc/sysdev/mce_error_inject.c: In function 'insert_slb_entry':
> arch/powerpc/sysdev/mce_error_inject.c:54:10: error:
'SLB_VSID_KERNEL' undeclared (first use in this function)
54 | flags
= SLB_VSID_KERNEL | mmu_psize_defs[MMU_PAGE_64K].sllp;
| ^~~~~~~~~~~~~~~
> arch/powerpc/sysdev/mce_error_inject.c:54:28: error:
'mmu_psize_defs' undeclared (first use in this function)
54 | flags =
SLB_VSID_KERNEL | mmu_psize_defs[MMU_PAGE_64K].sllp;
| ^~~~~~~~~~~~~~
> arch/powerpc/sysdev/mce_error_inject.c:58:7: error: assignment to
'struct paca_struct *' from 'int' makes pointer from integer without a
cast [-Werror=int-conversion]
58 | paca = get_paca();
| ^
> arch/powerpc/sysdev/mce_error_inject.c:52:22: error: variable
'paca' set but not used [-Werror=unused-but-set-variable]
52 | struct
paca_struct *paca;
| ^~~~
arch/powerpc/sysdev/mce_error_inject.c: In function
'inject_vmalloc_slb_multihit':
> arch/powerpc/sysdev/mce_error_inject.c:83:22: error:
'MMU_SEGSIZE_1T' undeclared (first use in this function)
83 |
insert_slb_entry(p, MMU_SEGSIZE_1T);
| ^~~~~~~~~~~~~~
arch/powerpc/sysdev/mce_error_inject.c: In function
'inject_kmalloc_slb_multihit':
arch/powerpc/sysdev/mce_error_inject.c:95:22: error: 'MMU_SEGSIZE_1T'
undeclared (first use in this function)
95 | insert_slb_entry(p, MMU_SEGSIZE_1T);
| ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
#
https://github.com/0day-ci/linux/commit/4ab1196e8e542fdf0e7cda8638dfb0e57...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Ganesh-Goudar/powerpc-mce-Fix-mce-handler-and-add-selftest/20200917-092355
git checkout 4ab1196e8e542fdf0e7cda8638dfb0e5771fd98e
vim +/get_paca +17 arch/powerpc/sysdev/mce_error_inject.c
12
13 static inline unsigned long get_slb_index(void)
14 {
15 unsigned long index;
16
17 index = get_paca()->stab_rr;
18
19 /*
20 * simple round-robin replacement of slb starting at SLB_NUM_BOLTED.
21 */
22 if (index < (mmu_slb_size - 1))
23 index++;
24 else
25 index = SLB_NUM_BOLTED;
26 get_paca()->stab_rr =
index;
27 return index;
28 }
29
30 #define slb_esid_mask(ssize) \
31 (((ssize) == MMU_SEGSIZE_256M) ? ESID_MASK : ESID_MASK_1T)
32
33 static inline unsigned long mk_esid_data(unsigned long ea, int ssize,
34 unsigned long slot)
35 {
36 return (ea & slb_esid_mask(ssize)) | SLB_ESID_V | slot;
37 }
38
39 #define slb_vsid_shift(ssize) \
40 ((ssize) == MMU_SEGSIZE_256M ? SLB_VSID_SHIFT :
SLB_VSID_SHIFT_1T)
41
42 static inline unsigned long mk_vsid_data(unsigned long ea, int ssize,
43 unsigned long flags)
44 {
45 return (get_kernel_vsid(ea, ssize) <<
slb_vsid_shift(ssize)) | flags |
46 ((unsigned long)ssize << SLB_VSID_SSIZE_SHIFT);
47 }
48
49 static void insert_slb_entry(char *p, int ssize)
50 {
51 unsigned long flags, entry;
52 struct paca_struct *paca;
53
54 flags = SLB_VSID_KERNEL | mmu_psize_defs[MMU_PAGE_64K].sllp;
55
56 preempt_disable();
57
58 paca = get_paca();
59
60 entry = get_slb_index();
61 asm volatile("slbmte %0,%1" :
62 : "r" (mk_vsid_data((unsigned long)p, ssize, flags)),
63 "r" (mk_esid_data((unsigned long)p, ssize, entry))
64 : "memory");
65
66 entry = get_slb_index();
67 asm volatile("slbmte %0,%1" :
68 : "r" (mk_vsid_data((unsigned long)p, ssize, flags)),
69 "r" (mk_esid_data((unsigned long)p, ssize, entry))
70 : "memory");
71 preempt_enable();
72 p[0] = '!';
73 }
74
75 static void inject_vmalloc_slb_multihit(void)
76 {
77 char *p;
78
79 p = vmalloc(2048);
80 if (!p)
81 return;
82
83 insert_slb_entry(p, MMU_SEGSIZE_1T);
84 vfree(p);
85 }
86
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org