RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 619259 - qemu "-cpu [check | enforce ]" should work even when a model name is not specified on the command line
Summary: qemu "-cpu [check | enforce ]" should work even when a model name is not spec...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.1
Hardware: All
OS: Linux
low
medium
Target Milestone: beta
: 6.1
Assignee: john cooper
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 601540
Blocks: 580953
TreeView+ depends on / blocked
 
Reported: 2010-07-29 04:54 UTC by john cooper
Modified: 2014-07-25 03:46 UTC (History)
8 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.144.el6
Doc Type: Bug Fix
Doc Text:
Cause Launching qemu with "-cpu check" doesn't do as expected if a valid cpu model name isn't provided. Consequence "check" and "enforce" actions on the default model don't work and qemu falters with a CLI parsing error. Fix Due to qemu's current CLI argument parsing structure a cpu model name must be provided. So the pseudo name "default" is now recognized which allows "check" and "enforce" to function as expected on both default and "-M" implied cpu models. Result Intuitive and expected behavior for these options is maintained.
Clone Of: 601540
Environment:
Last Closed: 2011-05-19 11:33:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to resolve case. (2.32 KB, patch)
2011-01-27 03:56 UTC, john cooper
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0534 0 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2011-05-19 11:20:36 UTC

Comment 2 RHEL Program Management 2010-07-29 05:27:42 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 4 john cooper 2010-07-30 00:45:14 UTC
I'd envisioned it to be a 6.1 issue when I opened it.
But if sufficient justification exists from other
users to move it into 6.0 that wouldn't be unreasonable.

Comment 5 john cooper 2010-11-19 19:46:02 UTC
Update: due to the internal structure of qemu's arg parsing, adding
this seemingly trivial feature is far more complex/ugly than it
should be.  Let's leave this on the table for now and I'll have
another look to see if some simpler solution exists.

Comment 7 john cooper 2011-01-27 03:55:04 UTC
(In reply to comment #0)
> Description of problem:
> 
> Launching qemu with "-cpu check" doesn't do as expected
> if a valid cpu model name isn't provided.
> 
> Expected results:
> 
> This should work in cases where a model is being chosen
> implicitly, such as when launching via "-M <machine name>"
> in order to launder flags pulled in by the implied model.

Due to qemu's CLI argument parsing structure and the fact cpu models
are initialized depending on build configuration, supporting the
above is far more clunky than it ought to be.

The problem is omitting the cpu model "name" and allowing only feature
flags and modifiers breaks the existing parsing logic, which is
difficult to circumvent given the current implementation.  So as a
minor concession to a far more simple solution we add a pseudo model
name of "default" which expands internally to qemu's build
configuration default and is then interpreted conventionally.  The
result is then the following example usage:


    # x86_64-softmmu/qemu-system-x86_64 ../rhel6.0-beta.img -net nic -net user -m 1024 
    Using CPU model "cpu64-rhel6"
      :

    # 86_64-softmmu/qemu-system-x86_64 ../rhel6.0-beta.img -net nic -net user -m 1024 -cpu default,check
    Using CPU model "cpu64-rhel6,check"
    warning: host cpuid 8000_0001 lacks requested flag 'abm' [0x00000020]
    warning: host cpuid 8000_0001 lacks requested flag 'sse4a' [0x00000040]
      :

    # x86_64-softmmu/qemu-system-x86_64 ../rhel6.0-beta.img -net nic -net user -m 1024 -M rhel6.0.0 -cpu default,enforce,+sse4.1,+sse4.2,-abm
    Using CPU model "cpu64-rhel6,enforce,+sse4.1,+sse4.2,-abm"
    warning: host cpuid 0000_0001 lacks requested flag 'sse4.2|sse4_2' [0x00100000]
    warning: host cpuid 8000_0001 lacks requested flag 'sse4a' [0x00000040]
    Unable to support requested x86 CPU definition

etc..  allowing both the ability here to "check|enforce" the default
model, as well as accepting arbitrary feature flags due to fan into the
existing flag parsing.  The resulting rhel6.1 patch (to follow) is fairly
trivial.   Upstream patch under way.

Comment 8 john cooper 2011-01-27 03:56:38 UTC
Created attachment 475522 [details]
Patch to resolve case.

Comment 15 Suqin Huang 2011-02-18 03:25:06 UTC
fix on qemu-kvm-0.12.1.2-2.145.el6.x86_64

1. qemu-kvm-0.12.1.2-2.132.el6.x86_64
1). /usr/libexec/qemu-kvm /usr/local/staf/test/RHEV/kvm-new/autotest/client/tests/kvm/images/RHEL-Server-6.0-32.raw

