]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/alternative: Support ALTERNATIVE_TERNARY
authorJuergen Gross <jgross@suse.com>
Thu, 11 Mar 2021 14:23:11 +0000 (15:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jul 2022 09:26:09 +0000 (11:26 +0200)
commit341e6178c1cf6225e085de9eaba6216d624d641e
treea150a2ab69fcfc8a5bac4b90fd730f5f0e052371
parent0c4c698569962d32b76ea8ae13334c81ea647be0
x86/alternative: Support ALTERNATIVE_TERNARY

commit e208b3c4a9748b2c17aa09ba663b5096ccf82dce upstream.

Add ALTERNATIVE_TERNARY support for replacing an initial instruction
with either of two instructions depending on a feature:

  ALTERNATIVE_TERNARY "default_instr", FEATURE_NR,
                      "feature_on_instr", "feature_off_instr"

which will start with "default_instr" and at patch time will,
depending on FEATURE_NR being set or not, patch that with either
"feature_on_instr" or "feature_off_instr".

 [ bp: Add comment ontop. ]

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210311142319.4723-7-jgross@suse.com
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/alternative.h