Intel 64 and IA-32 Architectures Software Developers Manual Volume 3B, System Programming Guide Part 2

Table Of Contents
18-44 Vol. 3
DEBUGGING AND PERFORMANCE MONITORING
18.11.2 IA32_TSC_AUX Register and RDTSCP Support
Processor based on Intel microarchitecture (Nehalem) provides an auxiliary TSC
register, IA32_TSC_AUX that is designed to be used in conjunction with IA32_TSC.
IA32_TSC_AUX provides a 32-bit field that is initialized by privileged software with a
signature value (for example, a logical processor ID).
The primary usage of IA32_TSC_AUX in conjunction with IA32_TSC is to allow soft-
ware to read the 64-bit time stamp in IA32_TSC and signature value in
IA32_TSC_AUX with the instruction RDTSCP in an atomic operation. RDTSCP returns
the 64-bit time stamp in EDX:EAX and the 32-bit TSC_AUX signature value in ECX.
The atomicity of RDTSCP ensures that no context switch can occur between the reads
of the TSC and TSC_AUX values.
Support for RDTSCP is indicated by CPUID.0x80000001.EDX[27]. As with RDTSC
instruction, non-ring 0 access is controlled by CR4.TSD (Time Stamp Disable flag).
User mode software can use RDTSCP to detect if CPU migration has occurred
between successive reads of the TSC. It can also be used to adjust for per-CPU differ-
ences in TSC values in a NUMA system.
18.12 PERFORMANCE MONITORING OVERVIEW
Performance monitoring was introduced in the Pentium processor with a set of
model-specific performance-monitoring counter MSRs. These counters permit selec-
tion of processor performance parameters to be monitored and measured. The infor-
mation obtained from these counters can be used for tuning system and compiler
performance.
In Intel P6 family of processors, the performance monitoring mechanism was
enhanced to permit a wider selection of events to be monitored and to allow greater
control events to be monitored. Next, Pentium 4 and Intel Xeon processors intro-
duced a new performance monitoring mechanism and new set of performance
events.
The performance monitoring mechanisms and performance events defined for the
Pentium, P6 family, Pentium 4, and Intel Xeon processors are not architectural. They
are all model specific (not compatible among processor families). Intel Core Solo and
Intel Core Duo processors support a set of architectural performance events and a
set of non-architectural performance events. Processors based on Intel Core
microarchitecture and Intel Atom microarchitecture support enhanced architectural
performance events and non-architectural performance events.
Starting with Intel Core Solo and Intel Core Duo processors, there are two classes of
performance monitoring capabilities. The first class supports events for monitoring
performance using counting or sampling usage. These events are non-architectural
and vary from one processor model to another. They are similar to those available in
Pentium M processors. These non-architectural performance monitoring events are
specific to the microarchitecture and may change with enhancements. They are