Bug 1532195 - -cpuid help broken with IBRS because of too long model-id [NEEDINFO]
Summary: -cpuid help broken with IBRS because of too long model-id
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Eduardo Habkost
QA Contact: Guo, Zhiyi
URL:
Whiteboard:
Depends On:
Blocks: 1609081
TreeView+ depends on / blocked
 
Reported: 2018-01-08 10:39 UTC by Dr. David Alan Gilbert
Modified: 2018-11-02 00:33 UTC (History)
15 users (show)

Fixed In Version: qemu-kvm-rhev-2.12.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-01 11:04:08 UTC
Target Upstream Version:
ehabkost: needinfo? (wlehman)


Attachments (Terms of Use)

Description Dr. David Alan Gilbert 2018-01-08 10:39:38 UTC
Description of problem:

running qemu-kvm -cpuid help I see:

....
x86        IvyBridge  Intel Xeon E3-12xx v2 (Ivy Bridge)              
x86     Nehalem-IBRS  Intel Core i7 9xx (Nehalem Core i7, IBRS update)4�j
x86          Nehalem  Intel Core i7 9xx (Nehalem Class Core i7)       
....

The junk after Nehalem-IBRS is random.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.10.0-16.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. /usr/libexec/qemu-kvm -cpu help

Actual results:
....
x86        IvyBridge  Intel Xeon E3-12xx v2 (Ivy Bridge)              
x86     Nehalem-IBRS  Intel Core i7 9xx (Nehalem Core i7, IBRS update)4�j
x86          Nehalem  Intel Core i7 9xx (Nehalem Class Core i7)       
....


Expected results:
No junk at the end

Additional info:

Comment 2 Guo, Zhiyi 2018-01-08 10:55:52 UTC
This issue can be observed on both 7.4.z, 7.3.z and 7.2.z qemu-kvm-rhev packages

Comment 7 Chet Burgess 2018-03-22 20:29:12 UTC
I can confirm that this is also happening on the version that is shipped as part of OSP 8.

qemu-kvm-rhev-2.9.0-16.el7_4.13.x86_64

cfb@mhv1.stage1.mc ~$ /usr/libexec/qemu-kvm -cpu help | grep Nehalem-IBRS
x86     Nehalem-IBRS  Intel Core i7 9xx (Nehalem Core i7, IBRS update)IyF��U

Comment 8 Eduardo Habkost 2018-04-11 14:15:39 UTC
Moving back to ASSIGNED, it needs a new patch.

Comment 11 Eduardo Habkost 2018-05-08 14:55:51 UTC
For reference, upstream fix in QEMU 2.12.0:

commit 807e9869b8c4119b81df902625af818519e01759
Author: Eduardo Habkost <ehabkost@redhat.com>
Date:   Tue Jan 9 13:45:13 2018 -0200

    i386: Change X86CPUDefinition::model_id to const char*
    
    It is valid to have a 48-character model ID on CPUID, however the
    definition of X86CPUDefinition::model_id is char[48], which can
    make the compiler drop the null terminator from the string.
    
    If a CPU model happens to have 48 bytes on model_id, "-cpu help"
    will print garbage and the object_property_set_str() call at
    x86_cpu_load_def() will read data outside the model_id array.
    
    We could increase the array size to 49, but this would mean the
    compiler would not issue a warning if a 49-char string is used by
    mistake for model_id.
    
    To make things simpler, simply change model_id to be const char*,
    and validate the string length using an assert() on
    x86_register_cpudef_type().
    
    Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Message-Id: <20180109154519.25634-2-ehabkost@redhat.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Comment 14 Eduardo Habkost 2018-05-21 20:04:47 UTC
Setting to MODIFIED because it's in the 2.12 rebase.

Comment 16 jingzhao 2018-06-05 09:26:39 UTC
Reproduce the issue with qemu-kvm-rhev-2.10.0-21.el7.x86_64

/usr/libexec/qemu-kvm -cpu help
......
x86        IvyBridge  Intel Xeon E3-12xx v2 (Ivy Bridge)              
x86     Nehalem-IBRS  Intel Core i7 9xx (Nehalem Core i7, IBRS update)T�OIaU
x86          Nehalem  Intel Core i7 9xx (Nehalem Class Core i7)  

Verified the issue with qemu-kvm-rhev-2.12.0-3.el7.x86_64

/usr/libexec/qemu-kvm -cpu help
.....
x86        IvyBridge  Intel Xeon E3-12xx v2 (Ivy Bridge)              
x86     Nehalem-IBRS  Intel Core i7 9xx (Nehalem Core i7, IBRS update)
x86          Nehalem  Intel Core i7 9xx (Nehalem Class Core i7)

Comment 20 errata-xmlrpc 2018-11-01 11:04:08 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://access.redhat.com/errata/RHBA-2018:3443


Note You need to log in before you can comment on or make changes to this bug.