Most Common Flags Used in /proc/cpuinfo


Overview

We’ll go through some of the features available on the CPU installed on our computer’s motherboard. We’ll briefly look at the concept of virtual file systems before we dive into the details of the topic.

Afterward, we’ll discuss the flags obtained from the /proc/cpuinfo virtual directory for different CPU manufacturers such Intel, AMD, and Arm.

Virtual Files

A virtual file system (VFS) is an abstraction layer that allows us to treat files as if they were stored on a disk drive.

The VFS provides a way to access data without having to know where it actually resides. For example, you can open a text document or image file by specifying its name rather than knowing exactly where it is located.

This approach makes it possible to use multiple operating systems on one machine. The Linux kernel supports this feature natively, but other operating systems may not be able to support it.

A virtual filesystem is a special kind of filesystem available on Linux−powered operating systems. By reading them, we can see what’s going on inside the Linux kernel. They're kind of lenses through which you can look into the running Linux kernel. Unlike a regular document, virtual documents don't take up space on the hard drive and are only created when they're opened.

Most Linux distros store virtual files in the /proc directory We may need root privileges to read some of the files stored in the virtual environment. Let’s take a look at what’s inside our /proc directory −

# ls -halF /proc
total 4.0K
-r--r--r-- 1 root root 56K Dec 02 00:18 config.gz
-r--r--r-- 1 root root 0 Dec 02 00:18 consoles
-r--r--r-- 1 root root 0 Dec 02 00:14 cpuinfo
-r--r--r-- 1 root root 0 Dec 02 00:14 devices
-r--r--r-- 1 root root 0 Dec 02 00:18 diskstats
-r--r--r-- 1 root root 0 Dec 02 00:18 filesystems
dr-xr-xr-x 5 root root 0 Dec 02 00:18 fs/
-r--r--r-- 1 root root 0 Dec 02 00:18 vmstat
-r--r--r-- 1 root root 0 Dec 02 00:18 zoneinfo

The command will list lots of files, but we're only interested in the cpuinfofile, which happens to be located inside the base folder.

/proc/cpuinfo Virtual File

System

The /proc/cpuinfo file contains information about all CPUs present on the system. This includes basic hardware information such as processor type, number of cores, cache size, etc.

It also shows various flags related to the CPU. These include −

  • Flags

  • Description

  • Cores

  • Number of physical cores

  • Threads per core

  • Maximum threads supported

  • Cache size, etc.

# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 94
model name : Intel(R) Celeron(R) CPU G3900 @ 2.80GHz
stepping : 3
microcode : 0xea
cpu MHz : 899.999
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 22
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 pbe syscall nx pdpe1gb rdtscp lm 
constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc 
cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg 
cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes 
xsave rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd 
ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase 
tsc_adjust erms invpcid rdseed smap clflushopt intel_pt xsaveopt xsavec xgetbv1 
xsaves dtherm arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
vmx flags : vnmi preemption_timer invvpid ept_x_only ept_ad ept_1gb flexpriority tsc_offset vtpr mtf 
vapic ept vpid unrestricted_guest ple pml
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds
bogomips : 5599.85
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual

We can see that it printed out our CPU’s specifications including the flags field. Next, let’s take a closer peek at some of the important features that can help us understand exactly what our CPU can do for us.

Common Intel-Defined Flags

The most common flags are defined by Intel and appear in many other processors are listed below.

lm

The lm flag means that our CPU has support for 64−bit architecture. Because of that, any x86−based 64−bit CPU has this flag set, whereas the 32−bit CPU doesn't.

vmx and svm

The Vmx (Virtual Machine Extension), indicates that our Intel CPU supports virtual machines. Virtual machine software like VMWare uses this feature for improved performance and other enhancements.

On the one hand, the svm (scalable vector machines) flag works just like the sse2 flag, but it’ll only be available for AMD processors.

smx

On 64−bit processors, the SMX (Safe Mode Extensions) feature is available. It’s an API (application program interface) for enforcing security policies in Intel TXT platforms. This feature allows you to restrict access to certain memory locations or prevent execution of code from specific sources.

hypervisor

The hypervisor bit indicates whether the CPU supports running multiple operating systems at once. A virtual computer is software that runs and controls virtual computers. There are some popular virtual machines available including VirtualBox and VMware.

If a CPU doesn't have these flags, it's highly likely that it won't have the vmx or SVM flag either.

pae

PAE stands for Physical Address Extension. It’s a technology used on modern CPUs that allow them to use more than 4GB of RAM. PAE enables your system to address up to 64 GB of RAM.

pn

Every Intel® Core™ i7 processor has a unique serial code called PN, which stands for “Processor Serial Code.” This serial code is unique to each processor and is often referred to as its “PN” or “processor serial code.”

