Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp964232lqt; Fri, 7 Jun 2024 04:20:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTdMr9aGeVZJMvCAcbVMWqBRjGsXJ1yu9vbvO7IbHgUNYxSsrEx/PAgoPT7+B28YKPhwT0ZgjIxSC4sXictrNG+mAy9bnT1Wq3Exbhmw== X-Google-Smtp-Source: AGHT+IFLuVAG2YLoq1n2Advkh32CY4TwvhxxdJb1Nry1j92zLbikjbO+9vrQozb46AMhowtqfYe0 X-Received: by 2002:a2e:be9a:0:b0:2ea:8263:f0d8 with SMTP id 38308e7fff4ca-2eadce37800mr18347431fa.28.1717759214648; Fri, 07 Jun 2024 04:20:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717759214; cv=pass; d=google.com; s=arc-20160816; b=Yp3oOkEMIFqijfZQwVtq3s+Z8Ve5pKySZgqld+6kacmYxVkbesjJ2UzGvoppwehyHT 6YeitehoX+bf6OVfv4pyahnS04r5pKLyHXXJidzpnc080Qv9ZADG6eykPprtHuwV9331 QX3tabo2+PPdYFiIkhjAJ5DAzpSXS3sFnkNkDTUTbm3rBrd/Zwf/j4ovRiASJH67t+Db HeGznxlVru3dr4F4+R746oWrdAplWZKh9B3zPajQC50I+POq6I3xd6+PLSyGidTpFm/M N7YlkDg25WhV8Z+zd4BWhV1Kvpg/2CGgb+8FvnmygafsSejr5H7B12HqcUbkM33S6Fej /yVQ== 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=QRyJqIt5/gLzDMRVZV2/0Y0IXKmyAB9eEx2OIDq1zZ0=; fh=b+GcvI4Pcayc3mqYGvUYD/O2AEP50jeeZwnwIXNAGVQ=; b=VsdQoPcg8UVkXKG2R8AT8pwJcUxh7eVbJ5Db5Kf5t2Rdn4c9GgBaOXneS+wmlQlF1v J1ZLvNW/58UMeRpzTWU3sm2cD2BJz0E45PmL6mZVJAm7k/aJ09HH1I8NFJP7v94VBSQ/ jQsojP91uBQzm9LypaVFORS1+QDxvntwU89OFEfG4R1DXLLopTawi06D6UAeVdAEJrhY Vm2ckWlvv+SKS29F/GE3YtwOE5Em8mbqI1XM8SeW36/5wWNt4A/PFkWIgMEXsIuSP743 ry3C5o7Wys1BjGl4+HOnhOaQZ6CDNdEWBy4ryjDPCeDowsKREMb6GFF+MkRQKuCEFkDG Js1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="N0dr1a/z"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-205893-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205893-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c5722599esi533998a12.565.2024.06.07.04.20.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 04:20:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205893-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="N0dr1a/z"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-205893-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205893-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4F25D1F21224 for ; Fri, 7 Jun 2024 11:20:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4BDA194A6B; Fri, 7 Jun 2024 11:17:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N0dr1a/z" 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 0E5DD194ACE for ; Fri, 7 Jun 2024 11:17:23 +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=1717759043; cv=none; b=RwHoGA4S1EuQjnXv6wfQLem2TolBUP9B9LgExtc5lZgXT+Lext4fIWn3SNemxbaXSNyxCdisd5xG7Cuq+eXDSjg8U/HcchbzStALYrFOXJg/R6Emm5FMlwb3tbyPc83aqgbgbgjB67wFlfF10rn2UgvS3KqBu18K/LwS7+87o/U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717759043; c=relaxed/simple; bh=mpY13cDkkhjPXE7HFQg9dp0vJygGBsKGCPtYHRFiDNg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cDMrcGYgVsCOQ/t/K4T5OO/cxP+OBk7ZoPwhTMAlSw6aWVXbkqFvqXP0C6y7J+qj0nLbcxhR4+usDYoP0QFkYwoO0zZQmxSF4nDEHQ7Wjos0KRQHiXrvSFfRU6hkqtf7W/qbL7apussyNuYpieyYKn3QllOgymtB7qjeE5HE2Yw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N0dr1a/z; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11108C32781; Fri, 7 Jun 2024 11:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717759042; bh=mpY13cDkkhjPXE7HFQg9dp0vJygGBsKGCPtYHRFiDNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N0dr1a/zUT0YJDJx7FZ8xtqt506EpZ5LgYMjavemuBY96qINCnQ1lYCnNtplv9pt+ FARGAMMCoAIb8o/Ei8LZ4KxSlZZqkYYvvY1ytzuadGr28pWygQ/yrzkKHUf5liDPPC S7Sm0H73qxqpA1lmtUWytKZnq3reKrlPVsVRhxSDLNGgL3WnjY5ED4NXifaXq1z9aA 4122btdhG1ig+qm4EpWZPP+FcR0Io1DHoDrYrBtnAVZ/rbiqpnkXs79IRNdYgaWhQP Nfk8HAa6fNm5YWKdW7pRvw8KbpBZ1ssQ6/pq/JOEuQ55UyJ00dMLv6bON0LQees03e hX1afN9dYZ+4w== From: Borislav Petkov To: X86 ML Cc: LKML , "Borislav Petkov (AMD)" Subject: [PATCH v1 12/14] x86/alternative: Convert the asm ALTERNATIVE_2() macro Date: Fri, 7 Jun 2024 13:16:59 +0200 Message-ID: <20240607111701.8366-13-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, 22 deletions(-) diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index 31b9a47b9df9..28e07a038964 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -461,28 +461,6 @@ void nop_func(void); * @feature2, it replaces @oldinstr with @feature2. */ .macro ALTERNATIVE_2 oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2 -140: - \oldinstr -141: - .skip -((alt_max_2(new_len1, new_len2) - (old_len)) > 0) * \ - (alt_max_2(new_len1, new_len2) - (old_len)),0x90 -142: - - .pushsection .altinstructions,"a" - altinstr_entry 140b,143f,\ft_flags1,142b-140b,144f-143f - altinstr_entry 140b,144f,\ft_flags2,142b-140b,145f-144f - .popsection - - .pushsection .altinstr_replacement,"ax" -143: - \newinstr1 -144: - \newinstr2 -145: - .popsection -.endm - -.macro N_ALTERNATIVE_2 oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2 __N_ALTERNATIVE(__N_ALTERNATIVE(\oldinstr, \newinstr1, \ft_flags1), \newinstr2, \ft_flags2) .endm -- 2.43.0