From nobody Fri Apr 3 06:04:07 2026 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC6ED31BC95 for ; Wed, 18 Feb 2026 08:22:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771402961; cv=none; b=W5fgBeqGqJ3wgRLdanHGalJDSZUd1/GlAm+dCp0xpehuldc7FvWm8/AC4Hw78P5+X5YFyEBUgWb1fsSmpUvLEb/w9yzPHyGsiWvmSEivnMGAuXJ/mfojLvEodDDnb1PV4PJuZvI6o5lZ5COV+w/ROK7c+FUUu1kErcw60AiMZ60= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771402961; c=relaxed/simple; bh=SneiS0sm9MvHpQ9FzmFP16Mj8QcCFPP/d00dqRh/oXU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PBr9ODif1Sv5Hcge9eU0vjtvwMqBOkA5SoNAoYqtPVPNp+hZt6sMPskuS+RpQa3nrpoKLnW7fTcIKNRdzVapsMvo6EQcAM6gGOsxIqVSlp3awteh0LmTcA9wOIzdUiQCuVBQhfTMgVM4sscv707SK1Anmj7GAgY7jLy9oYGmRWc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D01E63E6F2; Wed, 18 Feb 2026 08:22:37 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 90F483EA65; Wed, 18 Feb 2026 08:22:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id f90+Is12lWmpHgAAD6G6ig (envelope-from ); Wed, 18 Feb 2026 08:22:37 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Juergen Gross , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Subject: [PATCH v3 11/16] x86/alternatives: Add ALTERNATIVE_4() Date: Wed, 18 Feb 2026 09:21:28 +0100 Message-ID: <20260218082133.400602-12-jgross@suse.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260218082133.400602-1-jgross@suse.com> References: <20260218082133.400602-1-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Queue-Id: D01E63E6F2 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: Content-Type: text/plain; charset="utf-8" For supporting WRMSR with CONFIG_PARAVIRT_XXL using direct instruction replacement, ALTERNATIVE_4() is needed. Signed-off-by: Juergen Gross --- 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/alte= rnative.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 *sta= rt, void *end) ALTERNATIVE(ALTERNATIVE_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_f= lags2), \ newinstr3, ft_flags3) =20 +#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. * --=20 2.53.0