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

Table Of Contents
Vol. 3 18-23
DEBUGGING AND PERFORMANCE MONITORING
MSR_DEBUGCTLA MSR — Enables last branch, interrupt, and exception
recording; single-stepping on taken branches; branch trace messages (BTMs);
and branch trace store (BTS). This register is named DebugCtlMSR in the P6
family processors.
Debug store (DS) feature flag (CPUID.1:EDX.DS[bit 21]) — Indicates that
the processor provides the debug store (DS) mechanism, which allows BTMs to
be stored in a memory-resident BTS buffer.
CPL-qualified debug store (DS) feature flag (CPUID.1:ECX.DS-CPL[bit
4]) — Indicates that the processor provides a CPL-qualified debug store (DS)
mechanism, which allows software to selectively skip sending and storing BTMs,
according to specified current privilege level settings, into a memory-resident
BTS buffer.
IA32_MISC_ENABLE MSR — Indicates that the processor provides the BTS
facilities.
Last branch record (LBR) stack — The LBR stack is a circular stack that
consists of four MSRs (MSR_LASTBRANCH_0 through MSR_LASTBRANCH_3) for
the Pentium 4 and Intel Xeon processor family [CPUID family 0FH, models 0H-
02H]. The LBR stack consists of 16 MSR pairs (MSR_LASTBRANCH_0_FROM_LIP
through MSR_LASTBRANCH_15_FROM_LIP and MSR_LASTBRANCH_0_TO_LIP
through MSR_LASTBRANCH_15_TO_LIP) for the Pentium 4 and Intel Xeon
processor family [CPUID family 0FH, model 03H].
Last branch record top-of-stack (TOS) pointer — The TOS Pointer MSR
contains a 2-bit pointer (0-3) to the MSR in the LBR stack that contains the most
recent branch, interrupt, or exception recorded for the Pentium 4 and Intel Xeon
processor family [CPUID family 0FH, models 0H-02H]. This pointer becomes a
4-bit pointer (0-15) for the Pentium 4 and Intel Xeon processor family [CPUID
family 0FH, model 03H]. See also: Table 18-7, Figure 18-6, and Section 18.7.3,
“LBR Stack for Processors Based on Intel NetBurst Microarchitecture.
Last exception record — See Section 18.7.7, “Last Exception Records.
18.7.1 CPL-Qualified Branch Trace Mechanism
CPL-qualified branch trace mechanism is available to a subset of Intel 64 and IA-32
processors that support the branch trace storing mechanism. The processor supports
the CPL-qualified branch trace mechanism if CPUID.01H:ECX[bit 4] = 1.
The CPL-qualified branch trace mechanism is described in Section 18.7.8.4. System
software can selectively specify CPL qualification to not send/store Branch Trace
Messages associated with a specified privilege level. Two bit fields, BTS_OFF_USR
and BTS_OFF_OS, are provided in the debug control register to specify the CPL of
BTMs that will not be logged in the BTS buffer or sent on the bus.