can boot without worning

2). check
/usr/libexec/qemu-kvm /usr/local/staf/test/RHEV/kvm-new/autotest/client/tests/kvm/images/RHEL-Server-6.0-32.raw -cpu default,check
Unknown cpu model: default
Unable to support requested x86 CPU definition

/usr/libexec/qemu-kvm /usr/local/staf/test/RHEV/kvm-new/autotest/client/tests/kvm/images/RHEL-Server-6.0-32.raw -cpu check
Unknown cpu model: check
Unable to support requested x86 CPU definition
3). enforce
[root@amd-4450b-4-2 ~]# /usr/libexec/qemu-kvm /usr/local/staf/test/RHEV/kvm-new/autotest/client/tests/kvm/images/RHEL-Server-6.0-32.raw -cpu enforce
Unknown cpu model: enforce
Unable to support requested x86 CPU definition
[root@amd-4450b-4-2 ~]# /usr/libexec/qemu-kvm /usr/local/staf/test/RHEV/kvm-new/autotest/client/tests/kvm/images/RHEL-Server-6.0-32.raw -cpu default,enforce
Unknown cpu model: default
Unable to support requested x86 CPU definition

2. qemu-kvm-0.12.1.2-2.145.el6.x86_64

1). /usr/libexec/qemu-kvm /home/shuang/images/rhel5.test
Using CPU model "cpu64-rhel6"

2). /usr/libexec/qemu-kvm /home/shuang/images/rhel5.test -cpu default,check
Using CPU model "cpu64-rhel6,check"
warning: host cpuid 8000_0001:ecx flag restricted to guest 'svm' [0x00000004]
warning: host cpuid 8000_0001:ecx lacks requested flag 'abm' [0x00000020]
warning: host cpuid 8000_0001:ecx lacks requested flag 'sse4a' [0x00000040]

3). /usr/libexec/qemu-kvm /home/shuang/images/rhel5.test -cpu default,enforce
Using CPU model "cpu64-rhel6,enforce"
warning: host cpuid 8000_0001:ecx flag restricted to guest 'svm' [0x00000004]
warning: host cpuid 8000_0001:ecx lacks requested flag 'abm' [0x00000020]
warning: host cpuid 8000_0001:ecx lacks requested flag 'sse4a' [0x00000040]
Unable to support requested x86 CPU definition

/usr/libexec/qemu-kvm /home/shuang/images/rhel5.test -cpu default,enforce,+svm,+abm,+sse4a
Using CPU model "cpu64-rhel6,enforce,+svm,+abm,+sse4a"
warning: host cpuid 8000_0001:ecx flag restricted to guest 'svm' [0x00000004]
warning: host cpuid 8000_0001:ecx lacks requested flag 'abm' [0x00000020]
warning: host cpuid 8000_0001:ecx lacks requested flag 'sse4a' [0x00000040]
Unable to support requested x86 CPU definition

Comment 16 john cooper 2011-02-18 20:37:23 UTC
Looks good.  Incidentally you might consider adding unit test to
validate we're picking up other built-in defaults when the "-M"
flag is specified, as a regression check of sorts.  For example:

    # x86_64-softmmu/qemu-system-x86_64 -M rhel5.4.4
    Using CPU model "cpu64-rhel5"
      :

    # x86_64-softmmu/qemu-system-x86_64 -M rhel5.4.4 -cpu default,check
    Using CPU model "cpu64-rhel5,check"
    warning: host cpuid 8000_0001:edx lacks requested flag '3dnowext' [0x40000000]
    warning: host cpuid 8000_0001:edx lacks requested flag '3dnow' [0x80000000]
    warning: host cpuid 8000_0001:ecx lacks requested flag 'svm' [0x00000004]

Note the warnings above in the case of "check" are of no general concern.
The cpu64-rhel* models intentionally request a wider set of features than
they typically will receive and are not guaranteed to be migration portable
models.

Comment 17 Suqin Huang 2011-04-13 07:49:02 UTC
test the default cpu model when the "-M" flag is specified ==> PASS

qemu-kvm-0.12.1.2-2.156.el6.x86_64

[root@intel-e5620-12-1 ~]# /usr/libexec/qemu-kvm test.qcow2 -M pc -cpu default,check -vnc :1
Using CPU model "cpu64-rhel6,check"
warning: host cpuid 8000_0001:ecx lacks requested flag 'svm' [0x00000004]
warning: host cpuid 8000_0001:ecx lacks requested flag 'abm' [0x00000020]
warning: host cpuid 8000_0001:ecx lacks requested flag 'sse4a' [0x00000040]


[root@intel-e5620-12-1 ~]# /usr/libexec/qemu-kvm test.qcow2 -M rhel6.1.0 -cpu default,check -vnc :1
Using CPU model "cpu64-rhel6,check"
warning: host cpuid 8000_0001:ecx lacks requested flag 'svm' [0x00000004]
warning: host cpuid 8000_0001:ecx lacks requested flag 'abm' [0x00000020]
warning: host cpuid 8000_0001:ecx lacks requested flag 'sse4a' [0x00000040]


[root@intel-e5620-12-1 ~]# /usr/libexec/qemu-kvm test.qcow2 -M rhel6.0.0 -cpu default,check -vnc :1
Using CPU model "cpu64-rhel6,check"
warning: host cpuid 8000_0001:ecx lacks requested flag 'svm' [0x00000004]
warning: host cpuid 8000_0001:ecx lacks requested flag 'abm' [0x00000020]
warning: host cpuid 8000_0001:ecx lacks requested flag 'sse4a' [0x00000040]


[root@intel-e5620-12-1 ~]# /usr/libexec/qemu-kvm test.qcow2 -M rhel5.5.0 -cpu default,check -vnc :1
Using CPU model "cpu64-rhel5,check"
warning: host cpuid 8000_0001:edx lacks requested flag '3dnowext' [0x40000000]
warning: host cpuid 8000_0001:edx lacks requested flag '3dnow' [0x80000000]
warning: host cpuid 8000_0001:ecx lacks requested flag 'svm' [0x00000004]


[root@intel-e5620-12-1 ~]# /usr/libexec/qemu-kvm test.qcow2 -M rhel5.4.0 -cpu default,check -vnc :1
Using CPU model "cpu64-rhel5,check"
warning: host cpuid 8000_0001:edx lacks requested flag '3dnowext' [0x40000000]
warning: host cpuid 8000_0001:edx lacks requested flag '3dnow' [0x80000000]
warning: host cpuid 8000_0001:ecx lacks requested flag 'svm' [0x00000004]


[root@intel-e5620-12-1 ~]# /usr/libexec/qemu-kvm test.qcow2 -M rhel5.4.4 -cpu default,check -vnc :1
Using CPU model "cpu64-rhel5,check"
warning: host cpuid 8000_0001:edx lacks requested flag '3dnowext' [0x40000000]
warning: host cpuid 8000_0001:edx lacks requested flag '3dnow' [0x80000000]
warning: host cpuid 8000_0001:ecx lacks requested flag 'svm' [0x00000004]

Comment 18 Miya Chen 2011-04-14 11:16:06 UTC
move it to verified based on comment#15 and comment#17

Comment 19 john cooper 2011-05-05 14:57:59 UTC
Add CCFR.

Comment 20 john cooper 2011-05-05 14:57:59 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
    Launching qemu with "-cpu check" doesn't do as expected
if a valid cpu model name isn't provided.

Consequence
    "check" and "enforce"  actions on the default model don't work
and qemu falters with a CLI parsing error.

Fix
    Due to qemu's current CLI argument parsing structure a cpu model
name must be provided.  So the pseudo name "default" is now recognized
which allows  "check" and "enforce" to function as expected
on both default and "-M" implied cpu models.

Result
    Intuitive and expected behavior for these options is maintained.

Comment 21 errata-xmlrpc 2011-05-19 11:33:13 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0534.html

Comment 22 errata-xmlrpc 2011-05-19 12:46:48 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0534.html


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