]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
x86/alternative: Convert the asm ALTERNATIVE() macro
authorBorislav Petkov (AMD) <bp@alien8.de>
Fri, 7 Jun 2024 11:16:58 +0000 (13:16 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 11 Jun 2024 16:25:00 +0000 (18:25 +0200)
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
arch/x86/include/asm/alternative.h

index fba12ad237e25d2e118985fc0f05653e8c5f5b76..31b9a47b9df9801a121493f2b287025a69519961 100644 (file)
@@ -422,24 +422,6 @@ void nop_func(void);
  * @newinstr. ".skip" directive takes care of proper instruction padding
  * in case @newinstr is longer than @oldinstr.
  */
-.macro ALTERNATIVE oldinstr, newinstr, ft_flags
-140:
-       \oldinstr
-141:
-       .skip -(((144f-143f)-(141b-140b)) > 0) * ((144f-143f)-(141b-140b)),0x90
-142:
-
-       .pushsection .altinstructions,"a"
-       altinstr_entry 140b,143f,\ft_flags,142b-140b,144f-143f
-       .popsection
-
-       .pushsection .altinstr_replacement,"ax"
-143:
-       \newinstr
-144:
-       .popsection
-.endm
-
 #define __N_ALTERNATIVE(oldinst, newinst, flag)                                \
 740:                                                                   \
        oldinst ;                                                       \
@@ -455,12 +437,10 @@ void nop_func(void);
 744:                                                                   \
        .popsection ;
 
-
-.macro N_ALTERNATIVE oldinstr, newinstr, ft_flags
+.macro ALTERNATIVE oldinstr, newinstr, ft_flags
        __N_ALTERNATIVE(\oldinstr, \newinstr, \ft_flags)
 .endm
 
-
 #define old_len                        141b-140b
 #define new_len1               144f-143f
 #define new_len2               145f-144f