Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp964727lqt; Fri, 7 Jun 2024 04:21:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWg06TaEaL7DUg3BGhPK1UNA31N/lAtPPMVBGAHGvAO5rG7Ks9ocxXBmyFegylgeyVIVRLFe0BYzIGA3VowXZyJpSg0JqCPKwuMxuF+Fg== X-Google-Smtp-Source: AGHT+IF+PdRQ0nhA0v6fpAXgUY5H7QO/QLaWOucmBhR4F2gDqLBPKUEeEyl+iJTnqsLf+uiXn0QW X-Received: by 2002:a17:902:d511:b0:1f4:bcef:e940 with SMTP id d9443c01a7336-1f6d0389098mr27539365ad.45.1717759262433; Fri, 07 Jun 2024 04:21:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717759262; cv=pass; d=google.com; s=arc-20160816; b=o2ncu4BD5oZasvtYpl19soC+z/nDemWSLuFoJY/M2c9FK8WfJqL7jhbBXxvDn4IAYU /P6v49avKBi/0XyuHk8B/oETYthZpWEYJTbDwagGcMs61XSfAOZ6AzXHfNBZDun3Wim7 W7AXvbJExmb4SFJ7sO2ppJYLUah0WuWO5Q4xa7F+StDkvSbhnJ0/u6fA2yoF+S03JBcY D/Z9PLjzvPi4zN6zYry5yls+Qi+8JVb4URPEDb5ubRFgfH61OkKNEB8IFynt240VWCs8 P3baW6mz9CzdxILC0293/XCGLJNMms4ioOfZFzRQFNhyzZ0uVGCQ9lNgjJT3DoRqKZlr IKZQ== 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=17EnV3gk+IfUd90qfhDUlxWLh79xbmrpJNjQLccBlTA=; fh=b+GcvI4Pcayc3mqYGvUYD/O2AEP50jeeZwnwIXNAGVQ=; b=YG/JlllH6JqiTafFhZmXoR4TX29/CJIgHIAZ940LM/hI30104IzHhsMvWjkH0VdfQO XFndxdUe1vN7DafV2jj9Q1oRqwUfJJwCj7Q6CdrmXE6rFVJE7J0n5iTtSXyV4Kl78fGy +8uRSCMY7LAjSiXCMQ4GIyFf8KB4pCyktcUqc9G+m4DOCfSX5XReyMfyDYC44qF7Ve2J MKRuT8eFuVpMnVjcre2JbFX6hK+yMnu+CFpnRRvQ357we1tG8BFzS7uNw7qkinznocrL kzd/c2eHXkvic8LmLng1cpXbnBxkI6x/mGJfRsolyo7b0M9f0LXVuO3L1+ikTixr7Dht B/yA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W0tNkTZ7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-205892-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205892-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7d6608si28956095ad.304.2024.06.07.04.21.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 04:21:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205892-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W0tNkTZ7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-205892-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205892-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 92ED4B21AD8 for ; Fri, 7 Jun 2024 11:20:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88172194AC2; Fri, 7 Jun 2024 11:17:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W0tNkTZ7" 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 B6ED3194A66 for ; Fri, 7 Jun 2024 11:17:21 +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=1717759041; cv=none; b=f6ec+Z0vG7sXmtA55lMbkbQj/pYgkDY0+Jj+LM0AN2fLw3AZlqVkjwbWZKHGRswVbs0t784RnihaIxpGqYxJLfm9s+Fz0L7bist+GxLpmqZCimSbWgRioYhfM2wQp7Lg2ODlZOFL/ba1UPwl17icHrDH01rPjnrlJvp35c0thV0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717759041; c=relaxed/simple; bh=oymOvMLk8fkLJdktfsSVSNeV3MCBYDn9eT/+zmcMkd0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JE3468yoH/+DcN2j6q+NklHUYptIKbEwpje8HAm20sTBzYB7DA+MTIAnLxOluJFmZObkDiAKbF7d59QOOq7LxryLrAiK7wTXJcXJZh9jePZW1jWW8iGTuM0q4wpZpVioDY8u2S5ZdP9VUw10XpNPhd6kQfm9E22z4xQjodt+w60= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W0tNkTZ7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDA41C32786; Fri, 7 Jun 2024 11:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717759041; bh=oymOvMLk8fkLJdktfsSVSNeV3MCBYDn9eT/+zmcMkd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W0tNkTZ7XozcsyWrqWqZqtNrsfPEsBCCzIfKyMYNGODHCB1XD/XGDKn8ks6dRXEne ZjQDNb8roBZsoK9ch2KI+dnYwdUBiHnFxpwb5r0ZWL2Xns5GNFZdlOYIEJYHHeyKYE L2e3xTewGEAUDLOyUaYgA2VzTca0BFNPMsGwQj0N2ZbtmNqacA2YRsCY7OqUGWtwG6 dZigM2VwRoiqM7PwIXKRGZrJIDTBiA6OQ0+ztbqk9BU2P0wLzpacgiR1Vb10B5aGVe 5WOdJcRyKchaPBAtYrNID00K/8SelYMB2OVNoY/PDy36ofdJuC55mEN85g4szQCp9h qiZTxkd7QkZQA== From: Borislav Petkov To: X86 ML Cc: LKML , "Borislav Petkov (AMD)" Subject: [PATCH v1 11/14] x86/alternative: Convert the asm ALTERNATIVE() macro Date: Fri, 7 Jun 2024 13:16:58 +0200 Message-ID: <20240607111701.8366-12-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 | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index fba12ad237e2..31b9a47b9df9 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -422,24 +422,6 @@ void nop_func(void); * @newinstr. ".skip" directive takes care of proper instruction padding * in case @newinstr is longer than @oldinstr. */ -.macro ALTERNATIVE oldinstr, newinstr, ft_flags -140: - \oldinstr -141: - .skip -(((144f-143f)-(141b-140b)) > 0) * ((144f-143f)-(141b-140b)),0x90 -142: - - .pushsection .altinstructions,"a" - altinstr_entry 140b,143f,\ft_flags,142b-140b,144f-143f - .popsection - - .pushsection .altinstr_replacement,"ax" -143: - \newinstr -144: - .popsection -.endm - #define __N_ALTERNATIVE(oldinst, newinst, flag) \ 740: \ oldinst ; \ @@ -455,12 +437,10 @@ void nop_func(void); 744: \ .popsection ; - -.macro N_ALTERNATIVE oldinstr, newinstr, ft_flags +.macro ALTERNATIVE oldinstr, newinstr, ft_flags __N_ALTERNATIVE(\oldinstr, \newinstr, \ft_flags) .endm - #define old_len 141b-140b #define new_len1 144f-143f #define new_len2 145f-144f -- 2.43.0