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

Table Of Contents
18-118 Vol. 3
DEBUGGING AND PERFORMANCE MONITORING
18.18.8.5 Other DS Mechanism Implications
The DS mechanism is not available in the SMM. It is disabled on transition to the SMM
mode. Similarly the DS mechanism is disabled on the generation of a machine check
exception and is cleared on processor RESET and INIT.
The DS mechanism is available in real address mode.
18.18.9 Operating System Implications
The DS mechanism can be used by the operating system as a debugging extension to
facilitate failure analysis. When using this facility, a 25 to 30 times slowdown can be
expected due to the effects of the trace store occurring on every taken branch.
Depending upon intended usage, the instruction pointers that are part of the branch
records or the PEBS records need to have an association with the corresponding
process. One solution requires the ability for the DS specific operating system
module to be chained to the context switch. A separate buffer can then be main-
tained for each process of interest and the MSR pointing to the configuration area
saved and setup appropriately on each context switch.
If the BTS facility has been enabled, then it must be disabled and state stored on
transition of the system to a sleep state in which processor context is lost. The state
must be restored on return from the sleep state.
It is required that an interrupt gate be used for the DS interrupt as opposed to a trap
gate to prevent the generation of an endless interrupt loop.
Pages that contain buffers must have mappings to the same physical address for all
processes/logical processors, such that any change to CR3 will not change DS
addresses. If this requirement cannot be satisfied (that is, the feature is enabled on
a per thread/process basis), then the operating system must ensure that the feature
is enabled/disabled appropriately in the context switch code.
18.19 PERFORMANCE MONITORING AND INTEL HYPER-
THREADING TECHNOLOGY IN PROCESSORS BASED
ON INTEL NETBURST MICROARCHITECTURE
The performance monitoring capability of processors based on Intel NetBurst
microarchitecture and supporting Intel Hyper-Threading Technology is similar to that
described in Section 18.18. However, the capability is extended so that:
Performance counters can be programmed to select events qualified by logical
processor IDs.
Performance monitoring interrupts can be directed to a specific logical processor
within the physical processor.