2018-10-31 02:02:29 +08:00
|
|
|
.. _pm_hld:
|
|
|
|
|
|
|
|
Power Management
|
|
|
|
################
|
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
System PM Module
|
2018-10-31 02:02:29 +08:00
|
|
|
****************
|
|
|
|
|
|
|
|
The PM module in the hypervisor does three things:
|
|
|
|
|
2019-11-08 07:24:31 +08:00
|
|
|
- Monitors all guests power state transitions and emulates a low power
|
|
|
|
state for the guests which are launched by the HV directly.
|
2019-10-21 22:00:18 +08:00
|
|
|
|
2019-11-08 07:24:31 +08:00
|
|
|
- Once all guests enter low power state, the Hypervisor handles its
|
|
|
|
own low-power state transition.
|
2018-10-31 02:02:29 +08:00
|
|
|
|
2019-11-08 07:24:31 +08:00
|
|
|
- Once the system resumes from low-power mode, the hypervisor handles its
|
|
|
|
own resume and emulates the Service VM resume.
|
2018-10-31 02:02:29 +08:00
|
|
|
|
2019-11-08 07:24:31 +08:00
|
|
|
It is assumed that the Service VM does not trigger any power state transition
|
2019-10-21 22:00:18 +08:00
|
|
|
until the VM manager of ACRN notifies it that all User VMs are inactive
|
|
|
|
and Service VM offlines all its virtual APs. And it is assumed that HV
|
|
|
|
does not trigger its own power state transition until all guests are in
|
|
|
|
low power state.
|
2018-10-31 02:02:29 +08:00
|
|
|
|
2019-10-21 22:00:18 +08:00
|
|
|
:numref:`pm-low-power-transition` shows the Hypervisor entering S3
|
2019-11-08 07:24:31 +08:00
|
|
|
state process. The Service VM triggers power state transition by
|
2018-10-31 02:02:29 +08:00
|
|
|
writing ACPI control register on its virtual BSP (which is pinned to the
|
|
|
|
physical BSP). The hypervisor then does the following in sequence before
|
|
|
|
it writes to the physical ACPI control register to trigger physical
|
|
|
|
power state transition:
|
|
|
|
|
2019-10-21 22:00:18 +08:00
|
|
|
- Pauses Service VM.
|
|
|
|
- Wait all other guests enter low power state.
|
2018-10-31 02:02:29 +08:00
|
|
|
- Offlines all physical APs.
|
2020-04-16 01:55:04 +08:00
|
|
|
- Save the context of console, ioapic of Service VM, I/O MMU, lapic of
|
2019-10-21 22:00:18 +08:00
|
|
|
Service VM, virtual BSP.
|
2018-10-31 02:02:29 +08:00
|
|
|
- Save the context of physical BSP.
|
|
|
|
|
2019-10-21 22:00:18 +08:00
|
|
|
When exiting from S3 state, the hypervisor does similar steps in
|
|
|
|
reverse order to restore contexts, start APs and resume all guests launched
|
|
|
|
by hypervisor directly. Service VM is responsible for starting its own
|
|
|
|
virtual APs as well as User VMs.
|
2018-10-31 02:02:29 +08:00
|
|
|
|
|
|
|
.. figure:: images/pm-image24-105.png
|
|
|
|
:align: center
|
|
|
|
:name: pm-low-power-transition
|
|
|
|
|
2019-10-21 22:00:18 +08:00
|
|
|
Service VM/Hypervisor S3 transition process
|