acpi

This flag tells us if our CPU supports ACPI (Advanced Configuration and Power Interface). The acronym stands for Advanced Configuration and Power Interface. ACPI is a standard developed by Microsoft and Intel that defines how devices communicate with the OS.

sse

Streaming SIMD Extensions (SSE) is an addition to the instruction set of Intel−based processors. SIMD stands for single instruction multiple data. The SSE allows our CPUs to handle multiple data types at once, which increases their performance by allowing them to perform tasks simultaneously. It’ s mainly applied in process−intensive apps like 3D graphics, Computer Vision, and Digital Signal Processing.

sse2

The second generation of Streaming SIMD Extensions (Sse2) is another enhancement to the instruction set of the Intel−based processors. SSE2 adds new instructions that improve the performance of multimedia applications such as video encoding and decoding, image processing, and audio coding.

sse3

SSE3 stands for Streaming SIMD Extensions 3. These extensions are designed to improve multimedia applications. For example, they can accelerate video encoding and decoding.

sse4_1 and sse4_2

These two flags indicate that our CPU supports Streaming SIMD Extensions 4.1 and 4.2 respectively. They enable faster multimedia applications.

ht

The HT (Hyper Threading) flag indicates that we have two logical CPUs on a single physical processor. Hyperthreading helps improve performance because multiple threads can run simultaneously.

tm

This flag indicates that our CPU supports TM (Transactional Memory). Transactional memory is a new programming model that enables programmers to write concurrent programs without worrying about data races. The TM feature lets developers use transactional memory to make sure that all instructions execute atomically.

pdcm

The PDCM flag in Intel CPUs stands for Performance and Debugging Control Mode MSR. MSRs are registers that store specific values for each type of processor instruction. A special debug register can be used for various purposes including code trace, benchmarking, and performance monitoring.

Common AMD-Defined Flags

AMD also uses some of these flags −

mp

The MP flag means Multi Processors. It’s an indicator that our CPU has more than one core.

avx

AVX stands for Advanced Vector eXtensions. AVX is a new instruction set extension that improves the performance of certain algorithms.

fma

FMA stands for Floating Point Multiply Add. FMA is a floating point operation that combines multiplication and addition into a single instruction.

lm

LM stands for Lockless Multithreading. LM is a new technology that makes it possible to run multiple threads on a single core.

mmx

MMX stands for Multiple Precision eXtensions. MMX is a set of instructions that were introduced in 1996.

abm

ABM stands for Address Based Mapping. ABM is a technique that maps virtual addresses to physical addresses.

sse4a

SSE4A stands for Streaming SIMD Extension 4.0. This extension was released in 2011.

Common ARM-Defined Flags

ARM defines its own flags. Here are some common ones −

26bit

The 26 bit wide data indicates whether the processor supports 26−bit wide data transfers. This feature is not available in the new ARM processors.

java

The java flag in ARM processors indicates the Jazelle DBX extension. The Java Virtual Machine (JVM) takes advantage of this extension to carry out hardware−accelerated bytecode execution, thus, allowing our programs to perform faster.

neon

This flag is also called Advanced SIMD Extension. It accelerates media and digital signal processing applications such as video game and camera apps. On 32−bit Arm Cortex A8 processors, it will be signaled by the NE10 flag; on 64−bit Arm Cortex A9 processors, it will be signalled by the ASIMD flag.

It should be noted that even though the older Linux kernel versions may not support SSE2 instructions, they will still show up if the asimd flag is set.

lpae

The lpae (large page address extension) option tells us that our processor supports large pages, which allow us to have more than four gigabytes of physical memory on 32bits processors.

thumb

Thumb is an architecture supported by some of the x86 processors. Thumb instructions are 8 bits wide and allow for programs to run faster if our physical memory (RAM) is slower than we'd like.

Linux-defined Flags

There are many other types of flags that you might see in your /proc/cpuinfo file. These include −

tsc_reliable

TSC stands for time stamp counter, which measures the number of CPU clock ticks since its reset. This bit tells us whether the TSC register is reliable. This flag is used because TSC cannot be trusted when a system has multi core processors since there is no guarantee that the counter for multiple cores will be synchronized.

acc_power

The ACCPOWER flag on AMD CPUs indicates that our CPU can report its accumulated power usage. It’s called ACCUMULATED POWER REPORTING MECHANISM.

Conclusion

We've learned about the concept of virtual files, and what the /proc cpuinfo virtual filesystem is about. Afterwards, we looked at some of the important flags that can be found in the /proc/cpuinfofile.

We looked at Intel−defined flag types alongside AMD and ARM−defined flag types. We've gone through a few flags that Linux itself sets.

Updated on: 23-Dec-2022

783 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements