Skip to content

CPU model updates for CVE-2017-5715 (Spectre variant #2)

Eduardo Habkost qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7i386: Change X86CPUDefinition::model_id to const char*target/i386/cpu.c+4 -11 reply
2/7i386: Add support for SPEC_CTRL MSRtarget/i386/cpu.h target/i386/kvm.c target/i386/machine.c+37 -00 replies
3/7i386: Add spec-ctrl CPUID bittarget/i386/cpu.c target/i386/cpu.h+2 -13 replies
4/7i386: Add FEAT_8000_0008_EBX CPUID feature wordtarget/i386/cpu.c target/i386/cpu.h+21 -10 replies
5/7i386: Add new -IBRS versions of Intel CPU modelstarget/i386/cpu.c+378 -10 replies
6/7i386: Add EPYC-IBPB CPU modeltarget/i386/cpu.c+46 -00 replies
7/7i386: Add PCID to {Westmere, SandyBridge, IvyBridge}-IBRStarget/i386/cpu.c+6 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/7] CPU model updates for CVE-2017-5715 (Spectre variant #2)

This series adds support for the new IA32_SPEC_CTRL MSR on Intel CPU models. The new MSR and the spec-ctrl CPUID bit (CPUID[EAX=7,ECX=0].EDX[bit 26]) were introduced by a recent Intel microcode updated and can be used by OSes to mitigate CVE-2017-5715.

It also adds a new EPYC-IBPB CPU model that includes CPUID[0x80000008].EBX[bit 12] (IBPB). That patch is a RFC because I couldn't find any detailed info on the new CPUID bit and the IA32_PRED_CMD MSR.

Additionally, the last patch on this series changes the new Westmere-IBRS, SandyBridge-IBRS and IvyBridge-IBRS to include the PCID feature, because PCID helps to reduce the performance impact of KPTI on the guest. The patch is also a RFC because we need to confirm if all Westmere (and newer) CPUs out there have PCID available.

References:
* https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5715
* Google Security Blog on Meltdown/Spectre mitigations:
https://security.googleblog.com/2018/01/more-details-about-mitigations-for-cpu_4.html
* Kernel patches to make use of the new MSRs:
https://www.mail-archive.com/[email protected]/msg1578798.html
* KVM kernel patches for the new CPUID bits and MSRs:
https://www.mail-archive.com/[email protected]/msg1580363.html
* Patches adding PCID to the existing CPU models:
https://patchew.org/QEMU/[email protected]
https://patchew.org/QEMU/[email protected]

Eduardo Habkost (6):
i386: Change X86CPUDefinition::model_id to const char*
i386: Add spec-ctrl CPUID bit
i386: Add FEAT_8000_0008_EBX CPUID feature word
i386: Add new -IBRS versions of Intel CPU models [RFC] i386: Add EPYC-IBPB CPU model
[RFC] i386: Add PCID to {Westmere,SandyBridge,IvyBridge}-IBRS

Paolo Bonzini (1):
i386: Add support for SPEC_CTRL MSR

 target/i386/cpu.h     |   7 +
 target/i386/cpu.c     | 454 +++++++++++++++++++++++++++++++++++++++++++++++++-
 target/i386/kvm.c     |  14 ++
 target/i386/machine.c |  20 +++
 4 files changed, 491 insertions(+), 4 deletions(-)
Signature · 1 line
2.14.3