From 29190ed21903a4bcbf38f599dc2da7e85817cdf0 Mon Sep 17 00:00:00 2001 From: Yin Fengwei Date: Wed, 26 Sep 2018 13:50:34 +0800 Subject: [PATCH] dm: add call to set BSP init state for UOS S3 and system reset For UOS, we need to call hypercall to set BSP init state now. So we can't combint the vm start and vm reset (vm reset will reset the vcpu context). Remove vm start from reset_vm. DM needs to start vm after every vm reset. Update DM to set UOS BSP init state after vm reset and before vm start. Tracked-On: #1231 Signed-off-by: Yin Fengwei Acked-by: Eddie Dong --- devicemodel/core/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/devicemodel/core/main.c b/devicemodel/core/main.c index 33c2eefbf..d7538bcde 100644 --- a/devicemodel/core/main.c +++ b/devicemodel/core/main.c @@ -576,10 +576,13 @@ vm_system_reset(struct vmctx *ctx) } vm_reset_vdevs(ctx); - - acrn_sw_load(ctx); vm_reset(ctx); vm_set_suspend_mode(VM_SUSPEND_NONE); + + /* set the BSP init state */ + acrn_sw_load(ctx); + vm_set_vcpu_regs(ctx, &ctx->bsp_regs); + vm_run(ctx); } static void @@ -616,6 +619,10 @@ vm_suspend_resume(struct vmctx *ctx) pm_backto_wakeup(ctx); vm_reset_watchdog(ctx); vm_reset(ctx); + + /* set the BSP init state */ + vm_set_vcpu_regs(ctx, &ctx->bsp_regs); + vm_run(ctx); } static void