Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp416454lqh; Fri, 31 May 2024 05:37:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXc3/TUkFAWqy0zUm/XXuKVahHAIGTiadyzEGY7bHHR+qSqIcq2CjmAshcHASUKQpJJubFAcp5SGtCEsKBjLseoeqa8fUWBBS5rLS+5VA== X-Google-Smtp-Source: AGHT+IFZzjYtSbK+LuQ5lFtFEDvQe/J0tZ+QDHDM8s211qIxIHESXbdmrbX/oAO4hqbub38DNgr2 X-Received: by 2002:a05:6214:459c:b0:6ad:7a4d:a4ae with SMTP id 6a1803df08f44-6aecd6f013cmr16849576d6.58.1717159042099; Fri, 31 May 2024 05:37:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717159042; cv=pass; d=google.com; s=arc-20160816; b=VhpjtJda7+A4u7/PaVcnpR+l4ZhGfxw9X/doQUpLUKTJD2lpBCHElzmzmdQFIW8PwQ lPPCcEGr2VbHOsBoXYRxd++S2JXZRdO8VqoivH+a2sYugA8Mh7bDgCYoAxz7Q2mKzsu6 RDfnz5WCzHdbkqZlJ2xmtMAcfG3U1/0bI5Bbj0sa8PC4AUTMDRtAigKwtnbX4qvSTooj zvKAZcdXvjJJKfTGfE/qxeoldMNvOkHy8yOK5DT9bGoilFebWRRmCNyeWGMdcEPqTi/2 jgbqLvmaS5lq237CyZHRnA03DXMKQ5TkF6nUrgWbAi5KWIJPYl29/aC222lJFoKNdzh7 fyPw== 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=jDK21N260tGvvLeWQVTBk90atxPLjhIMwamPvwEMK04=; fh=b+GcvI4Pcayc3mqYGvUYD/O2AEP50jeeZwnwIXNAGVQ=; b=auucG13xJIsL7rO2mW28MQo7IQ69pny6KyPa1WcnBWbQ/lGPvRjG0sn2D8EU1M5IHz TTFTWgaRdB1XVwdQEhahKkf3ERg6/q7OgVX5pGbwBzeQrGR39cOxxy6KQ76aMrln1nZK xEcvN1qJ8M1c6aWJEqOgNODxtFPc8jmFYulmji9nr4it4CtsZ1kqjNPC76GwQh4qmaRm e+WldsEN7yjMfZIrWrsdJGxIV1+luS0suse2qBKqxsaIlq8XJ2rdcvVp3PPi0/AVAWvY 8W+qqNctNrfl8hOteHUpslsKyFdzmUguDkM+AhT16Ed17GFqWNrWjW0TGE42hA1kUjcA nNbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iUAMAFaT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-196794-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196794-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4a742533si20378126d6.176.2024.05.31.05.37.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 05:37:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196794-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iUAMAFaT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-196794-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196794-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C570E1C24713 for ; Fri, 31 May 2024 12:37:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1946116E867; Fri, 31 May 2024 12:35:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iUAMAFaT" 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 484DC161B4D for ; Fri, 31 May 2024 12:35:26 +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=1717158926; cv=none; b=SiGOuGdPBQEAGY9ooZF+UoxcgrNHJfu4hE1bZGRssAkSJxkp8Wp5orImlSN/N8KhIMRN6pGVLHZk5ygvRHfD0k9f5inZeUT9IDyA/zQSKqnDoHVuaGz+hMOJtpjZNmftd9XMRo/uRFcpgBpiJCc/rjiyLn2pdmcUYgucJvTKVsM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717158926; c=relaxed/simple; bh=g+G19NKQbd6Xtqc8HQIhzpIDmFN7DdYjK8JTK7amgwM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EpXyP/QZN8c6LhdGBUxXZimOxP07z/hcbinyZtjc6aIGtfdcKb7lK/ZVb8ixCh9WEG1GjGhh7RjAx4HlIqNOfRcOx77YCX1Wh+3bCB5A/DfL22KlmMlPZP+JM1tJLfRBS4yZcKQXRAeA03zajcKfQLhNHZ6JHicsPl9pmz43H0I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iUAMAFaT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C0A0C32786; Fri, 31 May 2024 12:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717158926; bh=g+G19NKQbd6Xtqc8HQIhzpIDmFN7DdYjK8JTK7amgwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iUAMAFaT69xFtXeJ2GAUZn/DDtnT/opTJjnFLesIch99rPRQ0d5IMRLf6AmQ1ALXk G367ehtdFqXYEc5zRDTjANbnxHSMKwgaPdQGlWJLIboRuYHFkROtTPYquGUAqgD4PW H7gOk/Jcr01Xe7cIh1XTCHEvexiRWwuy0cqLiMiUaH5RPzlXvMITQj/j96ppjQrUxI sjUnAC7nQlHhzZBOJPpu/qe5Co2cxCfZouCvzDOozy31u9AqxNlcPetW3VRtxYZVq/ ovK0yEpYe0w+M/lzMQr5avxBQMVmHtKKlM98Tx76z9/2kMym6i9xD24ejF6/Bbma2D mOHdn7X7zMnQg== From: Borislav Petkov To: X86 ML Cc: LKML , "Borislav Petkov (AMD)" Subject: [PATCH 08/14] x86/alternative: Convert alternative_call_2() Date: Fri, 31 May 2024 14:35:05 +0200 Message-ID: <20240531123512.21427-9-bp@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240531123512.21427-1-bp@kernel.org> References: <20240531123512.21427-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 bc696c60848d..bad1558d6382 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -349,23 +349,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 %P[old]", "call %P[new1]", ft_flags1, \ + "call %P[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 %P[old]", "call %P[new1]", ft_flags1,\ - "call %P[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