mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-04 23:24:56 +00:00
hv: implement NEED_SHUTDOWN_VM request to idle thread
For pre-launched VMs and SOS, VM shutdown should not be executed in the current VM context. - implement NEED_SHUTDOWN_VM request so that the BSP of the target VM can shut down the guest in idle thread. - implement shutdown_vm_from_idle() to shut down target VM. Tracked-On: #2700 Signed-off-by: Zide Chen <zide.chen@intel.com> Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <vm.h>
|
||||
#include <vm_reset.h>
|
||||
#include <vmcs.h>
|
||||
#include <vmexit.h>
|
||||
#include <irq.h>
|
||||
@@ -88,6 +89,8 @@ void default_idle(__unused struct sched_object *obj)
|
||||
schedule();
|
||||
} else if (need_offline(pcpu_id) != 0) {
|
||||
cpu_dead();
|
||||
} else if (need_shutdown_vm(pcpu_id)) {
|
||||
shutdown_vm_from_idle(pcpu_id);
|
||||
} else {
|
||||
CPU_IRQ_ENABLE();
|
||||
cpu_do_idle();
|
||||
|
||||
Reference in New Issue
Block a user