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

Table Of Contents
18-46 Vol. 3
DEBUGGING AND PERFORMANCE MONITORING
Intel Core Solo and Intel Core Duo processors support base level functionality identi-
fied by version ID of 1. Processors based on Intel Core microarchitecture support, at
a minimum, the base level functionality of architectural performance monitoring.
Intel Core 2 Duo processor T 7700 and newer processors based on Intel Core
microarchitecture support both the base level functionality and enhanced architec-
tural performance monitoring identified by version ID of 2.
Intel Atom processor family supports the base level functionality, enhanced architec-
tural performance monitoring identified by version ID of 2 and version ID of 3
(including two general-purpose performance counters, IA32_PMC0, IA32_PMC1).
Intel Core i7 processor family supports the base level functionality, enhanced archi-
tectural performance monitoring identified by version ID of 2 and version ID of 3,
(including four general-purpose performance counters, IA32_PMC0-IA32_PMC3).
18.13.1 Architectural Performance Monitoring Version 1
Configuring an architectural performance monitoring event involves programming
performance event select registers. There are a finite number of performance event
select MSRs (IA32_PERFEVTSELx MSRs). The result of a performance monitoring
event is reported in a performance monitoring counter (IA32_PMCx MSR). Perfor-
mance monitoring counters are paired with performance monitoring select registers.
Performance monitoring select registers and counters are architectural in the
following respects:
Bit field layout of IA32_PERFEVTSELx is consistent across microarchitectures.
Addresses of IA32_PERFEVTSELx MSRs remain the same across microarchitec-
tures.
Addresses of IA32_PMC MSRs remain the same across microarchitectures.
Each logical processor has its own set of IA32_PERFEVTSELx and IA32_PMCx
MSRs. Configuration facilities and counters are not shared between logical
processors sharing a processor core.
Architectural performance monitoring provides a CPUID mechanism for enumerating
the following information:
Number of performance monitoring counters available in a logical processor
(each IA32_PERFEVTSELx MSR is paired to the corresponding IA32_PMCx MSR)
Number of bits supported in each IA32_PMCx
Number of architectural performance monitoring events supported in a logical
processor
Software can use CPUID to discover architectural performance monitoring availability
(CPUID.0AH). The architectural performance monitoring leaf provides an identifier
corresponding to the version number of architectural performance monitoring avail-
able in the processor.
The version identifier is retrieved by querying CPUID.0AH:EAX[bits 7:0] (see
Chapter 3, “Instruction Set Reference, A-M,” in the Intel® 64 and IA-32 Architectures