Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp963768lqt; Fri, 7 Jun 2024 04:19:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU592Y0NubMucsAmSnJbwjjBDvFWjc7Vm8fs3vOyn7qF7PXWAjLP5/3F2bdeHPNMMEvE1+jLCLB2jxcOXLV2XKsRkuc65JfzRtHpgNLMQ== X-Google-Smtp-Source: AGHT+IHt7YMKLB7q/9V9qOyo8Eta0DnSP2Tl3qUq1kopXqZLSpgw2Fk7ZICq1rzSNDrr7tiaHtea X-Received: by 2002:a05:6e02:2166:b0:374:93d5:e37e with SMTP id e9e14a558f8ab-3758031ede4mr27120545ab.17.1717759160913; Fri, 07 Jun 2024 04:19:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717759160; cv=pass; d=google.com; s=arc-20160816; b=eO3ojMH4QhARCiOD9PdG/ZDx8AZLNQvkrDS3fPgmSMzr4CVp/qKPolM0BET0YY7qBG AXogugZ7DdvAiGfdAsDUHWY34KkzfeeHP2/ewVk1ngttokth5x/VuVD4uuCg7VdCdetN fi36QHvUjLbjF32e0wHEwzlC1OU0rEZrHSacKW42jlz89+vIp+rFVRyZm6LNUo9VAp0e 8gVFpr0fBigCxQpRLBhb6Ta5lIbhuSDY4Gdcq5LKRpqLN7pwKCvJ3N0EKUqXfKPpLcJC gK59KD+p+gVduygVT8zXyVqhFjX3hiImCmntOQW+h0wS/GYs0DL8ZEr4jCRed5uhwRFn aPhA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MsaZg3IOYvFcvT2R3e7FyKqzmbFBVmrYWwuROJay4as=; fh=b+GcvI4Pcayc3mqYGvUYD/O2AEP50jeeZwnwIXNAGVQ=; b=Bdux5YognmYcLY5WBs81s7tPH5+W3BaKyo+NVl/+6nVVoW+43OPFeVDIFXbHdQcwPC jcytF53XnudoU/d/j7dXajj8qW4dhIjJVMIY+zbYVVWFCIa6k/qK+2ba2gfF+3A1fPgV I+ntMlkjZLKE+QVLqXWYdmVAwK5DiB5anmHjj2sCHVenfG6/ziHD30yVQAhO3dmy2SWQ V1b76s8Rm6dGrq41kavg7z1zIpebzOCcmSztXwWukmM9QWs3/mHPoUrFOtkISVtDuiXD C7tm7IoVIAkFv+5955plMgn4eG9zAmWWkNmbUkkiFQzvqWkAFeBigiIQr295kxQyq++A x2Qw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="dtOt/ExG"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-205889-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205889-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de29abf89csi2848775a12.752.2024.06.07.04.19.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 04:19:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205889-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="dtOt/ExG"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-205889-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205889-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7E094289227 for ; Fri, 7 Jun 2024 11:19:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B291019413D; Fri, 7 Jun 2024 11:17:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dtOt/ExG" 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 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: 8bit 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/alternative.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 *start, 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_flags2, \ - output, input...) \ - asm_inline volatile (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), \ +#define alternative_call_2(oldfunc, newfunc1, ft_flags1, newfunc2, ft_flags2, \ + 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) -#define n_alternative_call_2(oldfunc, newfunc1, ft_flags1, newfunc2, ft_flags2, \ - 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 -- 2.43.0