From: Borislav Petkov <bp@suse.de>
To: speck@linutronix.de
Subject: [MODERATED] Re: [PATCH v5 07/11] [PATCH v5 07/10] Linux Patch #7
Date: Thu, 26 Apr 2018 14:50:46 +0200 [thread overview]
Message-ID: <20180426125046.GI15043@pd.tnic> (raw)
In-Reply-To: <20180426020546.201159727@localhost.localdomain>
On Wed, Apr 25, 2018 at 10:04:22PM -0400, speck for konrad.wilk_at_oracle.com wrote:
> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index dff706bba3aa..99cdd44c20bc 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -37,8 +37,6 @@ u64 __read_mostly x86_spec_ctrl_base;
>
> void __init check_bugs(void)
> {
> - identify_boot_cpu();
> -
> /*
> * Read the SPEC_CTRL MSR to account for reserved bits which may have
> * unknown values.
This hunk breaks on AMD because after it I see in dmesg:
[ 0.038706] Spectre V2 : Spectre mitigation: LFENCE not serializing, switching to generic retpoline
instead of
[ 0.049074] Spectre V2 : Mitigation: Full AMD retpoline
because the making LFENCE serializable bit is done in init_amd().
IOW, you need to have the following calling order:
ssb_select_mitigation
identify_boot_cpu
spectre_v2_select_mitigation
Hunk ontop:
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 289eefd6c67e..7f105f3d195a 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -50,9 +50,6 @@ void __init check_bugs(void)
if (boot_cpu_has(X86_FEATURE_IBRS))
rdmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base);
- /* Select the proper spectre mitigation before patching alternatives */
- spectre_v2_select_mitigation();
-
/*
* Select proper mitigation for any exposure to the Speculative Store
* Bypass vulnerability.
@@ -60,11 +57,14 @@ void __init check_bugs(void)
ssb_select_mitigation();
/*
- * Need to do this _after_ spec_store_bypass_select_mitigation to
- * figure if any mitigation should be latched.
+ * Need to do this _after_ ssb_select_mitigation() to figure if any
+ * mitigation should be latched.
*/
identify_boot_cpu();
+ /* Select the proper spectre mitigation before patching alternatives */
+ spectre_v2_select_mitigation();
+
if (!IS_ENABLED(CONFIG_SMP)) {
pr_info("CPU: ");
print_cpu_info(&boot_cpu_data);
--
Regards/Gruss,
Boris.
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--
prev parent reply other threads:[~2018-04-26 12:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-26 2:04 [MODERATED] [PATCH v5 07/11] [PATCH v5 07/10] Linux Patch #7 konrad.wilk
2018-04-26 10:35 ` [MODERATED] " Borislav Petkov
2018-04-26 12:50 ` Borislav Petkov [this message]
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=20180426125046.GI15043@pd.tnic \
--to=bp@suse.de \
--cc=speck@linutronix.de \
/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.