[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <544d2242-9a1d-b7cb-dd8f-e40c9277a3de@suse.com>
Date: Wed, 10 Mar 2021 15:42:03 +0100
From: Jürgen Groß <jgross@...e.com>
To: Borislav Petkov <bp@...en8.de>
Cc: xen-devel@...ts.xenproject.org, x86@...nel.org,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v6 05/12] x86/alternative: support ALTERNATIVE_TERNARY
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
Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3092 bytes)
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)
Powered by blists - more mailing lists