Skip to content

Commit e263b55

Browse files
taoyuhongwenlingz
authored andcommitted
HV: Fix modularization vm config code lost CAT code
Previous change 'HV: modularization vm config code', commit id 1bb15c6, lost CAT code when move sanitize_vm_config() from vm.c to vm_config.c Tracked-On: #2291 Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
1 parent 703b366 commit e263b55

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

hypervisor/arch/x86/configs/vm_config.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <errno.h>
1010
#include <acrn_common.h>
1111
#include <page.h>
12+
#include <logmsg.h>
13+
#include <cat.h>
1214
#ifndef CONFIG_PARTITION_MODE
1315
#include <sos_vm.h>
1416

@@ -119,6 +121,16 @@ int32_t sanitize_vm_config(void)
119121
/* Nothing to do for a UNDEFINED_VM, break directly. */
120122
break;
121123
}
124+
125+
if ((vm_config->guest_flags & CLOS_REQUIRED) != 0U) {
126+
if (cat_cap_info.support && (vm_config->clos <= cat_cap_info.clos_max)) {
127+
cat_cap_info.enabled = true;
128+
} else {
129+
pr_err("%s set wrong CLOS or CAT is not supported\n", __func__);
130+
ret = -EINVAL;
131+
}
132+
}
133+
122134
if (ret != 0) {
123135
break;
124136
}

0 commit comments

Comments
 (0)