TianoCore EDK2 master
Loading...
Searching...
No Matches
ProcTrace.c File Reference

Go to the source code of this file.

Data Structures

struct  PROC_TRACE_PROCESSOR_DATA
 
struct  PROC_TRACE_DATA
 
struct  PROC_TRACE_TOPA_TABLE
 

Macros

#define MAX_TOPA_ENTRY_COUNT   2
 

Enumerations

enum  RTIT_OUTPUT_SCHEME { RtitOutputSchemeSingleRange = 0 , RtitOutputSchemeToPA }
 

Functions

VOID *EFIAPI ProcTraceGetConfigData (IN UINTN NumberOfProcessors)
 
BOOLEAN EFIAPI ProcTraceSupport (IN UINTN ProcessorNumber, IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo, IN VOID *ConfigData OPTIONAL)
 
RETURN_STATUS EFIAPI ProcTraceInitialize (IN UINTN ProcessorNumber, IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo, IN VOID *ConfigData OPTIONAL, IN BOOLEAN State)
 

Detailed Description

Intel Processor Trace feature.

Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file ProcTrace.c.

Macro Definition Documentation

◆ MAX_TOPA_ENTRY_COUNT

#define MAX_TOPA_ENTRY_COUNT   2

This macro define the max entries in the Topa table. Each entry in the table contains some attribute bits, a pointer to an output region, and the size of the region. The last entry in the table may hold a pointer to the next table. This pointer can either point to the top of the current table (for circular array) or to the base of another table. At least 2 entries are needed because the list of entries must be terminated by an entry with the END bit set to 1, so 2 entries are required to use a single valid entry.

Definition at line 20 of file ProcTrace.c.

Enumeration Type Documentation

◆ RTIT_OUTPUT_SCHEME

Processor trace output scheme selection.

Definition at line 25 of file ProcTrace.c.

Function Documentation

◆ ProcTraceGetConfigData()

VOID *EFIAPI ProcTraceGetConfigData ( IN UINTN  NumberOfProcessors)

Prepares for the data used by CPU feature detection and initialization.

Parameters
[in]NumberOfProcessorsThe number of CPUs in the platform.
Returns
Pointer to a buffer of CPU related configuration data.
Note
This service could be called by BSP only.

Definition at line 71 of file ProcTrace.c.

◆ ProcTraceInitialize()

RETURN_STATUS EFIAPI ProcTraceInitialize ( IN UINTN  ProcessorNumber,
IN REGISTER_CPU_FEATURE_INFORMATION CpuInfo,
IN VOID *ConfigData  OPTIONAL,
IN BOOLEAN  State 
)

Initializes Intel Processor Trace feature to specific state.

Parameters
[in]ProcessorNumberThe index of the CPU executing this function.
[in]CpuInfoA pointer to the REGISTER_CPU_FEATURE_INFORMATION structure for the CPU executing this function.
[in]ConfigDataA pointer to the configuration buffer returned by CPU_FEATURE_GET_CONFIG_DATA. NULL if CPU_FEATURE_GET_CONFIG_DATA was not provided in RegisterCpuFeature().
[in]StateIf TRUE, then the Processor Trace feature must be enabled. If FALSE, then the Processor Trace feature must be disabled.
Return values
RETURN_SUCCESSIntel Processor Trace feature is initialized.

Clear bit 0 in MSR IA32_RTIT_CTL (570)

Clear MSR IA32_RTIT_STS (571h) to all zeros

Refer to PROC_TRACE_MEM_SIZE Table for Size Encoding

Check Processor Trace output scheme: Single Range output or ToPA table

Enable the Processor Trace feature from MSR IA32_RTIT_CTL (570h)

Definition at line 176 of file ProcTrace.c.

◆ ProcTraceSupport()

BOOLEAN EFIAPI ProcTraceSupport ( IN UINTN  ProcessorNumber,
IN REGISTER_CPU_FEATURE_INFORMATION CpuInfo,
IN VOID *ConfigData  OPTIONAL 
)

Detects if Intel Processor Trace feature supported on current processor.

Parameters
[in]ProcessorNumberThe index of the CPU executing this function.
[in]CpuInfoA pointer to the REGISTER_CPU_FEATURE_INFORMATION structure for the CPU executing this function.
[in]ConfigDataA pointer to the configuration buffer returned by CPU_FEATURE_GET_CONFIG_DATA. NULL if CPU_FEATURE_GET_CONFIG_DATA was not provided in RegisterCpuFeature().
Return values
TRUEProcessor Trace feature is supported.
FALSEProcessor Trace feature is not supported.
Note
This service could be called by BSP/APs.

Definition at line 109 of file ProcTrace.c.