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 692374 - -cpu enforce with wrong cpu flags does not cause qemu-kvm process quit
Summary: -cpu enforce with wrong cpu flags does not cause qemu-kvm process quit
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Eduardo Habkost
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 813132 (view as bug list)
Depends On: 814426
Blocks: 822613 833129
TreeView+ depends on / blocked
 
Reported: 2011-03-31 07:25 UTC by Mike Cao
Modified: 2015-11-23 03:34 UTC (History)
12 users (show)

Fixed In Version: upstream qemu-1.4.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 822616 (view as bug list)
Environment:
Last Closed: 2013-07-03 13:11:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Mike Cao 2011-03-31 07:25:16 UTC
Description of problem:


Version-Release number of selected component (if applicable):
# uname -r
2.6.32-128.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.153.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.<commandline> -cpu Penryn,+ace,enforce ( ace is the flag on Westmere cpu model)
2.<commandLine> -cpu Conroe,+smx,enforce ( smx is the flag on Westmere cpu model)
3.<commandLine> -cpu Nehalem,+ace,enforce

Actual results:
QEMU runs in both cases

Expected results:
QEMU does not run

Additional info:
#<commandLine> -cpu host,+ace,enforce
CPU feature ace not found
warning: host cpuid 0000_0001:ecx flag restricted to guest 'vmx' [0x00000020]
Unable to support requested x86 CPU definition

#<commandLine> -cpu cpu64-rhel6,+ace,enforce
CPU feature ace not found
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]
Unable to support requested x86 CPU definition

Comment 2 Dor Laor 2011-03-31 10:36:20 UTC
I'm not sure it is worth fixing as long as the regular models w/o additional flags work.

Comment 3 john cooper 2011-04-06 00:40:47 UTC
Yes that is the default "-cpu" flag parsing of qemu, namely it doesn't
bail if unknown flags are present:

# x86_64-softmmu/qemu-system-x86_64 -smp 1 -netic -net user ../../winxp-64.img \
    -m 1024 -cpu Penryn,+popcnt,+ou812,+sse4_2,check 
Using CPU model "Penryn,+popcnt,+ou812,+sse4_2,check"
CPU feature ou812 not found
warning: host cpuid 0000_0001:ecx lacks requested flag 'sse4.2|sse4_2' [0x00100000]
warning: host cpuid 0000_0001:ecx lacks requested flag 'popcnt' [0x00800000]

<guest launches>


But you're right "enforce" semantics should be held (in addition to
complaining) and qemu should error exit.  It's a nit and should be
cleaned up the next time we're in that section of the code.

Comment 7 Eduardo Habkost 2012-03-27 19:56:03 UTC
Not only non-existing flags are not rejected properly, but also flags that exist, are supported by the host, but unsupported by the kernel. e.g.:

-cpu Opteron_G3,+ht,-svm,enforce

HT is not supported by the KVM kernel module and gets disabled, but Qemu continues to run without aborting.

Comment 8 Eduardo Habkost 2012-04-20 20:46:49 UTC
*** Bug 813132 has been marked as a duplicate of this bug. ***

Comment 10 Eduardo Habkost 2012-07-20 13:34:28 UTC
*** Bug 821581 has been marked as a duplicate of this bug. ***

Comment 12 langfang 2012-11-08 09:43:39 UTC
not sure if  hit the same problem on Opteron_G5 host.
version:
# uname -r
2.6.32-339.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.334.el6.x86_64

guest:win2008r2

host:
[root@amd-pence-01 src]# cat /proc/cpuinfo
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 2
model name	: AMD Eng Sample, 1S256146U8K54_35/25/20_2/8     
stepping	: 0
cpu MHz		: 1400.000
cache size	: 2048 KB
physical id	: 0
siblings	: 8
core id		: 0
cpu cores	: 4
apicid		: 16
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core cpb npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips	: 4987.26
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

steps:
1.boot guest with -cpu Opteron_G1,-nx,+sse4a,enforce..(sse4a is the flag on Opteron_G3 cpu model)

 /usr/libexec/qemu-kvm -M rhel6.4.0 -cpu Opteron_G1,-nx,+sse4a......

2.use x86info to check the cpu flag 


results:QEMU runs and not prompt any error,check in guest ,the flag 'sse4a' expose to guest.

addinfo:
but boot with '-cpu Opteron_G2' :
# /usr/libexec/qemu-kvm -M rhel6.4.0 -cpu Opteron_G2,-nx,+sse4a,check,enforce
warning: host cpuid 8000_0001:ecx flag restricted to guest 'svm' [0x00000004]
Unable to support requested x86 CPU definition


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