Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp415564lqh; Fri, 31 May 2024 05:35:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJv/JAaiU9CHRPQF35sXUftf2HgkILEnfbNvUOy+khTuMTt6XzT/RnaV/ykUV8da+lmZxXGZMrGeBBRW/BDO7eKbNT73aDUtGtkVK00A== X-Google-Smtp-Source: AGHT+IHBlN52YEFDQYQ3UGYfBqXvkOYLZ9CDVmWX2Hy0p+Gt2LI8ix10+bh5fslYobCAdkGMhKk+ X-Received: by 2002:a17:902:e890:b0:1f6:2623:7078 with SMTP id d9443c01a7336-1f635993483mr29779755ad.6.1717158949656; Fri, 31 May 2024 05:35:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717158949; cv=pass; d=google.com; s=arc-20160816; b=D9EBrmEz0MfAm4UlbrcmrAmQI1GocEYAv62uymttkwaQIKA5pmO1N2G2BsywIqyiUP h/HLj9tdOJgvu7/omxB0B8GbG+Luh59Zp/B+rZWhCzJCHUkiEt8wRUSvewXB9MUzlPwP RdpFJhYqmgC6/3bTij3jWuq+prI690RINrCkl8ke6Ud9tHOGKAG2QzZqS3z9oz/fT1xs M71ar47ObwOH5fbZIIjAanKid0zDObULf68ytgfFRY9JNjk+GEtBU4M+6mxZpzbEzxi3 4xQULitNOEqOdRO9dx3UxS4liH4fV7BEttUgEk+nYbjJgLmlgFLu6KLF014e6Dysp3fI V6rg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=s87ARb9RguzUFqPQFtrbm+7oqY6yJgDLpkifm259l80=; fh=b+GcvI4Pcayc3mqYGvUYD/O2AEP50jeeZwnwIXNAGVQ=; b=Nqj3lX+K8EZVpFB0lQsBGQRDNuRrXtKoNg3+78e7kxOTer8Tgeob5vwLDtwc145x6s HGox3UvoEJNgMO00RTZ1lzRJ6fvwaXwc/LxeYhdzFOKeRtkbOz7b3bCDtcuSmy/g06eL 4HLk95tRRbNJ6p9MSDJ424rOZHVNaHzqwLXkJiwjnav7RkKe9XkACZ1GDUFQbR7saHEQ G0DAxZ6FlU9RBtYcL8MtTU3p3sQ9qIcVD2hdzJPAAyYxIBkqC54GEKEFzqq97ybLasQs UunMukJL4tkoNVCx0Px6r+0L3K84nLJo0H949l2ZWFaGObhsagQiaUVMlGFelRKc9Fbe UG1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SDt2rPcu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-196786-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196786-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-1f6323f5ef8si15479205ad.435.2024.05.31.05.35.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 05:35:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196786-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=SDt2rPcu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-196786-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196786-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 B5816B2564E for ; Fri, 31 May 2024 12:35:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4851158A17; Fri, 31 May 2024 12:35:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SDt2rPcu" 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 D1E13158A06 for ; Fri, 31 May 2024 12:35:15 +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=1717158915; cv=none; b=Jwm/z5SY2nvAUxUVLlJUipz3qmfR06Rw/udveO65aeEUdU9l0ou36F3bzjAhVOQqe3TBwbMDqUzlZY4bGJ18XF8ZJPlydrKzBthrNstdRWc7f7DCCHbs3uRL65498hYJiMp1An5oK8qAdiBmvo/LLdfqYICy+Cmulis6wHiE/3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717158915; c=relaxed/simple; bh=RMJnFiJ/QSXWNtlgr0UhK+itvTx0Gqfv+NvnGdA3Xb8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CEzuW1am/7O5SKyeNj8YNo8RIfspYKAyq7HRELr1UPffS2ziRrttv7ClZ3barYh30gD7rY0Loiei64pHU94rYE4VIC1x1NBa/57lIs04rmFmxOClYAD+06y6dJmJTU170yhCrWU2IN7gTeMcEGEgDHvRKFEt+iRuJjAmODntLOw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SDt2rPcu; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D37BAC32786; Fri, 31 May 2024 12:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717158915; bh=RMJnFiJ/QSXWNtlgr0UhK+itvTx0Gqfv+NvnGdA3Xb8=; h=From:To:Cc:Subject:Date:From; b=SDt2rPcuGYZmHKJiCePd9ilbZVDNKrluOuTnVKdj1ivjt00H8/MXf7GKEN19Y0Rg7 SUDSwdQbrqnvEFCmCHlv7jI3ghWNd1Ti65/dZCzriImHiL4DWq4WpiO1nsSKDkTxZ0 3rN5w6mGK/GOsRGLERs1fu0fB2SZf89LM9x+gfUyNMHgBSahdDIewI5WKKW7cWFNqH Kv8EHWuZ7PjBGapoWspmav1Q2ur9JKB/PYmGQjLkJ3n5aBuWmkR7NbEPcMDP5uYO2C eQxXqXRRz+GgR5Y45kKpuouhGKWQY6zvcIw6oT+gbkVQDgFQXfYWNhRP0e66vPiIEk +Tu49rGnYlqnA== From: Borislav Petkov To: X86 ML Cc: LKML , "Borislav Petkov (AMD)" Subject: [PATCH 00/14] x86/alternatives: Nest them Date: Fri, 31 May 2024 14:34:57 +0200 Message-ID: <20240531123512.21427-1-bp@kernel.org> X-Mailer: git-send-email 2.43.0 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)" Hi, this is basically peterz's idea to nest the alternative macros with a fix to an issue I encountered while testing. For ease of bisection, the old macros are converted to the new, nested variants in a step-by-step manner so that in case an issue is encountered during testing, one can pinpoint the place where it fails easier. Because debugging alternatives is a serious pain. Testing here on my farm looks good but who knows what happens out there, in the wild. Thx. Borislav Petkov (AMD) (13): x86/alternative: Zap alternative_ternary() x86/alternative: Convert alternative() x86/alternative: Convert alternative_2() x86/alternative: Convert alternative_input() x86/alternative: Convert alternative_io() x86/alternative: Convert alternative_call() x86/alternative: Convert alternative_call_2() x86/alternative: Convert ALTERNATIVE_TERNARY() x86/alternative: Convert ALTERNATIVE_3() x86/alternative: Convert the asm ALTERNATIVE() macro x86/alternative: Convert the asm ALTERNATIVE_2() macro x86/alternative: Convert the asm ALTERNATIVE_3() macro x86/alternative: Replace the old macros Peter Zijlstra (1): x86/alternatives: Add nested alternatives macros arch/x86/include/asm/alternative.h | 214 ++++++++--------------------- arch/x86/kernel/alternative.c | 20 ++- arch/x86/kernel/fpu/xstate.h | 6 +- tools/objtool/arch/x86/special.c | 23 ++++ tools/objtool/special.c | 16 +-- 5 files changed, 113 insertions(+), 166 deletions(-) -- 2.43.0