All of lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: jpoimboe@kernel.org, mingo@redhat.com, tglx@linutronix.de,
	bp@alien8.de, Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jason Baron <jbaron@akamai.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Nicolas Schier <nicolas@fjasle.eu>,
	leit@meta.com, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@kernel.org>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	Sven Joachim <svenjoac@gmx.de>, Ian Kent <raven@themaw.net>,
	Yu-cheng Yu <yu-cheng.yu@intel.com>,
	Kees Cook <keescook@chromium.org>,
	Rick Edgecombe <rick.p.edgecombe@intel.com>,
	Kim Phillips <kim.phillips@amd.com>,
	Juergen Gross <jgross@suse.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Jinghao Jia <jinghao@linux.ibm.com>,
	Vincent Whitchurch <vincent.whitchurch@axis.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH v6 10/13] x86/bugs: Rename RETHUNK to MITIGATION_RETHUNK
Date: Wed, 22 Nov 2023 07:54:11 -0800	[thread overview]
Message-ID: <ZV4kI2mu6fBVcZn9@gmail.com> (raw)
In-Reply-To: <da12ea3e-8fef-49d4-aea1-40a46a5ae056@citrix.com>

Hello Andrew,

On Tue, Nov 21, 2023 at 09:39:47PM +0000, Andrew Cooper wrote:
> On 21/11/2023 4:07 pm, Breno Leitao wrote:
> > CPU mitigations config entries are inconsistent, and names are hard to
> > related. There are concrete benefits for both users and developers of
> > having all the mitigation config options living in the same config
> > namespace.
> >
> > The mitigation options should have consistency and start with
> > MITIGATION.
> >
> > Rename the Kconfig entry from RETHUNK to MITIGATION_RETHUNK.
> >
> > Suggested-by: Josh Poimboeuf <jpoimboe@kernel.org>
> > Signed-off-by: Breno Leitao <leitao@debian.org>
> 
> (I'm CC'd on only this single patch so I can't see what's going on, but)
> 
> Really?  Rethunk[sic] isn't a mitigation.  It's just a compiler
> transformation for return instructions upon which various mitigations
> depend.

The MITIGATION namespace is not only for mitigation, but, for "features"
that are available with the only purpose of mitigating speculative
hardware vulnerability. The original suggested namespace was "MITIGATE",
and then it would make no sense for RETHUNK, since, we are not
mitigating RETHUNK per se. Please check the discussion here:

 https://lore.kernel.org/all/20231011044252.42bplzjsam3qsasz@treble/

That said, the way the x86 Kconfig is organized today, CONFIG_RETHUNK is
very focused in solving a mitigations problem, thus, the MITIGATION_
namespace has been added to it.

For instance, CONFIG_RETHUNK is inside the SPECULATION_MITIGATIONS,
thus, it is only enabled if SPECULATION_MITIGATIONS is set.

  menuconfig SPECULATION_MITIGATIONS
  bool "Mitigations for speculative execution vulnerabilities"

	config RETHUNK
		bool "Enable return-thunks"
		depends on MITIGATION_RETPOLINE && CC_HAS_RETURN_THUNK
		help
		  Compile the kernel with the return-thunks compiler option to guard
		  against kernel-to-user data leaks by avoiding return speculation.
		  Requires a compiler with -mfunction-return=thunk-extern
		  support for full protection. The kernel may run slower.

  endif

