On 10.03.21 15:27, Borislav Petkov wrote: > On Tue, Mar 09, 2021 at 02:48:06PM +0100, Juergen Gross wrote: >> diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h >> index 89889618ae01..4fb844e29d26 100644 >> --- a/arch/x86/include/asm/alternative.h >> +++ b/arch/x86/include/asm/alternative.h >> @@ -178,6 +178,9 @@ static inline int alternatives_text_reserved(void *start, void *end) >> ALTINSTR_REPLACEMENT(newinstr2, 2) \ >> ".popsection\n" >> >> +#define ALTERNATIVE_TERNARY(oldinstr, feature, newinstr1, newinstr2) \ >> + ALTERNATIVE_2(oldinstr, newinstr2, X86_FEATURE_ALWAYS, newinstr1, feature) > > Make that: > > /* > * If @feature is set, patch @newinstr_yes, else @newinstr_no > */ > #define ALTERNATIVE_TERNARY(oldinstr, feature, newinstr_yes, newinstr_no) \ > ALTERNATIVE_2(oldinstr, newinstr_no, X86_FEATURE_ALWAYS, newinstr_yes, feature) > > and in alternative-asm.h too pls. Okay. > > Regardless, this looks nice! :) Thanks, Juergen