Re: [PATCH v7 02/11] powerpc: prepare string/mem functions for KASAN

From: kbuild test robot
Date: Mon Feb 25 2019 - 17:47:44 EST


Hi Christophe,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on powerpc/next]
[also build test ERROR on v5.0-rc8]
[cannot apply to next-20190225]
[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/Christophe-Leroy/KASAN-for-powerpc-32/20190226-052610
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 8.2.0-11) 8.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
GCC_VERSION=8.2.0 make.cross ARCH=powerpc

All errors (new ones prefixed by >>):

arch/powerpc/lib/mem_64.S: Assembler messages:
>> arch/powerpc/lib/mem_64.S:35: Error: unrecognized opcode: `_global_kasan(memset)'
>> arch/powerpc/lib/mem_64.S:100: Error: unrecognized opcode: `export_symbol_kasan(memset)'
>> arch/powerpc/lib/mem_64.S:102: Error: unrecognized opcode: `_global_toc_kasan(memmove)'
>> arch/powerpc/lib/mem_64.S:143: Error: unrecognized opcode: `export_symbol_kasan(memmove)'
--
arch/powerpc/lib/memcpy_64.S: Assembler messages:
>> arch/powerpc/lib/memcpy_64.S:21: Error: unrecognized opcode: `_global_toc_kasan(memcpy)'
>> arch/powerpc/lib/memcpy_64.S:232: Error: unrecognized opcode: `export_symbol_kasan(memcpy)'

vim +35 arch/powerpc/lib/mem_64.S

34
> 35 _GLOBAL_KASAN(memset)
36 neg r0,r3
37 rlwimi r4,r4,8,16,23
38 andi. r0,r0,7 /* # bytes to be 8-byte aligned */
39 rlwimi r4,r4,16,0,15
40 cmplw cr1,r5,r0 /* do we get that far? */
41 rldimi r4,r4,32,0
42 .Lms: PPC_MTOCRF(1,r0)
43 mr r6,r3
44 blt cr1,8f
45 beq 3f /* if already 8-byte aligned */
46 subf r5,r0,r5
47 bf 31,1f
48 stb r4,0(r6)
49 addi r6,r6,1
50 1: bf 30,2f
51 sth r4,0(r6)
52 addi r6,r6,2
53 2: bf 29,3f
54 stw r4,0(r6)
55 addi r6,r6,4
56 3: srdi. r0,r5,6
57 clrldi r5,r5,58
58 mtctr r0
59 beq 5f
60 .balign 16
61 4: std r4,0(r6)
62 std r4,8(r6)
63 std r4,16(r6)
64 std r4,24(r6)
65 std r4,32(r6)
66 std r4,40(r6)
67 std r4,48(r6)
68 std r4,56(r6)
69 addi r6,r6,64
70 bdnz 4b
71 5: srwi. r0,r5,3
72 clrlwi r5,r5,29
73 PPC_MTOCRF(1,r0)
74 beq 8f
75 bf 29,6f
76 std r4,0(r6)
77 std r4,8(r6)
78 std r4,16(r6)
79 std r4,24(r6)
80 addi r6,r6,32
81 6: bf 30,7f
82 std r4,0(r6)
83 std r4,8(r6)
84 addi r6,r6,16
85 7: bf 31,8f
86 std r4,0(r6)
87 addi r6,r6,8
88 8: cmpwi r5,0
89 PPC_MTOCRF(1,r5)
90 beqlr
91 bf 29,9f
92 stw r4,0(r6)
93 addi r6,r6,4
94 9: bf 30,10f
95 sth r4,0(r6)
96 addi r6,r6,2
97 10: bflr 31
98 stb r4,0(r6)
99 blr
> 100 EXPORT_SYMBOL_KASAN(memset)
101
> 102 _GLOBAL_TOC_KASAN(memmove)
103 cmplw 0,r3,r4
104 bgt backwards_memcpy
105 b memcpy
106
107 _GLOBAL(backwards_memcpy)
108 rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
109 add r6,r3,r5
110 add r4,r4,r5
111 beq 2f
112 andi. r0,r6,3
113 mtctr r7
114 bne 5f
115 .balign 16
116 1: lwz r7,-4(r4)
117 lwzu r8,-8(r4)
118 stw r7,-4(r6)
119 stwu r8,-8(r6)
120 bdnz 1b
121 andi. r5,r5,7
122 2: cmplwi 0,r5,4
123 blt 3f
124 lwzu r0,-4(r4)
125 subi r5,r5,4
126 stwu r0,-4(r6)
127 3: cmpwi 0,r5,0
128 beqlr
129 mtctr r5
130 4: lbzu r0,-1(r4)
131 stbu r0,-1(r6)
132 bdnz 4b
133 blr
134 5: mtctr r0
135 6: lbzu r7,-1(r4)
136 stbu r7,-1(r6)
137 bdnz 6b
138 subf r5,r0,r5
139 rlwinm. r7,r5,32-3,3,31
140 beq 2b
141 mtctr r7
142 b 1b
> 143 EXPORT_SYMBOL_KASAN(memmove)

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip