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

Table Of Contents
18-26 Vol. 3
DEBUGGING AND PERFORMANCE MONITORING
18.7.2 MSR_DEBUGCTLA MSR
The MSR_DEBUGCTLA MSR enables and disables the various last branch recording
mechanisms described in the previous section. This register can be written to using
the WRMSR instruction, when operating at privilege level 0 or when in real-address
mode. A protected-mode operating system procedure is required to provide user
access to this register. Figure 18-6 shows the flags in the MSR_DEBUGCTLA MSR.
The functions of these flags are as follows:
LBR (last branch/interrupt/exception) flag (bit 0) — When set, the
processor records a running trace of the most recent branches, interrupts, and/or
exceptions taken by the processor (prior to a debug exception being generated)
in the last branch record (LBR) stack. Each branch, interrupt, or exception is
recorded as a 64-bit branch record. The processor clears this flag whenever a
debug exception is generated (for example, when an instruction or data
breakpoint or a single-step trap occurs). See Section 18.7.3, “LBR Stack for
Processors Based on Intel NetBurst Microarchitecture.
BTF (single-step on branches) flag (bit 1) When set, the processor treats
the TF flag in the EFLAGS register as a “single-step on branches” flag rather than
a “single-step on instructions” flag. This mechanism allows single-stepping the
processor on taken branches, interrupts, and exceptions. See Section 18.7.5,
“Single-Stepping on Branches, Exceptions, and Interrupts.
TR (trace message enable) flag (bit 2) When set, branch trace messages
are enabled. Thereafter, when the processor detects a taken branch, interrupt, or
exception, it sends the branch record out on the system bus as a branch trace
message (BTM). See Section 18.7.6, “Branch Trace Messages.
BTS (branch trace store) flag (bit 3) When set, enables the BTS facilities to
log BTMs to a memory-resident BTS buffer that is part of the DS save area. See
Section 18.18.5, “DS Save Area.
Figure 18-6. MSR_DEBUGCTLA MSR for Pentium 4 and Intel Xeon Processors
31
TR — Trace messages enable
BTINT — Branch trace interrupt
BTF — Single-step on branches
LBR — Last branch/interrupt/exception
543
2
1
0
BTS — Branch trace store
Reserved
67
BTS_OFF_OS — Disable storing CPL_0 BTS
BTS_OFF_USR — Disable storing non-CPL_0 BTS