mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 01:37:44 +00:00
HV: Clear DM set guest_flags when shutdown vm
Currently, the previous configurations about guest_flags set by DM will not be cleared when shutdown the vm. Then it might bring issue for the next dm-launched vm. For example, if we create one vm with LAPIC_PASSTHROUGH flag and shutdown it. Then the next dm-launched vm will has the LAPIC_PASSTHROUGH flag set no matter whether we set it in DM. This patch clears all the DM set flags when shtudown vm. Tracked-On: #2991 Signed-off-by: Kaige Fu <kaige.fu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -457,6 +457,7 @@ int32_t shutdown_vm(struct acrn_vm *vm)
|
||||
{
|
||||
uint16_t i;
|
||||
struct acrn_vcpu *vcpu = NULL;
|
||||
struct acrn_vm_config *vm_config = NULL;
|
||||
int32_t ret;
|
||||
|
||||
pause_vm(vm);
|
||||
@@ -470,6 +471,9 @@ int32_t shutdown_vm(struct acrn_vm *vm)
|
||||
offline_vcpu(vcpu);
|
||||
}
|
||||
|
||||
vm_config = get_vm_config(vm->vm_id);
|
||||
vm_config->guest_flags &= ~DM_OWNED_GUEST_FLAG_MASK;
|
||||
|
||||
ptdev_release_all_entries(vm);
|
||||
|
||||
vpci_cleanup(vm);
|
||||
|
Reference in New Issue
Block a user