From 546f01cb96b0b2c688257371608c64db78b5d31a Mon Sep 17 00:00:00 2001 From: Chuanxiao Dong Date: Wed, 12 Feb 2020 21:58:47 +0800 Subject: acpipm: implement suspend and resume mechanism For suspend request from VM, will write suspend event and notify crosvm main process to pause VCPUs. For resume request, it is not from VM itself but by the resume command through crosvm socket. Resume request will notify the PM device to fill its wakeup registers with wakeup event so that when VCPUs start to run, VM can know there is wakeup from outside. BUG=chromium:1018674 TEST=cargo test -p devices Change-Id: I4724ffee10150065a62bf520076c16cbc70b7749 Signed-off-by: Chuanxiao Dong Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2035169 Tested-by: kokoro Reviewed-by: Tomasz Jeznach --- x86_64/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'x86_64') diff --git a/x86_64/src/lib.rs b/x86_64/src/lib.rs index f9efad4..5ab0445 100644 --- a/x86_64/src/lib.rs +++ b/x86_64/src/lib.rs @@ -734,12 +734,13 @@ impl X8664arch { let pm = Arc::new(Mutex::new(devices::ACPIPMResource::new(suspend_evt))); io_bus .insert( - pm, + pm.clone(), devices::acpi::ACPIPM_RESOURCE_BASE, devices::acpi::ACPIPM_RESOURCE_LEN, false, ) .unwrap(); + io_bus.notify_on_resume(pm); Ok(io_bus) } -- cgit 1.4.1