background image

17-54 Vol. 3B

DEBUG, BRANCH PROFILE, TSC, AND RESOURCE MONITORING FEATURES

When CDP is enabled, the existing mask space for CAT-only operation is split. As an example if the system supports 
16 CAT-only COS, when CDP is enabled the same MSR interfaces are used, however half of the masks correspond 
to code, half correspond to data, and the effective number of COS is reduced by half. Code/Data masks are defined 
per-COS and interleaved in the MSR space as described in subsequent sections.

17.17.3  Enabling Cache Allocation Technology Usage Flow

Figure 17-30 illustrates the key steps for OS/VMM to detect support of Cache Allocation Technology and enable 
priority-based resource allocation for a CAT-capable resource.

Enumeration and configuration of L2 CAT is similar to L3 CAT, however CPUID details and MSR addresses differ. 
Common CLOS are used across the features.

17.17.3.1   Enumeration and Detection Support of Cache Allocation Technology

Software can query processor support of CAT capabilities by executing CPUID instruction with EAX = 07H, ECX = 
0H as input. If CPUID.(EAX=07H, ECX=0):EBX.PQE[bit 15] reports 1, the processor supports software control over 
shared processor resources. Software must use CPUID leaf 10H to enumerate additional details of available 
resource types, classes of services and capability bitmasks. The programming interfaces provided by Cache Alloca-
tion Technology include:

CPUID leaf function 10H (Cache Allocation Technology Enumeration leaf) and its sub-functions provide 
information on available resource types, and CAT capability for each resource type (see Section 17.17.3.2).

IA32_L3_MASK_n: A range of MSRs is provided for each resource type, each MSR within that range specifying 
a software-configured capacity bitmask for each class of service. For L3 with Cache Allocation support, the CBM 
is specified using one of the IA32_L3_QOS_MASK_n MSR, where 'n' corresponds to a number within the 
supported range of COS, i.e. the range between 0 and CPUID.(EAX=10H, ECX=ResID):EDX[15:0], inclusive. 
See Section 17.17.3.3 for details.

IA32_L2_MASK_n: A range of MSRs is provided for L2 Cache Allocation Technology, enabling software control 
over the amount of L2 cache available for each CLOS. Similar to L3 CAT, a CBM is specified for each CLOS using 
the set of registers, IA32_L2_QOS_MASK_n MSR, where 'n' ranges from zero to the maximum CLOS number 
reported for L2 CAT in CPUID. See Section 17.17.3.3 for details.
The L2 mask MSRs are scoped at the same level as the L2 cache (similarly, the L3 mask MSRs are scoped at the 
same level as the L3 cache). Software may determine which logical processors share an MSR (for instance local 
to a core, or shared across multiple cores) by performing a write to one of these MSRs and noting which logical 
threads observe the change. Example flows for a similar method to determine register scope are described in 
Section 15.5.2, “System Software Recommendation for Managing CMCI and Machine Check Resources”
Software may also use CPUID leaf 4 to determine the maximum number of logical processor IDs that may share 
a given level of the cache.

Figure 17-30.  Cache Allocation Technology Usage Flow

CPUID.(7,0):EBX.15

On OS/VMM Initialization

CPUID.(10H,0):EBX[31:1]

CQE Capability

Enumeration

IA32_L3_QOS_MASK_0

Cache Allocation Configuration

...

Configure CBM

per COS

On Context Switch

IA32_PQR_ASSOC

Set COS for scheduled

thread context

A32_L3_QOS_MASK_n

CPUID.(10H,1):EAX[4:0]
CPUID.(10H,1):EDX[15:0]
CPUID.(10H,1):EBX[

CPUID[

WRMSR

WRMSR