Skip to content

Commit a6c7a6a

Browse files
committed
x86/alternative: Convert the asm ALTERNATIVE() macro
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20240607111701.8366-12-bp@kernel.org
1 parent 9369412 commit a6c7a6a

1 file changed

Lines changed: 1 addition & 21 deletions

File tree

arch/x86/include/asm/alternative.h

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -422,24 +422,6 @@ void nop_func(void);
422422
* @newinstr. ".skip" directive takes care of proper instruction padding
423423
* in case @newinstr is longer than @oldinstr.
424424
*/
425-
.macro ALTERNATIVE oldinstr, newinstr, ft_flags
426-
140:
427-
\oldinstr
428-
141:
429-
.skip -(((144f-143f)-(141b-140b)) > 0) * ((144f-143f)-(141b-140b)),0x90
430-
142:
431-
432-
.pushsection .altinstructions,"a"
433-
altinstr_entry 140b,143f,\ft_flags,142b-140b,144f-143f
434-
.popsection
435-
436-
.pushsection .altinstr_replacement,"ax"
437-
143:
438-
\newinstr
439-
144:
440-
.popsection
441-
.endm
442-
443425
#define __N_ALTERNATIVE(oldinst, newinst, flag) \
444426
740: \
445427
oldinst ; \
@@ -455,12 +437,10 @@ void nop_func(void);
455437
744: \
456438
.popsection ;
457439

458-
459-
.macro N_ALTERNATIVE oldinstr, newinstr, ft_flags
440+
.macro ALTERNATIVE oldinstr, newinstr, ft_flags
460441
__N_ALTERNATIVE(\oldinstr, \newinstr, \ft_flags)
461442
.endm
462443

463-
464444
#define old_len 141b-140b
465445
#define new_len1 144f-143f
466446
#define new_len2 145f-144f

0 commit comments

Comments
 (0)