From: Tim Chen <tim.c.chen@linux.intel.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: [patch V9 00/16] SSB
Date: Tue, 1 May 2018 10:22:38 -0700 [thread overview]
Message-ID: <1f9fea0d-12e9-aa51-717e-72f0203a0aae@linux.intel.com> (raw)
In-Reply-To: <20180501152420.785133537@linutronix.de>
[-- Attachment #1.1: Type: text/plain, Size: 2406 bytes --]
On 05/01/2018 08:24 AM, speck for Thomas Gleixner wrote:
> Changes vs. V8:
>
> Addressed review feed back and added Linus variant of
> alternative_write_msr().
>
> - Use EINVAL in the prctl
>
> - Fix the sbb typos
>
> - Make AMD default to prctl as well (Borislav)
>
> - Add the not affected CPU types (Tim)
>
> I've updated the git repository as well
>
> ssh://git@cvs.ou.linutronix.de/linux/speck/linux master (forced update)
>
> There are also two stable backport branches now:
>
> ssh://git@cvs.ou.linutronix.de/linux/speck/linux linux-4.16.y
>
> ssh://git@cvs.ou.linutronix.de/linux/speck/linux linux-4.14.y
>
>
> Delta patch against V8 below. Git bundle against 4.17-rc3 follows in
> separate mail.
>
> Thanks,
>
> tglx
>
This version also has a bug that's in the v8 patch. For whole platform
disabling of speculation, only CPU 0 has RDS enabled.
root@otc-cfl-s-02:~# cat /sys/devices/system/cpu/vulnerabilities/spec_store_bypass
Mitigation: Speculative Store Bypass disabled
msr 0x48 cpu 0 val: 4
msr 0x48 cpu 1 val: 0
msr 0x48 cpu 2 val: 0
msr 0x48 cpu 3 val: 0
msr 0x48 cpu 4 val: 0
msr 0x48 cpu 5 val: 0
msr 0x48 cpu 6 val: 0
msr 0x48 cpu 7 val: 0
msr 0x48 cpu 8 val: 0
msr 0x48 cpu 9 val: 0
msr 0x48 cpu 10 val: 0
msr 0x48 cpu 11 val: 0
I used the fix below to take care of Intel CPU. The fix also works for
CPU taken offline and back online. AMD cpu has the proper setting
of their MSR in boot up via identify_secondary_cpu's call to
x86_setup_ap_spec_ctrl.
void x86_setup_ap_spec_ctrl(void)
{
if (boot_cpu_has(X86_FEATURE_IBRS))
x86_set_spec_ctrl(x86_spec_ctrl_base & ~x86_spec_ctrl_mask);
if (ssb_mode == SPEC_STORE_BYPASS_DISABLE)
x86_amd_rds_enable();
}
But AMD cpu may have issue when CPU is brought offline and back online as
x86_setup_ap_spec_ctrl may not get called then.
Tim
---
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index ef3f9c0..c799e48 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -770,6 +770,9 @@ static void init_intel(struct cpuinfo_x86 *c)
init_intel_energy_perf(c);
init_intel_misc_features(c);
+
+ if (cpu_has(c, X86_FEATURE_SPEC_STORE_BYPASS_DISABLE))
+ x86_set_spec_ctrl(SPEC_CTRL_RDS);
}
#ifdef CONFIG_X86_32
next prev parent reply other threads:[~2018-05-01 17:22 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-01 15:24 [patch V9 00/16] SSB 0 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 01/16] SSB 1 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 02/16] SSB 2 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 03/16] SSB 3 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 04/16] SSB 4 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 05/16] SSB 5 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 06/16] SSB 6 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 07/16] SSB 7 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 08/16] SSB 8 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 09/16] SSB 9 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 10/16] SSB 10 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 11/16] SSB 11 Thomas Gleixner
2018-05-01 19:26 ` Thomas Gleixner
2018-05-01 15:24 ` [patch V9 12/16] SSB 12 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 13/16] SSB 13 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 14/16] SSB 14 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 15/16] SSB 15 Thomas Gleixner
2018-05-01 15:24 ` [patch V9 16/16] SSB 16 Thomas Gleixner
2018-05-01 15:40 ` [patch V9 00/16] SSB Thomas Gleixner
2018-05-01 15:51 ` [patch V9 00/16] SSB 0 - Bundle Thomas Gleixner
2018-05-01 16:11 ` [patch V9 00/16] SSB Thomas Gleixner
2018-05-01 17:22 ` Tim Chen [this message]
2018-05-01 17:28 ` Thomas Gleixner
2018-05-01 17:31 ` [MODERATED] " Linus Torvalds
2018-05-01 17:36 ` Thomas Gleixner
2018-05-01 19:14 ` [MODERATED] " Borislav Petkov
2018-05-01 19:20 ` Thomas Gleixner
2018-05-01 19:24 ` Thomas Gleixner
2018-05-01 19:28 ` [MODERATED] " Borislav Petkov
2018-05-01 18:12 ` Konrad Rzeszutek Wilk
2018-05-01 18:30 ` Thomas Gleixner
2018-05-01 22:22 ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-01 19:28 ` Tim Chen
2018-05-01 21:54 ` Thomas Gleixner
2018-05-01 22:33 ` [MODERATED] " Tim Chen
2018-05-01 22:46 ` Thomas Gleixner
2018-05-02 5:08 ` [MODERATED] " Jon Masters
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=1f9fea0d-12e9-aa51-717e-72f0203a0aae@linux.intel.com \
--to=tim.c.chen@linux.intel.com \
--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.