diff --git a/devicemodel/arch/x86/pm.c b/devicemodel/arch/x86/pm.c index a444078e9..37d3b875c 100644 --- a/devicemodel/arch/x86/pm.c +++ b/devicemodel/arch/x86/pm.c @@ -175,6 +175,15 @@ pm1_status_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, return 0; } +void +pm_backto_wakeup(struct vmctx *ctx) +{ + /* According to ACPI 5.0 Table 4-16: bit 15, WAK_STS should be + * set when system trasition to the working state + */ + pm1_status |= PM1_WAK_STS; +} + static int pm1_enable_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) diff --git a/devicemodel/core/main.c b/devicemodel/core/main.c index a9affc9e1..b367d7232 100644 --- a/devicemodel/core/main.c +++ b/devicemodel/core/main.c @@ -622,6 +622,7 @@ vm_suspend_resume(struct vmctx *ctx) vm_stop_watchdog(ctx); wait_for_resume(ctx); + pm_backto_wakeup(ctx); vm_reset_watchdog(ctx); vm_reset(ctx); } diff --git a/devicemodel/include/acpi.h b/devicemodel/include/acpi.h index 9e36bf747..cd89478dd 100644 --- a/devicemodel/include/acpi.h +++ b/devicemodel/include/acpi.h @@ -58,5 +58,6 @@ void dsdt_indent(int levels); void dsdt_unindent(int levels); void sci_init(struct vmctx *ctx); void pm_write_dsdt(struct vmctx *ctx, int ncpu); +void pm_backto_wakeup(struct vmctx *ctx); #endif /* _ACPI_H_ */