From: Dave Hansen <dave.hansen@intel.com>
To: Jon Kohler <jon@nutanix.com>
Cc: David Woodhouse <dwmw@amazon.co.uk>,
Jiri Kosina <jkosina@suse.cz>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Ravi Shankar <ravi.v.shankar@intel.com>,
Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Tim Chen <tim.c.chen@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Tony Luck <tony.luck@intel.com>,
Anthony Steinhauser <asteinhauser@google.com>,
Mike Rapoport <rppt@kernel.org>,
Anand K Mistry <amistry@google.com>,
Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/bugs: wrap X86_FEATURE_RSB_CTXSW with ifdef CONFIG_RETPOLINE
Date: Fri, 7 May 2021 09:02:11 -0700 [thread overview]
Message-ID: <cd3517fb-06c2-9188-1a03-3848db6aba3e@intel.com> (raw)
In-Reply-To: <20210507155308.97649-1-jon@nutanix.com>
On 5/7/21 8:53 AM, Jon Kohler wrote:
> The only place X86_FEATURE_RSB_CTXSW is currently in use is in
> arch/x86/entry/entry_{32|64}.S, where its use is wrapped with
> ifdef CONFIG_RETPOLINE. If someone uses a system with
> X86_FEATURE_IBRS_ENHANCED and compiles without CONFIG_RETPOLINE
> but still has spectre v2 set to auto, the kernel log will
> print that eIBRS is enabled and that RSB stuffing is enabled;
> however, that stuffing would never occur.
>
> To make this behavior more clear, wrap the enablement of
> X86_FEATURE_RSB_CTXSW and the resulting log message with ifdef
> CONFIG_RETPOLINE, such that it is compiled out along with the
> actions it controls.
>
> This way seems more correct at first glance as this was the way
> the code was originally written in fdf82a7856b; however, when
> enhanced IBRS was added, there was a goto added under
> SPECTRE_V2_CMD_AUTO which bypasses going through retpoline_auto,
> where X86_FEATURE_RETPOLINE is set.
>
> The other option would be to remove the CONFIG_RETPOLINE from
> the code in entry_{32|64}.S, such that it would always be
> compiled no matter what, such that these two areas match.
This kinda dances around the real issue: Does RSB stuffing have
mitigation value on enhanced IBRS systems?
If yes, then we should make the RSB stuffing code in entry*.S available
separately from CONFIG_RETPOLINE.
If no, is it because eIBRS systems are not vulnerable, or because RSB
stuffing has no mitigation value?
Either way, I'm not sure the approach in this patch is the one we want.
next prev parent reply other threads:[~2021-05-07 16:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-07 15:53 [PATCH] x86/bugs: wrap X86_FEATURE_RSB_CTXSW with ifdef CONFIG_RETPOLINE Jon Kohler
2021-05-07 16:02 ` Dave Hansen [this message]
2021-05-07 16:26 ` Jon Kohler
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=cd3517fb-06c2-9188-1a03-3848db6aba3e@intel.com \
--to=dave.hansen@intel.com \
--cc=amistry@google.com \
--cc=asteinhauser@google.com \
--cc=bp@alien8.de \
--cc=dwmw@amazon.co.uk \
--cc=hpa@zytor.com \
--cc=jkosina@suse.cz \
--cc=jon@nutanix.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=ravi.v.shankar@intel.com \
--cc=rppt@kernel.org \
--cc=sai.praneeth.prakhya@intel.com \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@linux.intel.com \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/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.