This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 488734 - RHEL5.3 guest does not get proper ACPI / proc/cpuinfo from Nahalem host
RHEL5.3 guest does not get proper ACPI / proc/cpuinfo from Nahalem host
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.0
x86_64 Linux
low Severity medium
: rc
: 6.1
Assigned To: Jes Sorensen
: FutureFeature, HardwareEnablement, OtherQA
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-05 10:26 EST by John Shakshober
Modified: 2016-04-26 11:25 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-07 07:50:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Shakshober 2009-03-05 10:26:41 EST
Description of problem:

RHEL5.3 guest does not get proper ACPI / proc/cpuinfo from Nahalem host 
binaries with Nahalem instruction sets will not run inside KVM guest.

Version-Release number of selected component (if applicable):
Linux perf18.lab.bos.redhat.com 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux

Using snap2 of KVM ovirt on the RHEL5.3 kernel 
Suspect other optimizations numa acpi etc all have issues too, but this is a show stopper from running SPECcpu inside KVM virtual guest on Nahalem.

How reproducible:

100%

Steps to Reproduce:
1. On a Nahalem system, as root untar speckit to /spec from Intel or http://perf1.bos.redhat.com:/shak/kits/spec_vanhalen.tar.bz2  (will need 16GB space)
2. cd /spec/SPEC2006
3. ./runit.sh (sets up the subdirectories 
  
Actual results:
Running Benchmarks
  Running (#1) 400.perlbench ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)

400.perlbench: copy 4 non-zero return code (exit code=1, signal=0)


****************************************
Contents of splitmail.1600.12.26.16.4500.err
****************************************

Fatal Error: This program was not built to run on the processor in your system.
The allowed processors are: Intel(R) processors with SSE4.2 and POPCNT instructions support.




Expected results:

When run on the perf22 host

Running Benchmarks
  Running (#1) 400.perlbench ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#1) 401.bzip2 ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#1) 403.gcc ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#1) 429.mcf ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (8 copies)
  Running (#1) 445.gobmk ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#1) 456.hmmer ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (8 copies)
  Running (#1) 458.sjeng ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#1) 462.libquantum ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#1) 464.h264ref ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#1) 471.omnetpp ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#1) 473.astar ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#1) 483.xalancbmk ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#1) 999.specrand ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#2) 400.perlbench ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#2) 401.bzip2 ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#2) 403.gcc ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#2) 429.mcf ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (8 copies)
  Running (#2) 445.gobmk ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#2) 456.hmmer ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (8 copies)
  Running (#2) 458.sjeng ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#2) 462.libquantum ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#2) 464.h264ref ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#2) 471.omnetpp ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#2) 473.astar ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#2) 483.xalancbmk ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#2) 999.specrand ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#3) 400.perlbench ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#3) 401.bzip2 ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#3) 403.gcc ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#3) 429.mcf ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (8 copies)
  Running (#3) 445.gobmk ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#3) 456.hmmer ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (8 copies)
  Running (#3) 458.sjeng ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#3) 462.libquantum ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#3) 464.h264ref ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#3) 471.omnetpp ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#3) 473.astar ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#3) 483.xalancbmk ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
  Running (#3) 999.specrand ref peak cpu2006.1.1.ic11.0.linux64.sse42.rate.feb2009 default (16 copies)
Success: 3x400.perlbench 3x401.bzip2 3x403.gcc 3x429.mcf 3x445.gobmk 3x456.hmmer 3x458.sjeng 3x462.libquantum 3x464.h264ref 3x471.omnetpp 3x473.astar 3x483.xalancbmk 3x999.specrand
Producing Raw Reports

Additional info:


The "flags" fields in the guest do NOT have "popcnt" needed for this binary to run.

 
/proc/cpuinfo table on the guest
processor       : 15
vendor_id       : GenuineIntel
cpu family      : 6
model           : 2
model name      : QEMU Virtual CPU version 0.9.1
stepping        : 3
cpu MHz         : 2933.403
cache size      : 2048 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm pni
bogomips        : 5843.54
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:


/proc/cpuinfo on the host
processor       : 15
vendor_id       : GenuineIntel
cpu family      : 6
model           : 26
model name      : Intel(R) Xeon(R) CPU           X5570  @ 2.93GHz
stepping        : 5
cpu MHz         : 2933.591
cache size      : 8192 KB
physical id     : 1
siblings        : 8
core id         : 3
cpu cores       : 4
apicid          : 23
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx rdtscp lm constant_tsc ida pni monitor ds_cpl vmx est tm2 cx16 xtpr popcnt lahf_lm
bogomips        : 5867.18
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:
Comment 1 Dor Laor 2009-04-16 03:35:04 EDT
Please post the qemu command line flags.
Does it happen with "-cpu qemu64,+sse2" flags too? This is what we use by vdsm.
Comment 2 Amit Shah 2009-04-16 06:18:24 EDT
One of the features of virtualisation is the guest need not know which host it's running on -- this is useful for migration of the guest to various hosts (even to hosts which don't have similar capabilities) and things keep working the same.

Exposing flags which are only introduced in Nehalem to guests is not a good idea if other servers in the migration pool do not have those capabilities. On the other hand, if all the servers are known to have the required capability, they can be 'turned on' by passing flags on the command line as Dor mentions above.

We surely don't guarantee that binaries compiled for the host will run fine on the guest if they depend on cpu features exposed by the host cpu.

However, for this specific example, you can use the "-cpu qemu64,+popcnt" option to get the popcnt cpuid enabled
Comment 3 John Shakshober 2009-04-20 21:11:15 EDT
Starting qemu with the -cpu,+sse2,+popcnt flags did NOT alter the behavior the failure above attempting to run an optimized image with the newer Nahalem instructions.

Here is our command line ... if you see any errors, or other suggestions?


 /usr/bin/qemu-kvm -m 16384 -smp 16 -cpu qemu64,+sse2,+popcnt -name rhel5kvmfv -
uuid 32709c5a-d363-a8b0-b87c-78ca707fcb8f -boot c -drive file=/kvm/rhel5kvmfv.ds
k,if=ide,index=0,boot=on -drive file=/spec/kvmspec.dsk,if=ide,index=1,boot=off -
net nic,macaddr=00:16:3e:55:c7:4b,vlan=0,model=virtio -net tap,script=/etc/qemu-
ifup,vlan=0,ifname=prv9 -net nic,macaddr=00:30:48:c5:aa:66,vlan=1,model=virtio -
net tap,script=/etc/qemu-ifup1,vlan=1,ifname=pub1 -parallel none -usb -vnc 127.0
.0.1:0
Comment 4 Dor Laor 2009-04-22 07:17:28 EDT
This is we don't plan to expose Nehalem command set to the guest.
It will limit migration.
Maybe for future releases, and only if management prevent the guest for migration to non-Nehalem hosts.
Comment 5 Eduardo Habkost 2010-01-20 06:52:10 EST
On RHEL-6, the KVM userspace package is named "qemu-kvm". Moving bug to the right component.
Comment 7 Jes Sorensen 2010-05-06 11:41:45 EDT
Shak,

Does this still happen with -cpu host ?

If the flag doesn't show up with -cpu host, it could be something to fix. 

Otherwise as Dor said, not exposing the Nehalem specifics is really a feature as opposed to a bug. I don't think it is something we should try to do anything about for RHEL6.

Cheers,
Jes
Comment 8 Jes Sorensen 2010-05-06 13:15:08 EDT
Agreed with John to take this one.
Comment 9 Jes Sorensen 2010-05-07 07:50:10 EDT
I ran some tests to verify this. In my case it was a Nehalem system with RHEL6 as host and RHEL55 as the guest:

Here is the output from cpuflags with -cpu host and with the default settings:

-cpu host:
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc up pni ssse3 cx16 sse4_1 sse4_2 popcnt lahf_lm

default:
flags		: fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm up pni cx16 popcnt lahf_lm

As expected, -cpu host sets both sse4_2 and popcnt as expected.

I am going to close this BZ as the system is behaving as expected. Feel free to reopen if you can reproduce the problem with -cpu host.

Cheers,
Jes
Comment 10 John Shakshober 2010-05-07 08:50:57 EDT
I will re-try on RHEL5.5 and RHEL6 w/ -cpu host flags 
Once I confirm we can CLOSE the BZ.
Thanks
Shak

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