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

Table Of Contents
18-62 Vol. 3
DEBUGGING AND PERFORMANCE MONITORING
18.15.1 Fixed-function Performance Counters
Processors based on Intel Core microarchitecture provide three fixed-function perfor-
mance counters. Bits beyond the width of the fixed counter are reserved and must be
written as zeros. Model-specific fixed-function performance counters on processors
that support Architectural Perfmon version 1 are 40 bits wide.
Each of the fixed-function counter is dedicated to count a pre-defined performance
monitoring events. The performance monitoring events associated with fixed-func-
tion counters and the addresses of these counters are listed in Table 18-17.
Programming the fixed-function performance counters does not involve any of the
IA32_PERFEVTSELx MSRs, and does not require specifying any event masks.
Instead, the MSR MSR_PERF_FIXED_CTR_CTRL provides multiple sets of 4-bit fields;
each 4-bit field controls the operation of a fixed-function performance counter (PMC).
See Figures 18-21. Two sub-fields are defined for each control. See Figure 18-21; bit
fields are:
Enable field (low 2 bits in each 4-bit control) — When bit 0 is set,
performance counting is enabled in the corresponding fixed-function
performance counter to increment when the target condition associated with the
architecture performance event occurs at ring 0.
When bit 1 is set, performance counting is enabled in the corresponding fixed-
function performance counter to increment when the target condition associated
with the architecture performance event occurs at ring greater than 0.
Writing 0 to both bits stops the performance counter. Writing 11B causes the
counter to increment irrespective of privilege levels.
Table 18-17. Association of Fixed-Function Performance Counters with
Architectural Performance Events
Event Name Fixed-Function PMC PMC Address
INSTR_RETIRED.ANY MSR_PERF_FIXED_CTR0/I
A32_FIXED_CTR0
309H
CPU_CLK_UNHALTED.CORE MSR_PERF_FIXED_CTR1//
IA32_FIXED_CTR1
30AH
CPU_CLK_UNHALTED.REF MSR_PERF_FIXED_CTR2//
IA32_FIXED_CTR2
30BH