]> xenbits.xensource.com Git - libvirt.git/commitdiff
cpu: CPU model names have to match on ppc64
authorAndrea Bolognani <abologna@redhat.com>
Fri, 7 Aug 2015 15:39:10 +0000 (17:39 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 11 Aug 2015 09:04:57 +0000 (11:04 +0200)
Limitations of the POWER architecture mean that you can't run
eg. a POWER7 guest on a POWER8 host when using KVM. This applies
to all guests, not just those using VIR_CPU_MATCH_STRICT in the
CPU definition; in fact, exact and strict CPU matching are
basically the same on ppc64.

This means, of course, that hosts using different CPUs have to be
considered incompatible as well.

Change ppc64Compute(), called by cpuGuestData(), to reflect this
fact and update test cases accordingly.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1250977

src/cpu/cpu_ppc64.c
tests/cputest.c
tests/cputestdata/ppc64-guest.xml
tests/cputestdata/ppc64-host+guest,ppc_models-result.xml
tests/cputestdata/ppc64-host+guest-nofallback,ppc_models,POWER7_v2.1-result.xml [deleted file]

index 53d8fb00d8949976cda00b3e86643ae9b4621bd4..07699568a3733271dd86fa319a1c46e2dc3b52da 100644 (file)
@@ -350,7 +350,6 @@ ppc64Compute(virCPUDefPtr host,
              const virCPUDef *cpu,
              virCPUDataPtr *guestData,
              char **message)
-
 {
     struct ppc64_map *map = NULL;
     struct ppc64_model *host_model = NULL;
@@ -407,9 +406,7 @@ ppc64Compute(virCPUDefPtr host,
         !(guest_model = ppc64ModelFromCPU(cpu, map)))
         goto cleanup;
 
-    if (cpu->type == VIR_CPU_TYPE_GUEST &&
-        cpu->match == VIR_CPU_MATCH_STRICT &&
-        STRNEQ(guest_model->name, host_model->name)) {
+    if (STRNEQ(guest_model->name, host_model->name)) {
         VIR_DEBUG("host CPU model does not match required CPU model %s",
                   guest_model->name);
         if (message &&
index 93f9d2ec88d3e1f98f5c92c6943fe1ac47c5921d..1e84fd3efdfa25abbe0fe59c833df2352ada6355 100644 (file)
@@ -501,7 +501,7 @@ static const char *model486[]   = { "486" };
 static const char *nomodel[]    = { "nomodel" };
 static const char *models[]     = { "qemu64", "core2duo", "Nehalem" };
 static const char *haswell[]    = { "SandyBridge", "Haswell" };
-static const char *ppc_models[]     = { "POWER7", "POWER7_v2.1", "POWER8_v1.0"};
+static const char *ppc_models[] = { "POWER7", "POWER7_v2.1", "POWER7_v2.3", "POWER8_v1.0"};
 
 static int
 mymain(void)
@@ -662,7 +662,7 @@ mymain(void)
                       NULL, "Haswell-noTSX", 0);
 
     DO_TEST_GUESTDATA("ppc64", "host", "guest", ppc_models, NULL, 0);
-    DO_TEST_GUESTDATA("ppc64", "host", "guest-nofallback", ppc_models, "POWER7_v2.1", 0);
+    DO_TEST_GUESTDATA("ppc64", "host", "guest-nofallback", ppc_models, "POWER7_v2.1", -1);
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
index ac81ec0adcc4cffa63454c500e42cd0171bb5307..9e91501002a4f1de1b537d9d3fc78ff110ef31d0 100644 (file)
@@ -1,4 +1,4 @@
 <cpu match='exact'>
-  <model>POWER8_v1.0</model>
+  <model>POWER7_v2.3</model>
   <topology sockets='2' cores='4' threads='1'/>
 </cpu>
index 0cb08303248cafaa1d7c102db8fe2d8820065a3b..3e55f68f50a8176d4e8bd5cf9ff79f34828e04f2 100644 (file)
@@ -1,5 +1,5 @@
 <cpu mode='custom' match='exact'>
   <arch>ppc64</arch>
-  <model fallback='allow'>POWER8_v1.0</model>
+  <model fallback='allow'>POWER7_v2.3</model>
   <vendor>IBM</vendor>
 </cpu>
diff --git a/tests/cputestdata/ppc64-host+guest-nofallback,ppc_models,POWER7_v2.1-result.xml b/tests/cputestdata/ppc64-host+guest-nofallback,ppc_models,POWER7_v2.1-result.xml
deleted file mode 100644 (file)
index 7e58361..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<cpu mode='custom' match='exact'>
-  <arch>ppc64</arch>
-  <model fallback='forbid'>POWER7_v2.1</model>
-  <vendor>IBM</vendor>
-</cpu>