Skip to contentSkip to conversation

x86/cpu: add "md-clear" feature for MDS security flaws

PATCH New Daniel P. Berrangé 1 participant 3 messages May 15, 2019

lore
Share & tools
lore
#0 lore raw

cover x86/cpu: add "md-clear" feature for MDS security flaws

This patch series provides the new "md-clear" feature that is used for mitigation with CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091.

Assuming you have the updated microcode and kernel to support the md-clear feature, then using "-cpu host" will expose the new feature to guests. For named CPU models, it must be explicitly added eg "-cpu Haswell,+md-clear"

The first patch from Paolo is what most distros will already be shipping with their security updates for this issue.

Daniel P. Berrangé (1):
docs: recommend use of md-clear feature on all Intel CPUs

Paolo Bonzini (1):
target/i386: define md-clear bit

 docs/qemu-cpu-models.texi | 12 ++++++++++++
 target/i386/cpu.c         |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/2 target/i386: define md-clear bit

From: Paolo Bonzini <[email protected]>

md-clear is a new CPUID bit which is set when microcode provides the mechanism to invoke a flush of various exploitable CPU buffers by invoking the VERW instruction.

---
 target/i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/cpu.c +1 -1
index 722c5514d4..4fa67bcfaf 100644
@@ -1077,7 +1077,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
         .feat_names = {
             NULL, NULL, "avx512-4vnniw", "avx512-4fmaps",
             NULL, NULL, NULL, NULL,
-            NULL, NULL, NULL, NULL,
+            NULL, NULL, "md-clear", NULL,
             NULL, NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
Signature · 1 line
2.21.0
#2 lore raw

PATCH 2/2 docs: recommend use of md-clear feature on all Intel CPUs

In reply to Daniel P. Berrangé

Update x86 CPU model guidance to recommend that the md-clear feature is manually enabled with all Intel CPU models, when supported by the host microcode.

---
 docs/qemu-cpu-models.texi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
docs/qemu-cpu-models.texi +12 -0
index 23c11dc86f..ad040cfc98 100644
@@ -200,6 +200,18 @@ Not included by default in any Intel CPU model.
 Should be explicitly turned on for all Intel CPU models.
 
 Note that not all CPU hardware will support this feature.
+
+@item @code{md-clear}
+
+Required to confirm the MDS (CVE-2018-12126, CVE-2018-12127, CVE-2018-12130,
+CVE-2019-11091) fixes.
+
+Not included by default in any Intel CPU model.
+
+Must be explicitly turned on for all Intel CPU models.
+
+Requires the host CPU microcode to support this feature before it
+can be used for guest CPUs.
 @end table
 
 
Signature · 1 line
2.21.0