From nobody Fri Dec 19 04:02:00 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 E49FA235362; Wed, 26 Feb 2025 12:04:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740571493; cv=none; b=ZEtLgDRzHp+mwvHUwcqUXLyVRRNUQQjPboMAcF229rjTE1894JOJ1+9Tjrcatqrgbdf2QsxBO8t/eVuKyfx2CLFIslGLMX3to8gqyJPbpxi9Vpydbt6gpg4UiYZTzXd7g0gEQn2n5x3pw5FS8bEGn7cp1PSH7ZxxCvZuRqOsHJI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740571493; c=relaxed/simple; bh=7u7qDL3AUV9lFZYDf96IH+Z08ePa3apNnD6Ysrdoh+s=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=DZtWUUTM3Hl0N86CRJMiWWV70R9tD8wy4Zm4Z9jmbuOfMcnU6BMJ7IMyJE5OuZT05yANtQrZ6YBiXKgjGNkPjGVV9RJOQd+INjeptaOYYaJVbGQZ4EG9eH4jJ+CK+82yVwNOYiTbegoJRzIS/6E2zqIj9FPz6ikFPYbyAlMhemA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RK4eXwr0; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=xBmKh/Jp; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RK4eXwr0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xBmKh/Jp" Date: Wed, 26 Feb 2025 12:04:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1740571489; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lw3USrelmIzSzZwwAkW0i93TZR9Xx5/67/Wm2JJHPFQ=; b=RK4eXwr018+9efhqKe+v9PokP+wt0OMI5e6V0P9g6HnOrSE2EIiv5W0eBKzR99STMzk3ye wp0BBjgKw/JNaaQylwkt23zTG0hHRjvtKiuhr1t9lu0EX6Q3XuFcEGB8bMvEgsxJqsrY1Q VCp5cN/NMyzJqbzH4CXJfKvS6/3L4AE1e5tn4F4UAxrO/dwgAwmvVFZWpMHThp/6l5kL4u 9BVHwt3dyijctI/c5SrjTr3IHfbvcQesEhWThQbSeNSBCwLnSwW7bEH5kVEBJ8x2gONejH UyICAcYxRDLA0EH26pmbpYbsXRcTgjVSOOBdqC3hXDDY1GZJfjcrDMhYJxOmdQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1740571489; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lw3USrelmIzSzZwwAkW0i93TZR9Xx5/67/Wm2JJHPFQ=; b=xBmKh/JptEbhQqERWOKtKnBJcaN8vym5Z4Sl6LIuHlJSs5nfy0Hr6azEKshtYkgg4WpfBX DYruy6Yb2fRA6aAQ== From: "tip-bot2 for Ingo Molnar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/core] x86/alternatives: Clean up preprocessor conditional block comments Cc: Ingo Molnar , linux-kernel@vger.kernel.org, "Peter Zijlstra (Intel)" , x86@kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <174057148849.10177.13934770176706315375.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/core branch of tip: Commit-ID: 5d703825fde301677e8a79b0738927490407f435 Gitweb: https://git.kernel.org/tip/5d703825fde301677e8a79b0738927490= 407f435 Author: Ingo Molnar AuthorDate: Wed, 26 Feb 2025 12:15:15 +01:00 Committer: Ingo Molnar CommitterDate: Wed, 26 Feb 2025 12:15:15 +01:00 x86/alternatives: Clean up preprocessor conditional block comments When in the middle of a kernel source code file a kernel developer sees a lone #else or #endif: ... #else ... It's not obvious at a glance what those preprocessor blocks are conditional on, if the starting #ifdef is outside visible range. So apply the standard pattern we use in such cases elsewhere in the kernel for large preprocessor blocks: #ifdef CONFIG_XXX ... ... ... #endif /* CONFIG_XXX */ ... #ifdef CONFIG_XXX ... ... ... #else /* !CONFIG_XXX: */ ... ... ... #endif /* !CONFIG_XXX */ ( Note that in the #else case we use the /* !CONFIG_XXX */ marker in the final #endif, not /* CONFIG_XXX */, which serves as an easy visual marker to differentiate #else or #elif related #endif closures from singular #ifdef/#endif blocks. ) Also clean up __CFI_DEFAULT definition with a bit more vertical alignment applied, and a pointless tab converted to the standard space we use in such definitions. Signed-off-by: Ingo Molnar Cc: linux-kernel@vger.kernel.org Cc: Peter Zijlstra (Intel) --- arch/x86/kernel/alternative.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 83316ea..ea68f0e 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -839,16 +839,16 @@ void __init_or_module noinline apply_returns(s32 *sta= rt, s32 *end) } } } -#else +#else /* !CONFIG_MITIGATION_RETHUNK: */ void __init_or_module noinline apply_returns(s32 *start, s32 *end) { } -#endif /* CONFIG_MITIGATION_RETHUNK */ +#endif /* !CONFIG_MITIGATION_RETHUNK */ =20 #else /* !CONFIG_MITIGATION_RETPOLINE || !CONFIG_OBJTOOL */ =20 void __init_or_module noinline apply_retpolines(s32 *start, s32 *end) { } void __init_or_module noinline apply_returns(s32 *start, s32 *end) { } =20 -#endif /* CONFIG_MITIGATION_RETPOLINE && CONFIG_OBJTOOL */ +#endif /* !CONFIG_MITIGATION_RETPOLINE || !CONFIG_OBJTOOL */ =20 #ifdef CONFIG_X86_KERNEL_IBT =20 @@ -916,18 +916,18 @@ void __init_or_module noinline apply_seal_endbr(s32 *= start, s32 *end) } } =20 -#else +#else /* !CONFIG_X86_KERNEL_IBT: */ =20 void __init_or_module apply_seal_endbr(s32 *start, s32 *end) { } =20 -#endif /* CONFIG_X86_KERNEL_IBT */ +#endif /* !CONFIG_X86_KERNEL_IBT */ =20 #ifdef CONFIG_CFI_AUTO_DEFAULT -#define __CFI_DEFAULT CFI_AUTO +# define __CFI_DEFAULT CFI_AUTO #elif defined(CONFIG_CFI_CLANG) -#define __CFI_DEFAULT CFI_KCFI +# define __CFI_DEFAULT CFI_KCFI #else -#define __CFI_DEFAULT CFI_OFF +# define __CFI_DEFAULT CFI_OFF #endif =20 enum cfi_mode cfi_mode __ro_after_init =3D __CFI_DEFAULT; @@ -1457,7 +1457,7 @@ Efault: return false; } =20 -#else +#else /* !CONFIG_FINEIBT: */ =20 static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline, s32 *start_cfi, s32 *end_cfi, bool builtin) @@ -1468,7 +1468,7 @@ static void __apply_fineibt(s32 *start_retpoline, s32= *end_retpoline, static void poison_cfi(void *addr) { } #endif =20 -#endif +#endif /* !CONFIG_FINEIBT */ =20 void apply_fineibt(s32 *start_retpoline, s32 *end_retpoline, s32 *start_cfi, s32 *end_cfi)