From c0400b99fb7e8aad99a858da08eb311c2bce9a3f Mon Sep 17 00:00:00 2001 From: "yuhong.tao@intel.com" Date: Fri, 8 Mar 2019 00:57:32 +0800 Subject: [PATCH] HV: Fix modularization vm config code lost CAT code Previous change 'HV: modularization vm config code', commit id 1bb15c64a668a82c87b92aa5b5e3ceb88f264d2a, lost CAT code when move sanitize_vm_config() from vm.c to vm_config.c Tracked-On: #2291 Signed-off-by: Tao Yuhong --- hypervisor/arch/x86/configs/vm_config.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; }