Bug 647125

Summary: /proc/cpuinfo doesn't show pbe although it's supported by CPU
Product: Red Hat Enterprise Linux 5 Reporter: Alex Jia <ajia>
Component: kvmAssignee: john cooper <john.cooper>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.6CC: clalance, drjones, eblake, jdenemar, llim, mkenneth, nobody, prarit, shu, virt-maint, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-21 23:07:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 580948    

Description Alex Jia 2010-10-27 10:07:12 UTC
Description of problem:
Host cpu flags don't exist 'pbe' feature name on rhel5.6 beta with intel x86_64 arch, but virsh cpu-compare still match it and thinks it is identical to host cpu.

Version-Release number of selected component (if applicable):
# uname -r
2.6.18-225.el5

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.6 Beta (Tikanga)

# rpm -qa | grep libvirt
libvirt-0.8.2-6.el5
libvirt-0.8.2-6.el5
libvirt-python-0.8.2-6.el5
libvirt-cim-0.5.8-3.el5

# rpm -q kvm
kvm-83-200.el5


How reproducible:
always

Steps to Reproduce:
1. Using virsh capabilities to get <cpu> ... </cpu> block xml and save to a file cpu.xml
2. Using virsh cpu-compare cpu.xml to match it
  
Actual results:
# virsh capabilities
<capabilities>

  <host>
    <uuid>44ee8208-c1e7-2d88-975a-35148d762a47</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>core2duo</model>
      <topology sockets='1' cores='2' threads='1'/>
      <feature name='lahf_lm'/>
      <feature name='xtpr'/>
      <feature name='cx16'/>
      <feature name='tm2'/>
      <feature name='est'/>
      <feature name='vmx'/>
      <feature name='ds_cpl'/>
      <feature name='pbe'/>
      <feature name='tm'/>
      <feature name='ht'/>
      <feature name='ss'/>
      <feature name='acpi'/>
      <feature name='ds'/>
    </cpu>
......
# cat cpu.xml 
    <cpu>
      <arch>x86_64</arch>
      <model>core2duo</model>
      <topology sockets='1' cores='2' threads='1'/>
      <feature name='lahf_lm'/>
      <feature name='xtpr'/>
      <feature name='cx16'/>
      <feature name='tm2'/>
      <feature name='est'/>
      <feature name='vmx'/>
      <feature name='ds_cpl'/>
      <feature name='pbe'/>
      <feature name='tm'/>
      <feature name='ht'/>
      <feature name='ss'/>
      <feature name='acpi'/>
      <feature name='ds'/>
    </cpu>

# virsh cpu-compare cpu.xml 
CPU described in cpu.xml is identical to host CPU

# grep 'pbe' /proc/cpuinfo;echo $?
1

Expected results:
fix it

Additional info:

# cat /proc/cpuinfo | grep flags | head -1
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 lm constant_tsc pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr lahf_lm

# cat /usr/share/libvirt/cpu_map.xml
<cpus>
  <arch name='x86'>
    <!-- standard features, EDX -->
    ......
    <feature name='pbe'> <!-- CPUID_PBE -->
      <cpuid function='0x00000001' edx='0x80000000'/>
    </feature>
    ......

Comment 1 Jiri Denemark 2010-10-27 10:38:02 UTC
cpu-compare works as expected. The host CPU it compares cpu.xml with is the one from virsh capabilities. So if you take <cpu> element from capabilities and cpu-compare it, the result must be they are identical.

So what you are reporting instead is that virsh capabilities mentions 'pbe' flag while you don't see that in /proc/cpuinfo. I'm pretty confident that's because RHEL-5 kernel doesn't advertise it for some reason. But I won't close this bz as NOTABUG yet. I'll first check if I'm really right.

Comment 4 Jiri Denemark 2010-10-27 13:00:54 UTC
Tested on my machine...
/proc/cpuinfo: 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 lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr sse4_1 lahf_lm

x86info: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflsh ds acpi mmx fxsr sse sse2 ss ht tm pbe sse3 monitor ds-cpl vmx est tm2 ssse3 cx16 xTPR dca

Comment 7 Andrew Jones 2011-01-21 14:01:10 UTC
I just found this bug. It appears to be kvm, not xen, so I'm sending it over there for those guys to resolve the mismatch of cpu flag visibility.

Comment 9 Shaolong Hu 2011-01-30 06:42:43 UTC
Host:RHEL5.6-x86-64
     kernel-2.6.18-237.el5
     kvm-83-224.el5
     libvirt-0.8.2-15.el5

Steps to reproduce:

1. # cat /proc/cpuinfo | grep pbe
     output:nothing
2. # virsh capabilities | grep pbe
     output:<feature name='pbe'/>
3. # x86info | grep pbe
     output: ... sse2 ss ht tm pbe sse3 monitor ds-cpl vmx ...

PS: There is pbe in /proc/cpuinfo with RHEL6.0-x86-64/kernel-2.6.32-94.el6.x86_64 on the same pc.

Comment 12 john cooper 2011-03-21 23:07:56 UTC
Closing as not a bug as I don't find justification to expose this flag
to a guest.  If a case can be made otherwise, feel free to reopen.