Skip to contentSkip to conversation

Patches formerly known as SSB or MDD

PATCH Superseded [email protected] 1 participant 1 message Apr 26, 2018

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover Patches formerly known as SSB or MDD

Since v4
- Added support for bit(4) of X86_FEATURE_ARCH_CAPABILITIES
- Created bugzilla to hold the existing Intel docs
- Have three CPU flags for all of this:
X86_BUG_SPEC_STORE_BYPASS - CPU is susceptible. X86_FEATURE_RDS - CPU is able to turn off speculative store bypass X86_FEATURE_SPEC_STORE_BYPASS_DISABLE - engage the mitigation
- Fixed my EFI build issue (<blushes> I changed the header but forgot to change the function names).
- Extra patch (now up to 10) to deal with SPEC_CTRL whitelist so
we don't try to WRMSRL SPEC_CTRL_RDS (Bit 2) on AMD machines.

Since v3:
- Fixed it per Boris's review.
- Added Tim's comments.

Couple of things:

- Testing on baremetal shows (see 'rds' and 'spec_store_bypass'):

processor : 39
vendor_id : GenuineIntel
cpu family : 6
model : 79
model name : Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz
stepping : 1
microcode : 0xb00002d
cpu MHz : 2430.874
cache size : 25600 KB
physical id : 1
siblings : 20
core id : 12
cpu cores : 10
apicid : 57
initial apicid : 57
fpu : yes
fpu_exception : yes
cpuid level : 20
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap intel_pt xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local ibpb ibrs stibp dtherm ida arat pln pts rds
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass
bogomips : 4402.99
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:

- On KVM hosts with -cpu +spec-ctrl,+rds:

processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 79
model name : Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz
stepping : 1
microcode : 0x1
cpu MHz : 2195.098
cache size : 16384 KB
physical id : 7
siblings : 1
core id : 0
cpu cores : 1
apicid : 7
initial apicid : 7
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc
arch_perfmon rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid ss
e4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hyp ervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti fsgsbase tsc_ad just bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt ibpb ibrs
arat umip rds
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass
bogomips : 4390.19
clflush size : 64
cache_alignmen[ 126.527208] serial8250: too much work for irq4
t : 64
address sizes : 40 bits physical, 48 bits virtual
power management:

Things folks already know, but just in case you are new:

- The titles are obfuscated as Subject: are not encrypted. Nor are the MIME attachment file names.

- The cover letter subject is also mangled as I can't say spec_store_bypass_disable in the title.

- The Suggested-by and Reviewed-by have an XX in front of them so that git send-email does not include the CC on the mailbox file.

Here is the diffstat including the non-scrambled names of the patches.

 Documentation/admin-guide/kernel-parameters.txt |  32 ++++
 arch/x86/include/asm/cpufeatures.h              |   3 +
 arch/x86/include/asm/msr-index.h                |   2 +
 arch/x86/include/asm/nospec-branch.h            |  41 ++++-
 arch/x86/kernel/cpu/amd.c                       |  16 ++
 arch/x86/kernel/cpu/bugs.c                      | 234 ++++++++++++++++++++++--
 arch/x86/kernel/cpu/common.c                    |  46 +++--
 arch/x86/kernel/cpu/intel.c                     |   6 +
 arch/x86/kvm/cpuid.c                            |   2 +-
 arch/x86/kvm/svm.c                              |   6 +-
 arch/x86/kvm/vmx.c                              |  14 +-
 drivers/base/cpu.c                              |   8 +
 include/linux/cpu.h                             |   2 +
 13 files changed, 369 insertions(+), 43 deletions(-)

Konrad Rzeszutek Wilk (10):
x86/bugs: Concentrate bug detection into a separate function x86/bugs: Concentrate bug reporting into a separate function x86/bugs: Read SPEC_CTRL MSR during boot and re-use reserved bits. KVM/SVM/VMX/x86/bugs: Support the combination of guest IBRS and ours. x86/bugs: Expose the /sys/../spec_store_bypass and X86_BUG_SPEC_STORE_BYPASS x86/bugs: Provide boot parameters for the spec_store_bypass_disable mitigation x86/bugs/Intel: set proper CPU features and latch mitigation for RDS x86/bugs: Whitelist allowed SPEC_CTRL MSR values
x86/bugs/AMD: Add support to disable RDS on Fam[15,16,17]h if requested x86/KVM/VMX: Expose SPEC_CTRL Bit(2) to the guest