Skip to content

Commit 29190ed

Browse files
fyin1wenlingz
authored andcommitted
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 <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 113adea commit 29190ed

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

devicemodel/core/main.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,10 +576,13 @@ vm_system_reset(struct vmctx *ctx)
576576
}
577577

578578
vm_reset_vdevs(ctx);
579-
580-
acrn_sw_load(ctx);
581579
vm_reset(ctx);
582580
vm_set_suspend_mode(VM_SUSPEND_NONE);
581+
582+
/* set the BSP init state */
583+
acrn_sw_load(ctx);
584+
vm_set_vcpu_regs(ctx, &ctx->bsp_regs);
585+
vm_run(ctx);
583586
}
584587

585588
static void
@@ -616,6 +619,10 @@ vm_suspend_resume(struct vmctx *ctx)
616619
pm_backto_wakeup(ctx);
617620
vm_reset_watchdog(ctx);
618621
vm_reset(ctx);
622+
623+
/* set the BSP init state */
624+
vm_set_vcpu_regs(ctx, &ctx->bsp_regs);
625+
vm_run(ctx);
619626
}
620627

621628
static void

0 commit comments

Comments
 (0)