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

Table Of Contents
18-28 Vol. 3
DEBUGGING AND PERFORMANCE MONITORING
Additional information is saved if an exception or interrupt occurs in conjunction with
a branch instruction. If a branch instruction generates a trap type exception, two
branch records are stored in the LBR stack: a branch record for the branch instruction
followed by a branch record for the exception.
If a branch instruction is immediately followed by an interrupt, a branch record is
stored in the LBR stack for the branch instruction followed by a record for the
interrupt.
18.7.3.1 LBR Stack and Intel
®
64 Processors
LBR MSRs are 64-bits. If IA-32e mode is disabled, only the lower 32-bits of the
address is recorded. If IA-32e mode is enabled, the processor writes 64-bit values
into the MSR.
In 64-bit mode, last branch records store 64-bit addresses; in compatibility mode,
the upper 32-bits of last branch records are cleared.
18.7.4 Monitoring Branches, Exceptions, and Interrupts
When the LBR flag in the MSR_DEBUGCTLA MSR is set, the processor automatically
begins recording branch records for taken branches, interrupts, and exceptions
(except for debug exceptions) in the LBR stack MSRs.
Figure 18-7. LBR MSR Branch Record Layout for the Pentium 4
and Intel Xeon Processor Family
63
From Linear Address
0
To Linear Address
63
From Linear Address
0
0
63
To Linear Address
32 - 31
MSR_LASTBRANCH_0 through MSR_LASTBRANCH_3
CPUID Family 0FH, Models 0H-02H
Reserved
CPUID Family 0FH, Model 03H-04H
Reserved
MSR_LASTBRANCH_0_FROM_LIP through MSR_LASTBRANCH_15_FROM_LIP
32 - 31
32 - 31
MSR_LASTBRANCH_0_TO_LIP through MSR_LASTBRANCH_15_TO_LIP