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

Table Of Contents
18-68 Vol. 3
DEBUGGING AND PERFORMANCE MONITORING
The service routine can query MSR_PERF_GLOBAL_STATUS to determine which
counter(s) caused of overflow condition. The service routine should clear overflow
indicator by writing to MSR_PERF_GLOBAL_OVF_CTL.
A comparison of the sequence of requirements to program PEBS for processors based
on Intel Core and Intel NetBurst microarchitectures is listed in Table 18-20.
Table 18-20. Requirements to Program PEBS
For Processors based on Intel
Core microarchitecture
For Processors based on Intel
NetBurst microarchitecture
Verify PEBS support of
processor/OS
IA32_MISC_ENABLES.EMON_AVAILABE (bit 7) is set.
IA32_MISC_ENABLES.PEBS_UNAVAILABE (bit 12) is clear.
Ensure counters are in
disabled
On initial set up or changing event
configurations, write
MSR_PERF_GLOBAL_CTRL MSR
(0x38F) with 0.
On subsequent entries:
Clear all counters if “Counter
Freeze on PMI“ is not enabled.
If IA32_DebugCTL.Freeze is
enabled, counters are
automatically disabled.
Counters MUST be stopped before
writing.
1
Optional
Disable PEBS. Clear ENABLE PMC0 bit in
IA32_PEBS_ENABLE MSR
(0x3F1).
Optional
Check overflow
conditions.
Check
MSR_PERF_GLOBAL_STATUS MSR
(0x 38E) handle any overflow
conditions.
Check OVF flag of each CCCR for
overflow condition
Clear overflow status. Clear
MSR_PERF_GLOBAL_STATUS MSR
(0x 38E) using
IA32_PERF_GLOBAL_OVF_CTRL
MSR (0x390).
Clear OVF flag of each CCCR.
Write “sample-after“
values.
Configure the counter(s) with the sample after value.
Configure specific counter
configuration MSR.
Set local enable bit 22 - 1.
Do NOT set local counter
PMI/INT bit, bit 20 - 0.
Event programmed must be
PEBS capable.
Set appropriate OVF_PMI bits -
1.
•Only CCCR for
MSR_IQ_COUNTER4 support
PEBS.