Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp416956lqh; Fri, 31 May 2024 05:38:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUcuV6z5t32kbZ4Jel5U3s477LJerc57y60ACzFt7eP+arDX2e8mF5eoyNb63NWNu72jjcRIzuZz4SMnK0yu246lEWi0j8F+lww5hxOmw== X-Google-Smtp-Source: AGHT+IHc6n5gw07qH4GwKwzgN/v5smbyb3deyOO+bu74ydACLi/oLIrF1R1K9scZ9IqgCEhNYBZc X-Received: by 2002:a05:622a:1390:b0:439:8741:5208 with SMTP id d75a77b69052e-43ff524b62emr17038131cf.23.1717159108986; Fri, 31 May 2024 05:38:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717159108; cv=pass; d=google.com; s=arc-20160816; b=et6v/DT0MIbnG77bMAUDvMs3J532/G2bSuWnujjrXxWiIEpSuADPl5tHVOrIlErcD5 NMHzhbV80pxycA0wVe0YzrPRMrgZFyFe92Gvd5vQtaLmmkgUsnkRsA4eozzmTNQi01T5 gdPnuuD8ObTo2HWuB66IvmmPimAAgLLT08EPOyULW5FV42IAayBoNNkkoba5gBUQOLQF 3j+Y7aOi+ZVCFuhUebn9f9x76ID0L0wHhjkg04aqp5dDDinZJCZ2yTcui1ppYaWi/n61 I0AHJbeTryYd7L3JPeRealmmaR+Ff3Us2ydMB3bDBSMDQp6AtvMvcwl3CCXCoqYeA2o4 lriw== 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=JZgqf1MkoSl0Dylm0RYLscFweqshuPlYSbTexwxDFJA=; fh=b+GcvI4Pcayc3mqYGvUYD/O2AEP50jeeZwnwIXNAGVQ=; b=kkxxGW3AGIftmO/z9kxJj4kp9Ha4JC5Hlf4e0tCd0/TGFYSifR7Kwy0GNoDy4FJFfV VbTtJImAYuGtXAtjCg/ForST6it4KYNU+OQRI8j25AoFI/X8tMXBW7FouZz0mS6ck49/ eJuy8xqBg6kpoRmX611P6Iv5iY719pEnkBXVDP+r+o46vqO6BpltraFgGFrW3d5R6tRQ QxQctXVgREeb+joYUcwUwPFfx5K4X6oy0OJD04/AiQgLmK+TlBuKwVMhem+8hLTvJi4S kjmgfpxNBHu0Q/FJXX+/wZZm1Fk2lzBm1s+Rre9lJy+zNM9S5ueX0vjfUcCEi40VCpHR z/fw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E4UYdC5A; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-196797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196797-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43ff23ac6a0si19501501cf.47.2024.05.31.05.38.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 05:38:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E4UYdC5A; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-196797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196797-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 A5A731C24EEC for ; Fri, 31 May 2024 12:38:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF355176AD0; Fri, 31 May 2024 12:35:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E4UYdC5A" 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 0837A17625F for ; Fri, 31 May 2024 12:35:30 +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=1717158930; cv=none; b=F4Z3mstf4Ln+Y2sNH7pq6ToX1iQdQb1sgv7XMU7dLYT522wwZduiBbHkX6CbT/USrx89uD4OXxH7NyDbD7uxZiboH6L440BcPZH45Xpu8ERDkZ21FltJJlbi7Z3EKRclu6/Mp0ULEQ5GUGpelR/Q4JfSJSnS+/bHN4Xgj2RjQ6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717158930; c=relaxed/simple; bh=fX9zdFndNsZ6Oozx6KKrax/RedQUUs+v/vZeMTOCjCg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ON+RAYnvD7iTp2eEJT0/kgkRVG4MljzPV//AdODb2qzXVzRH+DbfP0yUuvT9SWNp1dKnF5UMByL3qYe8gZUHRcsv1nl8bWJZRsfFOPhFPitF/e/UQqkBGgsaNbJMioTMkm66eKn8q2P1C0GyBn5sFEmGgcrsoIfMIkgZKiNhob8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E4UYdC5A; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 158A2C32781; Fri, 31 May 2024 12:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717158929; bh=fX9zdFndNsZ6Oozx6KKrax/RedQUUs+v/vZeMTOCjCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E4UYdC5AAMlep3YEpHUIQzMelPybpqMLrdL6Ux1LTCiQFYlcJr40cZJ43JcrIZJkZ VE4BxD7MpWswtCIk8UC+jyzM5FAF4uwjpheHf9ndOCKmV0KCW0nb9zG2j69D0Jfh1c kmJk1tN1qZymULInPejRWQnX4AblcoNxT/mq+wmLW46GRGbwg96smBV2OVGr2LRZXO FzkIO33nGKcQE41nD/RrUkfObkL2TK/yEKorNDSQgFop7MCPA16kbM/aBXJYAx0ma4 r32Tjz79pr0uPc6r2mu69SebjghIAspBEUBW7p1vnjdV0BTAulxJYgSGKA+T+Vw8Fm VN8cn7I+jSiRg== From: Borislav Petkov To: X86 ML Cc: LKML , "Borislav Petkov (AMD)" Subject: [PATCH 11/14] x86/alternative: Convert the asm ALTERNATIVE() macro Date: Fri, 31 May 2024 14:35:08 +0200 Message-ID: <20240531123512.21427-12-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 | 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 0df99855e003..4b17267f3f2f 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -413,24 +413,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 ; \ @@ -446,12 +428,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