c1c534
From 38b3d773dddd7f3cfe715b9cbabaa296c16c1290 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <38b3d773dddd7f3cfe715b9cbabaa296c16c1290@dist-git>
c1c534
From: Jiri Denemark <jdenemar@redhat.com>
c1c534
Date: Fri, 5 Jan 2018 17:43:03 +0100
c1c534
Subject: [PATCH] cpu_x86: Copy CPU signature from ancestor
c1c534
c1c534
When specifying a new CPU model in cpu_map.xml as an extension to an
c1c534
existing model, we forgot to copy the signature (family + model) from
c1c534
the original CPU model.
c1c534
c1c534
We don't use this way of specifying CPU models, but it's still supported
c1c534
and it becomes useful when someone wants to quickly hack up a CPU model
c1c534
for testing or when creating additional variants of existing models to
c1c534
help with fixing some spectral issues.
c1c534
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
c1c534
(cherry picked from commit b427cf4831d0ea7aac9dd1a3aa7682478356a483)
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1533125
c1c534
c1c534
The new -IBRS and -IBPB CPU models were defined via inheritance from
c1c534
their original models in RHEL. Thus when the host CPU matches the
c1c534
signature of the original model from cpu_map.xml, libvirt will detect
c1c534
the host CPU as the original model + the new feature rather than
c1c534
reporting it as the -IBRS/-IBPB variant.
c1c534
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
---
c1c534
 src/cpu/cpu_x86.c | 1 +
c1c534
 1 file changed, 1 insertion(+)
c1c534
c1c534
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
c1c534
index ad35532fc1..001109f701 100644
c1c534
--- a/src/cpu/cpu_x86.c
c1c534
+++ b/src/cpu/cpu_x86.c
c1c534
@@ -1227,6 +1227,7 @@ x86ModelParse(xmlXPathContextPtr ctxt,
c1c534
         VIR_FREE(name);
c1c534
 
c1c534
         model->vendor = ancestor->vendor;
c1c534
+        model->signature = ancestor->signature;
c1c534
         if (x86DataCopy(&model->data, &ancestor->data) < 0)
c1c534
             goto error;
c1c534
     }
c1c534
-- 
c1c534
2.15.1
c1c534