Skip to content

Commit 6513db4

Browse files
taoyuhongwenlingz
authored andcommitted
doc: add HLD for CAT
The hld of resource director technology, RDT. Should have CAT and MBA. This is for CAT. Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
1 parent b6007d0 commit 6513db4

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

doc/developer-guides/hld/hld-hypervisor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ Hypervisor high-level design
2323
Console, Shell, and vUART <hv-console>
2424
Hypercall / VHM upcall <hv-hypercall>
2525
Compile-time configuration <hv-config>
26+
RDT support, CAT <hv-rdt>

doc/developer-guides/hld/hv-rdt.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.. _hv_rdt:
2+
3+
RDT Allocation Feature Supported by Hypervisor
4+
##############################################
5+
6+
The hypervisor allows to use RDT (Resource Director Technology) allocation features to optimize performance of VMs. There are 2 sub-features: CAT (Cache Allocation Technology) and MBA(Memory Bandwidth Allocation), CAT is for cache resources and MBA is for memory bandwidth resources. Code and Data Prioritization (CDP) is an extension of CAT. Only CAT is enabled due to the feature availability on ACRN supported platform. In ACRN, the CAT is configured via the "VM-Configuration", the resources allocated for VMs are determined in the VM configuration.
7+
8+
CAT Support in ACRN
9+
*******************
10+
11+
Introduction of CAT Capabilities
12+
================================
13+
14+
On a platform which supports CAT, each CPU can mask last-level-cache (LLC) with a cache mask, the masked cache ways cannot be evicted by this CPU. In terms of SDM, please see chapter 17, volume 3, CAT capabilities are enumerated via CPUID, and configured via MSR registers, these are:
15+
16+
* CPUID.10H contains CAT capabilities, such as cache mask type(L2/L3), mask bit
17+
length, number of masks.
18+
19+
* Cache masks are set in IA32_type_MASK_n, each one of these MSRs can
20+
hold a cache mask. They are shared by CPUs who share the same LLC; CPU sets
21+
the RMID field of its IA32_PQR_ASSOC MSR with class-of-service (CLOS) ID, to
22+
select a cache mask to take effect.
23+
24+
Objective of CAT
25+
================
26+
27+
CAT feature in hypervisor can isolate cache for a VM from other VMs. It can also isolate the cache usage between VMX root mode and VMX non-root mode. Generally, certain cache resources will be allocated for the RT VMs in order to reduce the performance interference through the shared cache access from the neighbour VMs.
28+
29+
CAT Workflow
30+
=============
31+
32+
The hypervisor enumerates CAT capabilities and setup cache mask arrays; It also sets up CLOS for VMs and hypervisor itself per the "vm configuration".
33+
34+
* The CAT capabilities are enumerated on boot-strap processor (BSP), at the
35+
PCPU pre-initialize stage. The global data structure cat_cap_info holds the
36+
result.
37+
* If CAT is supported, then setup cache masks array on all APs, at the PCPU
38+
post-initialize stage. The mask values are written to IA32_type_MASK_n. In
39+
fact, for CPUs which share LLC, they share the same IA32_type_MASK_n MSRs too,
40+
only need to do that on one CPU of them. The hypervisor does not detect
41+
hierarchy of LLCs.
42+
* If CAT is supported. The CLOS of a VM will be stored into its vCPU
43+
msr_store_area data structure guest part. It will be loaded to
44+
MSR IA32_PQR_ASSOC at each VM entry.
45+
* If CAT is supported, The CLOS of hypervisor is stored for all VMs, in their
46+
vCPU msr_store_area data structure host part. It will be loaded to MSR
47+
IA32_PQR_ASSOC at each VM exit.

0 commit comments

Comments
 (0)