diff --git a/hypervisor/arch/x86/guest/vm.c b/hypervisor/arch/x86/guest/vm.c index e8a76168b..c63c6838e 100644 --- a/hypervisor/arch/x86/guest/vm.c +++ b/hypervisor/arch/x86/guest/vm.c @@ -139,7 +139,9 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_ } else { /* populate UOS vm fields according to vm_config */ - vm->sworld_control.flag.supported = vm_config->sworld_supported; + if ((vm_config->guest_flags & SECURE_WORLD_ENABLED) != 0U) { + vm->sworld_control.flag.supported = 1U; + } if (vm->sworld_control.flag.supported != 0UL) { struct memory_ops *ept_mem_ops = &vm->arch_vm.ept_mem_ops; diff --git a/hypervisor/common/hypercall.c b/hypervisor/common/hypercall.c index 1fdd00943..a1b4650ff 100644 --- a/hypervisor/common/hypercall.c +++ b/hypervisor/common/hypercall.c @@ -125,7 +125,6 @@ int32_t hcall_create_vm(struct acrn_vm *vm, uint64_t param) /* TODO: set by DM */ vm_config->type = NORMAL_VM; vm_config->guest_flags |= cv.vm_flag; - vm_config->sworld_supported = ((cv.vm_flag & (SECURE_WORLD_ENABLED)) != 0U); (void)memcpy_s(&vm_config->GUID[0], 16U, &cv.GUID[0], 16U); ret = create_vm(vm_id, vm_config, &target_vm); diff --git a/hypervisor/include/arch/x86/guest/vm.h b/hypervisor/include/arch/x86/guest/vm.h index 6a6c597fe..1d6c6e34d 100644 --- a/hypervisor/include/arch/x86/guest/vm.h +++ b/hypervisor/include/arch/x86/guest/vm.h @@ -221,8 +221,6 @@ struct acrn_vm_config { */ uint16_t *vm_pcpu_ids; uint16_t vm_hw_num_cores; /* Number of virtual cores */ - /* Whether secure world is supported for current VM. */ - bool sworld_supported; #ifdef CONFIG_PARTITION_MODE uint8_t vm_id; uint64_t start_hpa;