From nobody Thu Feb 12 21:43:53 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC1BD1940B5 for ; Fri, 7 Jun 2024 11:17:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717759037; cv=none; b=CbgTW44w/PXrhNwdT1gELzSY96VBvxEvQIKlFokPgve2o5ocxcOtSMErUQnb8DwL8L29japBGL1SJpgo9e96SIQSuISMdnpI73OS4IeBX6rlZawJNbioAKclJgXqd2ZB3+xGgSKl459g+uok3REBJIzLrqxQztEqoA87E6Uhf/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717759037; c=relaxed/simple; bh=SkAL6P8aesAmbpCT2O5FROApQPOqWnWIL7i4C/sp/ug=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LJSIxhBcGS7PXqBqdHNS/ms3wQydmb/SCqnjbCiWttghGINUXnJMZ15WvQctBVBkGXQh/3ictrncS+NRLToBFijR5MLw5ddNDtFcffWfN8joDaLku4H4xTAnx2v+NToYmBT7xNNu5HgqtwdvO1/CRb8TPhEvGqKJ8mtwLJVc+Fw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dtOt/ExG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dtOt/ExG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA878C4AF07; Fri, 7 Jun 2024 11:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717759037; bh=SkAL6P8aesAmbpCT2O5FROApQPOqWnWIL7i4C/sp/ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dtOt/ExG7mZegohbTeKdWc1S0nbNzsMDDcgUzeac90GfN2BehWlvUchO/MaUQ8xUC Ex3D/s0pkZnBq0VKivMuoNKEzvvOXCOrefExiUXfgPyQYPSiDo4lUqKwmRpYjsuudW DgOP93iJ/aEjLI1aecLwJ5ASB7+mzag9tFa3JoKArjI8m6lf5R+kDSxdSxYxxiUNae RIilEd4RZnH7M5sVnITDm6S0RXRUoT04X7U4EGkqbMJkgtfVh+HqZCwpM2ZFdEUC6N uU8FWW99E5/KLQehIIHGhlmBdEa6eNwKqrpEdS3EXqrxidTl7lUmF9xFhZGFAkhpBo WWpj2Zx2ETCbg== From: Borislav Petkov To: X86 ML Cc: LKML , "Borislav Petkov (AMD)" Subject: [PATCH v1 08/14] x86/alternative: Convert alternative_call_2() Date: Fri, 7 Jun 2024 13:16:55 +0200 Message-ID: <20240607111701.8366-9-bp@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240607111701.8366-1-bp@kernel.org> References: <20240607111701.8366-1-bp@kernel.org> 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 Content-Type: text/plain; charset="utf-8" From: "Borislav Petkov (AMD)" Signed-off-by: Borislav Petkov (AMD) --- arch/x86/include/asm/alternative.h | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alte= rnative.h index b6597574fa43..bc260f27d7f1 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -358,23 +358,14 @@ static inline int alternatives_text_reserved(void *st= art, void *end) * Otherwise, if CPU has feature1, function1 is used. * Otherwise, old function is used. */ -#define alternative_call_2(oldfunc, newfunc1, ft_flags1, newfunc2, ft_flag= s2, \ - output, input...) \ - asm_inline volatile (ALTERNATIVE_2("call %c[old]", "call %c[new1]", ft_fl= ags1, \ - "call %c[new2]", ft_flags2) \ - : output, ASM_CALL_CONSTRAINT \ - : [old] "i" (oldfunc), [new1] "i" (newfunc1), \ +#define alternative_call_2(oldfunc, newfunc1, ft_flags1, newfunc2, ft_flag= s2, \ + output, input...) \ + asm_inline volatile(N_ALTERNATIVE_2("call %c[old]", "call %c[new1]", ft_f= lags1, \ + "call %c[new2]", ft_flags2) \ + : output, ASM_CALL_CONSTRAINT \ + : [old] "i" (oldfunc), [new1] "i" (newfunc1), \ [new2] "i" (newfunc2), ## input) =20 -#define n_alternative_call_2(oldfunc, newfunc1, ft_flags1, newfunc2, ft_fl= ags2, \ - output, input...) \ - asm_inline volatile (N_ALTERNATIVE_2("call %c[old]", "call %c[new1]", ft_= flags1,\ - "call %c[new2]", ft_flags2) \ - : output, ASM_CALL_CONSTRAINT \ - : [old] "i" (oldfunc), [new1] "i" (newfunc1), \ - [new2] "i" (newfunc2), ## input) - - /* * use this macro(s) if you need more than one output parameter * in alternative_io --=20 2.43.0