Bug 570091 - cpu flags missing from /proc/cpuinfo
cpu flags missing from /proc/cpuinfo
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel-xen (Show other bugs)
5.5
All Linux
low Severity medium
: rc
: ---
Assigned To: Andrew Jones
chen yuwen
: Reopened, ZStream
: 592114 (view as bug list)
Depends On:
Blocks: 624365
  Show dependency treegraph
 
Reported: 2010-03-03 04:13 EST by Andrew Jones
Modified: 2011-01-13 15:37 EST (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-01-13 15:37:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to unmask the VMXE flag (1.37 KB, patch)
2010-05-19 17:22 EDT, Andrew Jones
no flags Details | Diff
don't mask out VMXE or SVME flags (1.73 KB, patch)
2010-05-20 10:56 EDT, Andrew Jones
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0017 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.6 kernel security and bug fix update 2011-01-13 05:37:42 EST

  None (edit)
Description Andrew Jones 2010-03-03 04:13:00 EST
/proc/cpuinfo does not show all cpu flags it should on Xen kernels since 2.6.18-169.el5xen. Something lost them between -169 and -170. The most likely culprit is 

commit 11f0c52afb7b122f8f5e9e4d79288e03b7c56c9b
Author: John Villalovos <jvillalo@redhat.com>
Date:   Fri Oct 9 11:24:27 2009 -0400

    [x86] support always running Local APIC

but it's not clear how. So possibly a finer grained bisection is needed to identify the patch that lost the flags.
Comment 1 Andrew Jones 2010-03-03 06:30:34 EST
Ah this isn't a kernel bug, so the culprit identified in the description is free and clear. This is an HV issue. Between -169 and -170 we masked out several CPUIDs that were problematic for guests running later kernels. Now no guests (including dom0) will see that these features exist, even when they do. So, while this is might be an unexpected new behaviour, it's not really a bug. Really, it would be nice to have these features masked, but also be able to see they exist from dom0's /proc/cpuinfo.
Comment 2 Andrew Jones 2010-03-03 08:04:50 EST
On second thought, it's not necessary for dom0's cpuinfo to reflect the real proc. dmidecode can already show this information. Closing this as not a bug.
Comment 3 Simon Gao 2010-03-04 21:50:24 EST
This still does not work even with dmidecode. The dmidecode result as follow:
The report by dmidecode is consistent with /proc/cpuinfo.  So this needs to be fixed. There got be some reason why this vmx is missing.


# /usr/sbin/dmidecode -t processor

# dmidecode 2.10
SMBIOS 2.6 present.

Handle 0x0400, DMI type 4, 40 bytes
Processor Information
        Socket Designation: CPU1
        Type: Central Processor
        Family: Xeon
        Manufacturer: Intel
        ID: A5 06 01 00 FF FB EB BF
        Signature: Type 0, Family 6, Model 26, Stepping 5
        Flags:
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (Time stamp counter)
                MSR (Model specific registers)
                PAE (Physical address extension)
                MCE (Machine check exception)
                CX8 (CMPXCHG8 instruction supported)
                APIC (On-chip APIC hardware supported)
                SEP (Fast system call)
                MTRR (Memory type range registers)
                PGE (Page global enable)
                MCA (Machine check architecture)
                CMOV (Conditional move instruction supported)
                PAT (Page attribute table)
                PSE-36 (36-bit page size extension)
                CLFSH (CLFLUSH instruction supported)
                DS (Debug store)
                ACPI (ACPI supported)
                MMX (MMX technology supported)
                FXSR (Fast floating-point save and restore)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
                SS (Self-snoop)
                HTT (Hyper-threading technology)
                TM (Thermal monitor supported)
                PBE (Pending break enabled)
        Version: Intel(R) Xeon(R) CPU           E5520  @ 2.27GHz
        Voltage: 1.2 V
        External Clock: 5860 MHz
        Max Speed: 3600 MHz
        Current Speed: 2266 MHz
        Status: Populated, Enabled
        Upgrade: Socket LGA1366
        L1 Cache Handle: 0x0700
        L2 Cache Handle: 0x0701
        L3 Cache Handle: 0x0702
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Part Number: Not Specified
        Core Count: 4
        Core Enabled: 4
        Thread Count: 8
        Characteristics:
                64-bit capable

Handle 0x0401, DMI type 4, 40 bytes
Processor Information
        Socket Designation: CPU2
        Type: Central Processor
        Family: Xeon
        Manufacturer: Intel
        ID: A5 06 01 00 FF FB EB BF
        Signature: Type 0, Family 6, Model 26, Stepping 5
        Flags:
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (Time stamp counter)
                MSR (Model specific registers)
                PAE (Physical address extension)
                MCE (Machine check exception)
                CX8 (CMPXCHG8 instruction supported)
                APIC (On-chip APIC hardware supported)
                SEP (Fast system call)
                MTRR (Memory type range registers)
                PGE (Page global enable)
                MCA (Machine check architecture)
                CMOV (Conditional move instruction supported)
                PAT (Page attribute table)
                PSE-36 (36-bit page size extension)
                CLFSH (CLFLUSH instruction supported)
                DS (Debug store)
                ACPI (ACPI supported)
                MMX (MMX technology supported)
                FXSR (Fast floating-point save and restore)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
                SS (Self-snoop)
                HTT (Hyper-threading technology)
                TM (Thermal monitor supported)
                PBE (Pending break enabled)
        Version: Intel(R) Xeon(R) CPU           E5520  @ 2.27GHz
        Voltage: 1.2 V
        External Clock: 5860 MHz
        Max Speed: 3600 MHz
        Current Speed: 2266 MHz
        Status: Populated, Idle
        Upgrade: Socket LGA1366
        L1 Cache Handle: 0x0703
        L2 Cache Handle: 0x0704
        L3 Cache Handle: 0x0705
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Part Number: Not Specified
        Core Count: 4
        Core Enabled: 4
        Thread Count: 8
        Characteristics:
                64-bit capable
Comment 4 Simon Gao 2010-03-04 21:53:20 EST
The hardware is Dell R710 server.
Comment 5 Andrew Jones 2010-03-05 04:13:52 EST
On my system dmidecode gives the same output for a bare-metal -164 kernel that it does for a xen -190 kernel. While it's true that vmx isn't there, I have these extra flags from dmidecode that we've lost from cpuinfo after masking out the features

                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                MCE (Machine check exception)
                SEP (Fast system call)
                PGE (Page global enable)
                MCA (Machine check architecture)
                PSE-36 (36-bit page size extension)
                DS (Debug store)
                TM (Thermal monitor supported)
                PBE (Pending break enabled)

I'm afraid the best we'll be able to do for the case that someone gets on a machine they are unfamiliar with, and needs to check capabilities that dmidecode doesn't report (and some heuristic, e.g. cpu model + bios revision, for guessing isn't sufficient), is to just reboot to BIOS or to a bare-metal kernel.

It's not a crazy idea to have a cpu cap field output from 'xm info', but we would need a feature request for that, since the lack of it isn't a bug.
Comment 8 Andrew Jones 2010-05-13 21:28:05 EDT
*** Bug 592114 has been marked as a duplicate of this bug. ***
Comment 9 Paolo Bonzini 2010-05-14 11:54:07 EDT
dmidecode only shows a limited "choice" of CPUID flags, see dmi_processor_id:

	/*
	 * Extra flags are now returned in the ECX register when one calls
	 * the CPUID instruction. Their meaning is explained in table 3-5, but
	 * DMI doesn't support this yet.
	 */

http://cvs.savannah.gnu.org/viewvc/dmidecode/dmidecode.c?revision=1.144&root=dmidecode&view=markup
Comment 10 John Villalovos 2010-05-14 13:27:53 EDT
As a note.  x86info is probably a better program to use than dmidecode for seeing CPU flag values.
Comment 11 Andrew Jones 2010-05-19 13:06:10 EDT
I'm reopening this bug in order to use it for bringing back the vmx flag. While bringing back that flag allows guest admins to shoot themselves in the foot, it shouldn't cause other problems. Too many scripts are used to this flag being there, so we should keep it. Note, however that as Paolo wrote in bug 576497, comment 21 we can get this information without /proc/cpuinfo as follows

if grep -q hvm /sys/hypervisor/properties/capabilities; then
  echo 'HVM supported (xen)'
elif grep -qe vmx -e svm /proc/cpuinfo; then
  echo 'HVM supported (KVM)'
else
  echo 'HVM not supported'
fi
Comment 12 Andrew Jones 2010-05-19 17:22:41 EDT
Created attachment 415267 [details]
patch to unmask the VMXE flag
Comment 13 RHEL Product and Program Management 2010-05-20 08:42:46 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 14 Andrew Jones 2010-05-20 10:56:11 EDT
Created attachment 415441 [details]
don't mask out VMXE or SVME flags

Forgot the SVME flag for AMD machines, unmask it as well.
Comment 16 Jarod Wilson 2010-06-14 14:22:53 EDT
in kernel-2.6.18-203.el5
You can download this test kernel from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.
Comment 20 chen yuwen 2010-10-09 01:54:46 EDT
Verification environment:
hp-bl685cg6-01.rhts.eng.bos.redhat.com
CPU	: Quad-Core AMD Opteron(tm) Processor 8389

Reproduced on 2.6.18-194.el5xen.

#cat /proc/cpuinfo | grep -m 1 "flag"
flags		: fpu tsc msr pae cx8 apic mtrr cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow constant_tsc pni cx16 popcnt lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse

Flag "svm" does not exist.

Verified on 2.6.18-226.el5xen.

#cat /proc/cpuinfo | grep -m 1 "flag"
flags		: fpu tsc msr pae cx8 apic mtrr cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow constant_tsc pni cx16 popcnt lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse
Comment 22 errata-xmlrpc 2011-01-13 15:37:35 EST
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-0017.html

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