Bug 1317977

Summary: qemu-kvm-rhev supports a lot of CPU models
Product: Red Hat Enterprise Linux 7 Reporter: Andrea Bolognani <abologna>
Component: qemu-kvm-rhevAssignee: David Gibson <dgibson>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.3CC: abologna, chayang, hannsj_uhl, huding, jdenemar, juzhang, knoel, lvivier, mdeng, michen, mrezanin, qzhang, thuth, virt-maint, xfu, xuhan, xuma, zhengtli, zhguo
Target Milestone: rc   
Target Release: 7.3   
Hardware: ppc64le   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.6.0-4.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-07 21:00:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1359843    

Description Andrea Bolognani 2016-03-15 16:32:05 UTC
The qemu-kvm binary on ppc64le RHEL advertises support for a
huge number of CPU models:

  $ /usr/libexec/qemu-kvm -cpu ? 2>&1 | wc -l
  432

For comparison, libvirt only advertises support for a fraction
of those[1]:

  $ sudo virsh cpu-models ppc64le
  POWERPC_e6500
  POWERPC_e5500
  POWER8
  POWER7
  POWER6

Please consider patching qemu-kvm-rhev to get rid of the extra
entries.


[1] Interestingly, the only CPU models that are listed by both
    are POWER7 and POWER8, so libvirt probably needs some
    cleaning up as well.

Comment 2 Thomas Huth 2016-04-05 07:20:41 UTC
When I look through the output of QEMU's cpu list, I can see a "e5500", a "POWER7" and a "POWER8", but nothing that matches e6500 or POWER6. Out of curiosity: What is libvirt doing when you specify one of those two CPUs? Should they be removed from libvirt, or should they rather be added to QEMU instead?

Comment 3 Andrea Bolognani 2016-04-06 13:24:15 UTC
(In reply to Thomas Huth from comment #2)
> When I look through the output of QEMU's cpu list, I can see a "e5500", a
> "POWER7" and a "POWER8", but nothing that matches e6500 or POWER6. Out of
> curiosity: What is libvirt doing when you specify one of those two CPUs?
> Should they be removed from libvirt, or should they rather be added to QEMU
> instead?

I was planning to discuss this with Jirka, so I've added him to
the CC List for the bug.

If you specify any of the models you mentioned for a guest,
libvirt will not complain but you're going to get an error from
QEMU, just as you'd expect.

The problem here is that the CPU models libvirt knows about are
used both for the guest and for the host, so even if QEMU
doesn't know about POWER6 and can't use it for a guest we still
want to keep that information around so libvirt can correctly
identify a POWER6 host.

Anyway, this is just an aside from downstream QEMU's point of
view, which unless I'm mistaken only really needs to advertise
POWER8.

Comment 4 Thomas Huth 2016-04-11 11:31:15 UTC
To keep the changes in downstream simple, I'd suggest to simply disable the embedded and 32-bit PowerPC CPUs like this:

diff --git a/target-ppc/cpu-models.c b/target-ppc/cpu-models.c
--- a/target-ppc/cpu-models.c
+++ b/target-ppc/cpu-models.c
@@ -70,6 +70,7 @@
 #define POWERPC_DEF(_name, _pvr, _type, _desc)                              \
     POWERPC_DEF_SVR(_name, _desc, _pvr, POWERPC_SVR_NONE, _type)
 
+#if 0
     /* Embedded PowerPC                                                      */
     /* PowerPC 401 family                                                    */
     POWERPC_DEF("401",           CPU_POWERPC_401,                    401,
@@ -1101,6 +1102,7 @@
                 "PowerPC 7447A v1.2 (G4)")
     POWERPC_DEF("7457A_v1.2",    CPU_POWERPC_74x7A_v12,              7455,
                 "PowerPC 7457A v1.2 (G4)")
+#endif
     /* 64 bits PowerPC                                                       */
 #if defined (TARGET_PPC64)
 #if defined(TODO)
@@ -1226,6 +1228,7 @@
 /* PowerPC CPU aliases                                                     */
 
 PowerPCCPUAlias ppc_cpu_aliases[] = {
+#if 0
     { "403", "403GC" },
     { "405", "405D4" },
     { "405CR", "405CRc" },
@@ -1381,6 +1384,7 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
     { "7447A", "7447A_v1.2" },
     { "7457A", "7457A_v1.2" },
     { "Apollo7PM", "7457A_v1.0" },
+#endif
 #if defined(TARGET_PPC64)
     { "Trident", "620" },
     { "POWER3", "630" },

POWER7 and some other 64-bit CPUs are still enabled that way, but I think that does not hurt that much anymore and might even be useful for some regression testing with kvm-pr. If that sounds reasonable, let me know, then I can post this as a proper patch.

Comment 6 Andrea Bolognani 2016-04-11 12:12:59 UTC
(In reply to Thomas Huth from comment #4)
> POWER7 and some other 64-bit CPUs are still enabled that way, but I think
> that does not hurt that much anymore and might even be useful for some
> regression testing with kvm-pr. If that sounds reasonable, let me know, then
> I can post this as a proper patch.

I'll leave coming up with a good balance between not
overwhelming the user who might run that command and not
disabiling some potentially useful stuff to you guys.

It's mostly a cosmetic issue anyway, so it's probably only
worth it as long as it doesn't cause too much extra work
for the maintainers.

Comment 7 Miroslav Rezanina 2016-05-25 08:45:48 UTC
Fix included in qemu-kvm-rhev-2.6.0-4.el7

Comment 9 Xujun Ma 2016-06-03 06:52:43 UTC
Reproduced the issue on old version:

Version-Release number of selected component (if applicable):
qemu-kvm-rhev:qemu-kvm-rhev-2.3.0-31.el7_2.8.ppc64le
Host kernel:3.10.0-418.el7.ppc64le


Steps to Reproduce:
1.run command on the host:
/usr/libexec/qemu-kvm -cpu ? 2>&1 | wc -l
432


result:list 432 cpus


Verified the issue on the latest build:
Version-Release number of selected component (if applicable):
qemu-kvm-rhev:qemu-kvm-rhev-2.6.0-4.el7.ppc64le
Host kernel:3.10.0-418.el7.ppc64le


Steps to Verify:
1.run command on the host:
/usr/libexec/qemu-kvm -cpu ? 2>&1 | wc -l
12
/usr/libexec/qemu-kvm -cpu ?
PowerPC POWER7_v2.3      PVR 003f0203
PowerPC POWER7           (alias for POWER7_v2.3)
PowerPC POWER7+_v2.1     PVR 004a0201
PowerPC POWER7+          (alias for POWER7+_v2.1)
PowerPC POWER8E_v2.1     PVR 004b0201
PowerPC POWER8E          (alias for POWER8E_v2.1)
PowerPC POWER8NVL_v1.0   PVR 004c0100
PowerPC POWER8NVL        (alias for POWER8NVL_v1.0)
PowerPC POWER8_v2.0      PVR 004d0200
PowerPC POWER8           (alias for POWER8_v2.0)

PowerPC host 


result:deleted other unsupported cpus
so the bug seems to be fixed

Comment 11 errata-xmlrpc 2016-11-07 21:00:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2673.html