[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202406200507.AXxJ6Bmw-lkp@intel.com>
Date: Thu, 20 Jun 2024 05:58:13 +0800
From: kernel test robot <lkp@...el.com>
To: "Borislav Petkov (AMD)" <bp@...en8.de>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
x86@...nel.org
Subject: [tip:x86/alternatives 15/15]
arch/x86/include/asm/alternative.h:251:25: error: expected string literal
before ',' token
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/alternatives
head: 93f78dadee5e56ae48aff567583d503868aa3bf2
commit: 93f78dadee5e56ae48aff567583d503868aa3bf2 [15/15] x86/alternatives, kvm: Fix a couple of CALLs without a frame pointer
config: i386-randconfig-s052-20230614 (https://download.01.org/0day-ci/archive/20240620/202406200507.AXxJ6Bmw-lkp@intel.com/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240620/202406200507.AXxJ6Bmw-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406200507.AXxJ6Bmw-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
In file included from arch/x86/include/asm/barrier.h:5,
from include/linux/list.h:11,
from include/linux/swait.h:5,
from include/linux/completion.h:12,
from include/linux/crypto.h:15,
from arch/x86/kernel/asm-offsets.c:9:
arch/x86/include/asm/atomic64_32.h: In function 'arch_atomic64_set':
>> arch/x86/include/asm/alternative.h:251:25: error: expected string literal before ',' token
251 | : output, ASM_CALL_CONSTRAINT : [old] "i" (oldfunc), [new] "i" (newfunc), ## input)
| ^
arch/x86/include/asm/atomic64_32.h:59:9: note: in expansion of macro 'alternative_call'
59 | alternative_call(atomic64_##f##_386, atomic64_##g##_cx8, \
| ^~~~~~~~~~~~~~~~
arch/x86/include/asm/atomic64_32.h:72:9: note: in expansion of macro '__alternative_atomic64'
72 | __alternative_atomic64(f, f, ASM_OUTPUT2(out), ## in)
| ^~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/atomic64_32.h:118:9: note: in expansion of macro 'alternative_atomic64'
118 | alternative_atomic64(set, /* no output */,
| ^~~~~~~~~~~~~~~~~~~~
In file included from arch/x86/include/asm/atomic.h:172,
from include/linux/atomic.h:7,
from include/linux/jump_label.h:256,
from include/linux/static_key.h:1,
from arch/x86/include/asm/nospec-branch.h:6,
from arch/x86/include/asm/irqflags.h:9,
from include/linux/irqflags.h:18,
from include/linux/spinlock.h:59,
from include/linux/swait.h:7:
>> arch/x86/include/asm/atomic64_32.h:117:18: warning: unused variable 'low' [-Wunused-variable]
117 | unsigned low = (unsigned)i;
| ^~~
>> arch/x86/include/asm/atomic64_32.h:116:18: warning: unused variable 'high' [-Wunused-variable]
116 | unsigned high = (unsigned)(i >> 32);
| ^~~~
arch/x86/include/asm/atomic64_32.h: In function 'arch_atomic64_inc':
>> arch/x86/include/asm/alternative.h:251:25: error: expected string literal before ',' token
251 | : output, ASM_CALL_CONSTRAINT : [old] "i" (oldfunc), [new] "i" (newfunc), ## input)
| ^
arch/x86/include/asm/atomic64_32.h:59:9: note: in expansion of macro 'alternative_call'
59 | alternative_call(atomic64_##f##_386, atomic64_##g##_cx8, \
| ^~~~~~~~~~~~~~~~
arch/x86/include/asm/atomic64_32.h:184:9: note: in expansion of macro '__alternative_atomic64'
184 | __alternative_atomic64(inc, inc_return, /* no output */,
| ^~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/atomic64_32.h: In function 'arch_atomic64_dec':
>> arch/x86/include/asm/alternative.h:251:25: error: expected string literal before ',' token
251 | : output, ASM_CALL_CONSTRAINT : [old] "i" (oldfunc), [new] "i" (newfunc), ## input)
| ^
arch/x86/include/asm/atomic64_32.h:59:9: note: in expansion of macro 'alternative_call'
59 | alternative_call(atomic64_##f##_386, atomic64_##g##_cx8, \
| ^~~~~~~~~~~~~~~~
arch/x86/include/asm/atomic64_32.h:191:9: note: in expansion of macro '__alternative_atomic64'
191 | __alternative_atomic64(dec, dec_return, /* no output */,
| ^~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
make[3]: Target 'prepare' not remade because of errors.
make[2]: *** [Makefile:1208: prepare0] Error 2
make[2]: Target 'prepare' not remade because of errors.
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:240: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +251 arch/x86/include/asm/alternative.h
162
163 #define OLDINSTR(oldinstr) \
164 "# ALT: oldinstr\n" \
165 "771:\n\t" oldinstr "\n772:\n" \
166 "# ALT: padding\n" \
167 ".skip -(((" alt_rlen ")-(" alt_slen ")) > 0) * " \
168 "((" alt_rlen ")-(" alt_slen ")),0x90\n" \
169 "773:\n"
170
171 #define ALTINSTR_ENTRY(ft_flags) \
172 ".pushsection .altinstructions,\"a\"\n" \
173 " .long 771b - .\n" /* label */ \
174 " .long 774f - .\n" /* new instruction */ \
175 " .4byte " __stringify(ft_flags) "\n" /* feature + flags */ \
176 " .byte " alt_total_slen "\n" /* source len */ \
177 " .byte " alt_rlen "\n" /* replacement len */ \
178 ".popsection\n"
179
180 #define ALTINSTR_REPLACEMENT(newinstr) /* replacement */ \
181 ".pushsection .altinstr_replacement, \"ax\"\n" \
182 "# ALT: replacement\n" \
183 "774:\n\t" newinstr "\n775:\n" \
184 ".popsection\n"
185
186 /* alternative assembly primitive: */
187 #define ALTERNATIVE(oldinstr, newinstr, ft_flags) \
188 OLDINSTR(oldinstr) \
189 ALTINSTR_ENTRY(ft_flags) \
190 ALTINSTR_REPLACEMENT(newinstr)
191
192 #define ALTERNATIVE_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2) \
193 ALTERNATIVE(ALTERNATIVE(oldinstr, newinstr1, ft_flags1), newinstr2, ft_flags2)
194
195 /* If @feature is set, patch in @newinstr_yes, otherwise @newinstr_no. */
196 #define ALTERNATIVE_TERNARY(oldinstr, ft_flags, newinstr_yes, newinstr_no) \
197 ALTERNATIVE_2(oldinstr, newinstr_no, X86_FEATURE_ALWAYS, newinstr_yes, ft_flags)
198
199 #define ALTERNATIVE_3(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2, \
200 newinstr3, ft_flags3) \
201 ALTERNATIVE(ALTERNATIVE_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2), \
202 newinstr3, ft_flags3)
203
204 /*
205 * Alternative instructions for different CPU types or capabilities.
206 *
207 * This allows to use optimized instructions even on generic binary
208 * kernels.
209 *
210 * length of oldinstr must be longer or equal the length of newinstr
211 * It can be padded with nops as needed.
212 *
213 * For non barrier like inlines please define new variants
214 * without volatile and memory clobber.
215 */
216 #define alternative(oldinstr, newinstr, ft_flags) \
217 asm_inline volatile(ALTERNATIVE(oldinstr, newinstr, ft_flags) : : : "memory")
218
219 #define alternative_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2) \
220 asm_inline volatile(ALTERNATIVE_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2) ::: "memory")
221
222 /*
223 * Alternative inline assembly with input.
224 *
225 * Peculiarities:
226 * No memory clobber here.
227 * Argument numbers start with 1.
228 * Leaving an unused argument 0 to keep API compatibility.
229 */
230 #define alternative_input(oldinstr, newinstr, ft_flags, input...) \
231 asm_inline volatile(ALTERNATIVE(oldinstr, newinstr, ft_flags) \
232 : : "i" (0), ## input)
233
234 /* Like alternative_input, but with a single output argument */
235 #define alternative_io(oldinstr, newinstr, ft_flags, output, input...) \
236 asm_inline volatile(ALTERNATIVE(oldinstr, newinstr, ft_flags) \
237 : output : "i" (0), ## input)
238
239 /*
240 * Like alternative_io, but for replacing a direct call with another one.
241 *
242 * Use the %c operand modifier which is the generic way to print a bare
243 * constant expression with all syntax-specific punctuation omitted. %P
244 * is the x86-specific variant which can handle constants too, for
245 * historical reasons, but it should be used primarily for PIC
246 * references: i.e., if used for a function, it would add the PLT
247 * suffix.
248 */
249 #define alternative_call(oldfunc, newfunc, ft_flags, output, input...) \
250 asm_inline volatile(ALTERNATIVE("call %c[old]", "call %c[new]", ft_flags) \
> 251 : output, ASM_CALL_CONSTRAINT : [old] "i" (oldfunc), [new] "i" (newfunc), ## input)
252
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists