hv: CAT is supposed to be enabled in the system level

In platforms that support CAT, when it is enabled by ACRN, i.e.
IA32_resourceType_MASK_n registers are programmed with customized values,
it has impacts to the whole system.

The per guest flag GUEST_FLAG_CLOS_REQUIRED suggests that CAT may be
enabled in some guests, but not in others who don't have this flag,
which is conceptually incorrect.

This patch removes GUEST_FLAG_CLOS_REQUIRED, and adds a new Kconfig
entry CAT_ENABLED for CAT enabling. When it's enabled, platform_clos_array[]
defines a set of system-wide Class of Service (COS, or CLOS), and the
per guest vm_configs[].clos associates the guest with particular CLOS.

Tracked-On: #2462
Signed-off-by: Zide Chen <zide.chen@intel.com>
This commit is contained in:
Zide Chen
2020-02-05 10:23:07 -08:00
committed by wenlingz
parent 8dcede7693
commit cc6f094926
7 changed files with 21 additions and 14 deletions

View File

@@ -9,8 +9,7 @@
/* The intel Resource Director Tech(RDT) based Cache Allocation Tech support */
struct cat_hw_info {
bool support; /* If L2/L3 CAT supported */
bool enabled; /* If any VM setup CLOS */
bool enabled; /* If L2/L3 CAT enabled */
uint32_t bitmask; /* Used by other entities */
uint16_t cbm_len; /* Length of Cache mask in bits */
uint16_t clos_max; /* Maximum CLOS supported, the number of cache masks */

View File

@@ -127,7 +127,9 @@ struct acrn_vm_config {
uint16_t pci_dev_num; /* indicate how many PCI devices in VM */
struct acrn_vm_pci_dev_config *pci_devs; /* point to PCI devices BDF list */
struct acrn_vm_os_config os_config; /* OS information the VM */
uint16_t clos; /* if guest_flags has GUEST_FLAG_CLOS_REQUIRED, then VM use this CLOS */
uint16_t clos; /* Class of Service, effective only if CONFIG_CAT_ENABLED
* is defined on CAT capable platforms
*/
struct vuart_config vuart[MAX_VUART_NUM_PER_VM];/* vuart configuration for VM */
} __aligned(8);