[PATCH v3 11/16] x86/alternatives: Add ALTERNATIVE_4()

From: Juergen Gross

Date: Wed Feb 18 2026 - 03:26:43 EST


For supporting WRMSR with CONFIG_PARAVIRT_XXL using direct instruction
replacement, ALTERNATIVE_4() is needed.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
V3:
- new patch
---
arch/x86/include/asm/alternative.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
index 03364510d5fe..119634eb3361 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -231,6 +231,12 @@ static inline int alternatives_text_reserved(void *start, void *end)
ALTERNATIVE(ALTERNATIVE_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2), \
newinstr3, ft_flags3)

+#define ALTERNATIVE_4(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2, \
+ newinstr3, ft_flags3, newinstr4, ft_flags4) \
+ ALTERNATIVE(ALTERNATIVE_3(oldinstr, newinstr1, ft_flags1, \
+ newinstr2, ft_flags2, newinstr3, ft_flags3),\
+ newinstr4, ft_flags4)
+
/*
* Alternative instructions for different CPU types or capabilities.
*
--
2.53.0