Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp963376lqt; Fri, 7 Jun 2024 04:18:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6qCLWc5Ch9d3BHcsle3wjFU9ay4rXihNsrS+0BS73TY3lZ4grjnE6/C4TW52wMfo9JWT/plRsA2KjCktjKO7xIG1jH3L9uv8ad61gyA== X-Google-Smtp-Source: AGHT+IH06mk8qOqoONVW1ewP2YlwNb36+f4jEmVZ99KuZyYjLtTDNxlZwIfo9BnTxOjEcVBy7zkE X-Received: by 2002:a81:9190:0:b0:61b:b41:cadb with SMTP id 00721157ae682-62cd56531d7mr18922727b3.41.1717759104347; Fri, 07 Jun 2024 04:18:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717759104; cv=pass; d=google.com; s=arc-20160816; b=FOCFySNPZd2RVJexDB1j5AE7dwKEMPrNibmw2rjm7CM5niXg72O8Csf7e7JKh683gB SNc4uRJqWGA5/el9ECAJtW3C+g1Y9oRnpukLsjPQ/xeL2b9Gn0O0v+UQN+rtjPIZuN3/ d30Dexl0p7UHMRm4mhQ2kQTO9H592gPW+BJKP9+vV3/7CXYfyVUFKulpyij+x8W+lVIZ 3wZ2nCKeLM32dvd5uozOToXJvpSd6A0OxYtWYAbRCteCoACn7Tn/EOP6tH2AvGPM2weg rbQ1vjtH7Va1LlfUtvbBuWNpzciJ7i5/XZB9obTHUiYKNZh0Yn2VfWNxJG2I+qsvLSJ+ rRlw== 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=WAvbTz06HU13osJQ3jQ/83zNeF33nUNh8sXWgymHQU8=; fh=b+GcvI4Pcayc3mqYGvUYD/O2AEP50jeeZwnwIXNAGVQ=; b=aTWNEbS9lJv71p0xU1aNiu8EtzrxkEF1KnU/eYAQSWVRvbnOukZS93qBvevwkcJH8R t30Bve1kCgLqydJ59nJSl+2tI5vYLU4Y2doPHzd8+Ew0UmmPTd/Py+XoqOi0NcymXYxb zOyGDNePvPbcl0oZeO4kgICi4324t2yESv6wT49GZ3sxgj1ZMnS4oFxA63T37jUynh1a T46mwnwJ4Xh7i5ZGmek53ij4LY18sqimoX0OG8FbgQC71hJtqdI+gFL81tCiyzTh9mkH EfEtGi38M3G5eG9B0bapqm8TgCN1U74LHzgKCnPeLXymZn2g2ru9cKSX1trPcGLaClEV c6BQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QPLRjesl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-205884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205884-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-6b04fa4704fsi37682606d6.601.2024.06.07.04.18.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 04:18:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205884-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=QPLRjesl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-205884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205884-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 BBB111C22111 for ; Fri, 7 Jun 2024 11:18:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39FBF190677; Fri, 7 Jun 2024 11:17:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QPLRjesl" 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 61384190463 for ; Fri, 7 Jun 2024 11:17:11 +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=1717759031; cv=none; b=sF5N7zzBfRJI+gON9fGcmUQiXnFofflHsp3hfcUSJ+rqTcV4i9xIH3aniqUm+HkLwP5qrls+P8psXjnGFW+dddb0doCEY+ZnIk28yR7YuQtivWtTmVwFGFv8d1enlVSpnMgxZ2Dwd0GnkcvcRX4oD1iaw4pqF09X7HPAeQOIwLM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717759031; c=relaxed/simple; bh=vziuIUlIcL3EGLmUnsFyHCZrIa0y4BZwVvEBzkBn1Og=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CWYWoPoaOrvWaOuW6vt3zedDpV2NFmUUabea3868Mc/5sPQyRUtS2iy6rrJuAZ/GYcnB932oTuYX4kzEQAGrQcng+uGyWyaDB/4LIOa3nTanWg3EOfegjMvmiAsk+kmt3Cyt3PG3r31UicYw0aPfQpPLT3swF5exmmNsZuDO80k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QPLRjesl; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68C26C32781; Fri, 7 Jun 2024 11:17:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717759031; bh=vziuIUlIcL3EGLmUnsFyHCZrIa0y4BZwVvEBzkBn1Og=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QPLRjeslzhWdmICfKo0WrcZj8hxdiWojzbiKznAwLYS1YX05UkRQ5PtuX+Of5Gq+C 4SoQ5RmGpeupqgybdJEBUANYRMfbQwyV53PAr5KuLkmH4IrDs4BDLf0olTHbL0G/fZ qU44LTOzZBp59hZvmXBC1ODCGWYZ9eun8/zcVIUj1iyAjDJf1lhAhk4zMWLaJRVn7l Uqq43iUrLaJyinVTRHJs0IdyolbVcIkXUSThuiokbEvYz1hhkF1uwTDg7VHWLPr8ki PpnZDxyERGfLyFFHLsd44rlDmAvd9J1wv9uWssJIMuc7PniWieVrwmcp4nWgtNm7i8 P98o6Q7u6k7Fg== From: Borislav Petkov To: X86 ML Cc: LKML , "Borislav Petkov (AMD)" Subject: [PATCH v1 03/14] x86/alternative: Convert alternative() Date: Fri, 7 Jun 2024 13:16:50 +0200 Message-ID: <20240607111701.8366-4-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)" Split conversion deliberately into minimal pieces to ease bisection because debugging alternatives is a nightmare. Signed-off-by: Borislav Petkov (AMD) --- arch/x86/include/asm/alternative.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index 7d9ebc516bde..c05bff2e3626 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -316,14 +316,11 @@ static inline int alternatives_text_reserved(void *start, void *end) * without volatile and memory clobber. */ #define alternative(oldinstr, newinstr, ft_flags) \ - asm_inline volatile (ALTERNATIVE(oldinstr, newinstr, ft_flags) : : : "memory") + asm_inline volatile(N_ALTERNATIVE(oldinstr, newinstr, ft_flags) : : : "memory") #define alternative_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2) \ asm_inline volatile(ALTERNATIVE_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2) ::: "memory") -#define n_alternative(oldinstr, newinstr, ft_flags) \ - asm_inline volatile (N_ALTERNATIVE(oldinstr, newinstr, ft_flags) : : : "memory") - #define n_alternative_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2) \ asm_inline volatile(N_ALTERNATIVE_2(oldinstr, newinstr1, ft_flags1, newinstr2, ft_flags2) ::: "memory") -- 2.43.0