Lines Matching +full:alternative +full:- +full:a
1 /* SPDX-License-Identifier: GPL-2.0 */
24 * Alternative inline assembly for SMP.
30 * alternatives and the X86_FEATURE_UP flag to indicate the case of a
31 * UP system running a SMP kernel. The existing apply_alternatives()
32 * works fine for patching a SMP kernel for UP.
34 * The SMP alternative tables can be kept after boot and contain both
36 * SMP at runtime, when hotplugging in a new CPU, which is especially
39 * The very common lock prefix is handled as special case in a
40 * separate table which is a pure address list without replacement ptr
46 ".pushsection .smp_locks,\"a\"\n" \
48 ".long 671f - .\n" /* offset */ \
66 * extended in the future to fit in a u64 or however the need arises.
93 * Debug flag that can be tested to see whether alternative
187 #define alt_slen "772b-771b"
188 #define alt_total_slen "773b-771b"
189 #define alt_rlen "775f-774f"
195 ".skip -(((" alt_rlen ")-(" alt_slen ")) > 0) * " \
196 "((" alt_rlen ")-(" alt_slen ")),0x90\n" \
200 ".pushsection .altinstructions,\"a\"\n" \
201 " .long 771b - .\n" /* label */ \
202 " .long 774f - .\n" /* new instruction */ \
214 /* alternative assembly primitive: */
215 #define ALTERNATIVE(oldinstr, newinstr, ft_flags) \ macro
221 ALTERNATIVE(ALTERNATIVE(oldinstr, newinstr1, ft_flags1), newinstr2, ft_flags2)
229 ALTERNATIVE(ALTERNATIVE_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2), \
233 * Alternative instructions for different CPU types or capabilities.
244 #define alternative(oldinstr, newinstr, ft_flags) \ macro
245 asm_inline volatile(ALTERNATIVE(oldinstr, newinstr, ft_flags) : : : "memory")
251 * Alternative inline assembly with input.
259 asm_inline volatile(ALTERNATIVE(oldinstr, newinstr, ft_flags) \
262 /* Like alternative_input, but with a single output argument */
264 asm_inline volatile(ALTERNATIVE(oldinstr, newinstr, ft_flags) \
268 * Like alternative_io, but for replacing a direct call with another one.
270 * Use the %c operand modifier which is the generic way to print a bare
271 * constant expression with all syntax-specific punctuation omitted. %P
272 * is the x86-specific variant which can handle constants too, for
274 * references: i.e., if used for a function, it would add the PLT
278 asm_inline volatile(ALTERNATIVE("call %c[old]", "call %c[new]", ft_flags) \
312 ".size " #func ", . - " #func "\n\t" \
323 .pushsection .smp_locks,"a"
325 .long 672b - .
340 .long \orig - .
341 .long \alt - .
352 * Define an alternative between two instructions. If @feature is
361 .skip -(((744f-743f)-(741b-740b)) > 0) * ((744f-743f)-(741b-740b)),0x90 ;\
363 .pushsection .altinstructions,"a" ; \
364 altinstr_entry 740b,743f,flag,742b-740b,744f-743f ; \
372 .macro ALTERNATIVE oldinstr, newinstr, ft_flags
377 * Same as ALTERNATIVE macro above but for two alternatives. If CPU