diff --git a/hypervisor/arch/x86/configs/vm_config.c b/hypervisor/arch/x86/configs/vm_config.c index b1c742712..6681a4225 100644 --- a/hypervisor/arch/x86/configs/vm_config.c +++ b/hypervisor/arch/x86/configs/vm_config.c @@ -9,6 +9,8 @@ #include #include #include +#include +#include #ifndef CONFIG_PARTITION_MODE #include @@ -119,6 +121,16 @@ int32_t sanitize_vm_config(void) /* Nothing to do for a UNDEFINED_VM, break directly. */ break; } + + if ((vm_config->guest_flags & CLOS_REQUIRED) != 0U) { + if (cat_cap_info.support && (vm_config->clos <= cat_cap_info.clos_max)) { + cat_cap_info.enabled = true; + } else { + pr_err("%s set wrong CLOS or CAT is not supported\n", __func__); + ret = -EINVAL; + } + } + if (ret != 0) { break; }