lkml.org 
[lkml]   [2021]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6 05/12] x86/alternative: support ALTERNATIVE_TERNARY
From
Date
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
[unhandled content-type:application/pgp-keys][unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-03-10 15:43    [W:0.053 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site