Thanks for the feedback.

  reply	other threads:[~2023-11-22 15:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 16:07 [PATCH v6 00/13] x86/bugs: Add a separate config for each mitigation Breno Leitao
2023-11-21 16:07 ` [PATCH v6 01/13] x86/bugs: Rename GDS_FORCE_MITIGATION to MITIGATION_GDS_FORCE Breno Leitao
2024-01-10 10:09   ` [tip: x86/bugs] x86/bugs: Rename CONFIG_GDS_FORCE_MITIGATION => CONFIG_MITIGATION_GDS_FORCE tip-bot2 for Breno Leitao
2023-11-21 16:07 ` [PATCH v6 02/13] x86/bugs: Rename CPU_IBPB_ENTRY to MITIGATION_IBPB_ENTRY Breno Leitao
2024-01-10 10:09   ` [tip: x86/bugs] x86/bugs: Rename CONFIG_CPU_IBPB_ENTRY => CONFIG_MITIGATION_IBPB_ENTRY tip-bot2 for Breno Leitao
2023-11-21 16:07 ` [PATCH v6 03/13] x86/bugs: Rename CALL_DEPTH_TRACKING to MITIGATION_CALL_DEPTH_TRACKING Breno Leitao
2024-01-10 10:09   ` [tip: x86/bugs] x86/bugs: Rename CONFIG_CALL_DEPTH_TRACKING => CONFIG_MITIGATION_CALL_DEPTH_TRACKING tip-bot2 for Breno Leitao
2023-11-21 16:07 ` [PATCH v6 04/13] x86/bugs: Rename PAGE_TABLE_ISOLATION to MITIGATION_PAGE_TABLE_ISOLATION Breno Leitao
2024-01-10 10:09   ` [tip: x86/bugs] x86/bugs: Rename CONFIG_PAGE_TABLE_ISOLATION => CONFIG_MITIGATION_PAGE_TABLE_ISOLATION tip-bot2 for Breno Leitao
2023-11-21 16:07 ` [PATCH v6 05/13] x86/bugs: Rename RETPOLINE to MITIGATION_RETPOLINE Breno Leitao
2023-11-22 15:08   ` Ariel Miculas
2024-01-10 10:09   ` [tip: x86/bugs] x86/bugs: Rename CONFIG_RETPOLINE => CONFIG_MITIGATION_RETPOLINE tip-bot2 for Breno Leitao
2023-11-21 16:07 ` [PATCH v6 06/13] x86/bugs: Rename SLS to CONFIG_MITIGATION_SLS Breno Leitao
2024-01-10 10:09   ` [tip: x86/bugs] x86/bugs: Rename CONFIG_SLS => CONFIG_MITIGATION_SLS tip-bot2 for Breno Leitao
2023-11-21 16:07 ` [PATCH v6 07/13] x86/bugs: Rename CPU_UNRET_ENTRY to MITIGATION_UNRET_ENTRY Breno Leitao
2024-01-10 10:09   ` [tip: x86/bugs] x86/bugs: Rename CONFIG_CPU_UNRET_ENTRY => CONFIG_MITIGATION_UNRET_ENTRY tip-bot2 for Breno Leitao
2023-11-21 16:07 ` [PATCH v6 08/13] x86/bugs: Rename CPU_IBRS_ENTRY to MITIGATION_IBRS_ENTRY Breno Leitao
2024-01-10 10:09   ` [tip: x86/bugs] x86/bugs: Rename CONFIG_CPU_IBRS_ENTRY => CONFIG_MITIGATION_IBRS_ENTRY tip-bot2 for Breno Leitao
2023-11-21 16:07 ` [PATCH v6 09/13] x86/bugs: Rename CPU_SRSO to MITIGATION_SRSO Breno Leitao
2024-01-10 10:09   ` [tip: x86/bugs] x86/bugs: Rename CONFIG_CPU_SRSO => CONFIG_MITIGATION_SRSO tip-bot2 for Breno Leitao
2023-11-21 16:07 ` [PATCH v6 10/13] x86/bugs: Rename RETHUNK to MITIGATION_RETHUNK Breno Leitao
2023-11-21 21:39   ` Andrew Cooper
2023-11-22 15:54     ` Breno Leitao [this message]
2024-01-10 10:09   ` [tip: x86/bugs] x86/bugs: Rename CONFIG_RETHUNK => CONFIG_MITIGATION_RETHUNK tip-bot2 for Breno Leitao
2023-11-21 16:07 ` [PATCH v6 11/13] x86/bugs: Create a way to disable GDS mitigation Breno Leitao
2023-11-21 16:07 ` [PATCH v6 12/13] x86/bugs: spectre_v2_user default mode depends on Kconfig Breno Leitao
2023-11-21 16:07 ` [PATCH v6 13/13] x86/bugs: Add a separate config for missing mitigation Breno Leitao
2023-11-29  4:42 ` [PATCH v6 00/13] x86/bugs: Add a separate config for each mitigation Josh Poimboeuf
2024-01-10  9:56 ` Ingo Molnar
2024-01-10 11:55   ` Breno Leitao
2024-01-10 18:07     ` Ingo Molnar
2024-04-30 13:12       ` Breno Leitao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZV4kI2mu6fBVcZn9@gmail.com \
    --to=leitao@debian.org \
    --cc=acme@redhat.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jbaron@akamai.com \
    --cc=jgross@suse.com \
    --cc=jinghao@linux.ibm.com \
    --cc=jpoimboe@kernel.org \
    --cc=keescook@chromium.org \
    --cc=kim.phillips@amd.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=leit@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=masahiroy@kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=peterz@infradead.org \
    --cc=raven@themaw.net \
    --cc=rdunlap@infradead.org \
    --cc=rick.p.edgecombe@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=svenjoac@gmx.de \
    --cc=tglx@linutronix.de \
    --cc=vincent.whitchurch@axis.com \
    --cc=x86@kernel.org \
    --cc=yu-cheng.yu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.