How to Determine Hardware Mode of Intel CPU

Consider the following output:

# grep flags /proc/cpuinfo
flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush
       mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc pni monitor ssse3 lahf_lm

How can you the maximum size of a long that can be used with this CPU? The answer is 64-bit because of the presence of the lm flag.

The following flags can be used to determine the maximum size of a long for a CPU:

  • lm – Long Mode (64 bits)
  • tm – Protected mode (32-bit)
  • rm – Real Mode (16 bits)

If you wish to see the full list of flags returnable by /proc/cpuinfo, look at the header …/arch/x86/include/asm/cpufeature.h in the Linux kernel sources.

Comments are closed.