background image

36-12 Vol. 3C

INTEL® PROCESSOR TRACE

ToPA STOP

Each ToPA entry has a STOP bit. If this bit is set, the processor will set the IA32_RTIT_STATUS.Stopped bit when 
the corresponding trace output region is filled. This will clear TriggerEn and thereby cease packet generation. See 
Section 36.2.7.4 for details on IA32_RTIT_STATUS.Stopped. This sequence is known as “ToPA Stop”.
No TIP.PGD packet will be seen in the output when the ToPA stop occurs, since the disable happens only when the 
region is already full. When this occurs, output ceases after the last byte of the region is filled, which may mean 
that a packet is cut off in the middle. Any packets remaining in internal buffers are lost and cannot be recovered. 
When ToPA stop occurs, the IA32_RTIT_OUTPUT_BASE MSR will hold the base address of the table whose entry 
had STOP=1. IA32_RTIT_OUTPUT_MASK_PTRS.MaskOrTableOffset will hold the index value for that entry, and the 
IA32_RTIT_OUTPUT_MASK_PTRS.OutputOffset should be set to the size of the region. 
Note that this means the offset pointer is pointing to the next byte after the end of the region, a configuration that 
would produce an operational error if the configuration remained when tracing is re-enabled with 
IA32_RTIT_STATUS.Stopped cleared. 

ToPA PMI

Each ToPA entry has an INT bit. If this bit is set, the processor will signal a performance-monitoring interrupt (PMI) 
when the corresponding trace output region is filled. This interrupt is not precise, and it is thus likely that writes to 
the next region will occur by the time the interrupt is taken.
The following steps should be taken to configure this interrupt:
1. Enable PMI via the LVT Performance Monitor register (at MMIO offset 340H in xAPIC mode; via MSR 834H in 

x2APIC mode). See Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 3B for more 
details on this register. For ToPA PMI, set all fields to 0, save for the interrupt vector, which can be selected by 
software.

2. Set up an interrupt handler to service the interrupt vector that a ToPA PMI can raise.
3. Set the interrupt flag by executing STI.
4. Set the INT bit in the ToPA entry of interest and enable packet generation, using the ToPA output option. Thus, 

TraceEn=ToPA=1 in the IA32_RTIT_CTL MSR.

Once the INT region has been filled with packet output data, the interrupt will be signaled. This PMI can be distin-
guished from others by checking bit 55 (Trace_ToPA_PMI) of the IA32_PERF_GLOBAL_STATUS MSR (MSR 38EH). 
Once the ToPA PMI handler has serviced the relevant buffer, writing 1 to bit 55 of the MSR at 390H 
(IA32_GLOBAL_STATUS_RESET) clears IA32_PERF_GLOBAL_STATUS.Trace_ToPA_PMI.

Size

Indicates the size of the associated output region. Encodings are:

0: 4K, 1: 8K, 

2: 16K, 

3: 32K, 

4: 64K, 

5: 128K, 

6: 256K, 

7: 512K, 

8: 1M, 9: 2M, 

10: 4M, 

11: 8M, 

12: 16M,

13: 32M,  14: 64M,  15: 128M

This field is ignored if END=1.

STOP

When the output region indicated by this entry is filled, software should disable packet generation. This will be 

accomplished by setting IA32_RTIT_STATUS.Stopped, which clears TriggerEn. This bit must be 0 if END=1; oth-

erwise it is treated as reserved bit violation (see ToPA Errors).

INT

When the output region indicated by this entry is filled, signal Perfmon LVT interrupt. 

Note that if both INT and STOP are set in the same entry, the STOP will happen before the INT. Thus the inter-

rupt handler should expect that the IA32_RTIT_STATUS.Stopped bit will be set, and will need to be reset before 

tracing can be resumed.

This bit must be 0 if END=1; otherwise it is treated as reserved bit violation (see ToPA Errors).

END

If set, indicates that this is an END entry, and thus the address field points to a table base rather than an output 

region base.

If END=1, INT and STOP must be set to 0; otherwise it is treated as reserved bit violation (see ToPA Errors). The 

Size field is ignored in this case.

If the processor supports only a single ToPA output region (see above), END must be set in the second table 

entry.

Table 36-3. ToPA Table Entry Fields (Contd.)

ToPA Entry Field

Description