mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-17 17:01:52 +00:00
hypervisor: handle reboot from non-privileged pre-launched guests
To handle reboot requests from pre-launched VMs that don't have GUEST_FLAG_HIGHEST_SEVERITY, we shutdown the target VM explicitly other than ignoring them. Tracked-On: #2700 Signed-off-by: Zide Chen <zide.chen@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
parent
2680121097
commit
03a1b2a717
@ -94,9 +94,16 @@ static bool handle_common_reset_reg_write(struct acrn_vm *vm, bool reset)
|
|||||||
if (reset && is_rt_vm(vm)) {
|
if (reset && is_rt_vm(vm)) {
|
||||||
vm->state = VM_POWERING_OFF;
|
vm->state = VM_POWERING_OFF;
|
||||||
}
|
}
|
||||||
|
} else if (is_prelaunched_vm(vm)) {
|
||||||
|
/* Don't support re-launch for now, just shutdown the guest */
|
||||||
|
pause_vm(vm);
|
||||||
|
|
||||||
|
struct acrn_vcpu *bsp = vcpu_from_vid(vm, BOOT_CPU_ID);
|
||||||
|
per_cpu(shutdown_vm_id, pcpuid_from_vcpu(bsp)) = vm->vm_id;
|
||||||
|
make_shutdown_vm_request(pcpuid_from_vcpu(bsp));
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* ignore writes from SOS or pre-launched VMs.
|
* ignore writes from SOS.
|
||||||
* equivalent to hide this port from guests.
|
* equivalent to hide this port from guests.
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user