background image

17-44 Vol. 3B

DEBUG, BRANCH PROFILE, TSC, AND RESOURCE MONITORING FEATURES

17.16.3  Enumeration and Detecting Support of Cache Monitoring Technology and Memory 

Bandwidth Monitoring

Software can query processor support of shared resource monitoring features capabilities by executing CPUID 
instruction with EAX = 07H, ECX = 0H as input. If CPUID.(EAX=07H, ECX=0):EBX.PQM[bit 12] reports 1, the 
processor provides the following programming interfaces for shared resource monitoring, including Cache Moni-
toring Technology:

CPUID leaf function 0FH (Shared Resource Monitoring Enumeration leaf) provides information on available 
resource types (see Section 17.16.4), and monitoring capabilities for each resource type (see Section 17.16.5). 
Note CMT and MBM capabilities are enumerated as separate event vectors using shared enumeration infra-
structure under a given resource type.

IA32_PQR_ASSOC.RMID: The per-logical-processor MSR, IA32_PQR_ASSOC, that OS/VMM can use to assign 
an RMID to each logical processor, see Section 17.16.6.

IA32_QM_EVTSEL: This MSR specifies an Event ID (EvtID) and an RMID which the platform uses to look up and 
provide monitoring data in the monitoring counter, IA32_QM_CTR, see Section 17.16.7. 

IA32_QM_CTR: This MSR reports monitored resource data when available along with bits to allow software to 
check for error conditions and verify data validity. 

Software must follow the following sequence of enumeration to discover Cache Monitoring Technology capabilities:
1. Execute CPUID with EAX=0 to discover the “cpuid_maxLeaf” supported in the processor;
2. If cpuid_maxLeaf >= 7, then execute CPUID with EAX=7, ECX= 0 to verify CPUID.(EAX=07H, 

ECX=0):EBX.PQM[bit 12] is set;

3. If CPUID.(EAX=07H, ECX=0):EBX.PQM[bit 12] = 1, then execute CPUID with EAX=0FH, ECX= 0 to query 

available resource types that support monitoring;

4. If CPUID.(EAX=0FH, ECX=0):EDX.L3[bit 1] = 1, then execute CPUID with EAX=0FH, ECX= 1 to query the 

specific capabilities of L3 Cache Monitoring Technology (CMT) and Memory Bandwidth Monitoring.

5. If CPUID.(EAX=0FH, ECX=0):EDX reports additional resource types supporting monitoring, then execute 

CPUID with EAX=0FH, ECX set to a corresponding resource type ID (ResID) as enumerated by the bit position 
of CPUID.(EAX=0FH, ECX=0):EDX.

17.16.4  Monitoring Resource Type and Capability Enumeration

CPUID leaf function 0FH (Shared Resource Monitoring Enumeration leaf) provides one sub-leaf (sub-function 0) 
that reports shared enumeration infrastructure, and one or more sub-functions that report feature-specific 
enumeration data:

Monitoring leaf sub-function 0 enumerates available resources that support monitoring, i.e. executing CPUID 
with EAX=0FH and ECX=0H. In the initial implementation, L3 cache is the only resource type available. Each 

Figure 17-19.  Platform Shared Resource Monitoring Usage Flow

CPUID.(7,0):EBX.12

On OS/VMM Initialization

CPUID.(0FH,0):EDX[31:1]

PQM Capability

Enumeration

IA32_PQR_ASSOC.RMID

On Context Switch

Set RMID to monitor

the scheduled app

Periodical Resource

IA32_QM_EVTSEL

Configure event type

Read monitored data

CPUID.(0FH,1):ECX[31:0]
CPUID.(0FH,1):EDX[31:0]
CPUID.(0FH,1):EBX[31:0]

CPUID[

WRMSR

RDMSR/WRMSR

Selection/Reporting

IA32_QM_CTR

CPUID.(0FH,0):EBX[31:0]