[PATCH v3 1/2] HV: Assign the guest_flags with cv.vm_flag


Kaige Fu
 

We should assign the guest_flags with cv.vm_flag using '=' instead of '|='.
Because the later one will keep the previous configurations.

For example, if we create one vm with LAPIC_PASSTHROUGH flag and shutdown it.
The the following vm to be bootup will has the LAPIC_PASSTHROUGH flag set no
matter whether we set it in DM.

Signed-off-by: Kaige Fu <kaige.fu@...>
---
hypervisor/common/hypercall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hypervisor/common/hypercall.c b/hypervisor/common/hypercall.c
index 96b2fab1..a871755a 100644
--- a/hypervisor/common/hypercall.c
+++ b/hypervisor/common/hypercall.c
@@ -133,7 +133,7 @@ int32_t hcall_create_vm(struct acrn_vm *vm, uint64_t param)
vm_config = get_vm_config(vm_id);
/* TODO: set by DM */
vm_config->type = NORMAL_VM;
- vm_config->guest_flags |= cv.vm_flag;
+ vm_config->guest_flags = cv.vm_flag;
(void)memcpy_s(&vm_config->GUID[0], 16U, &cv.GUID[0], 16U);

/* GUEST_FLAG_RT must be set if we have GUEST_FLAG_LAPIC_PASSTHROUGH set in guest_flags */
--
2.20.0

Join acrn-dev@lists.projectacrn.org to automatically receive all group messages.