[PATCH v9 13/14] arm64: kernel: Add support for hibernate/suspend-to-disk
Catalin Marinas
catalin.marinas at arm.com
Thu Apr 28 02:26:41 PDT 2016
On Wed, Apr 27, 2016 at 05:47:12PM +0100, James Morse wrote:
> Add support for hibernate/suspend-to-disk.
>
> Suspend borrows code from cpu_suspend() to write cpu state onto the stack,
> before calling swsusp_save() to save the memory image.
>
> Restore creates a set of temporary page tables, covering only the
> linear map, copies the restore code to a 'safe' page, then uses the copy to
> restore the memory image. The copied code executes in the lower half of the
> address space, and once complete, restores the original kernel's page
> tables. It then calls into cpu_resume(), and follows the normal
> cpu_suspend() path back into the suspend code.
>
> To restore a kernel using KASLR, the address of the page tables, and
> cpu_resume() are stored in the hibernate arch-header and the el2
> vectors are pivotted via the 'safe' page in low memory.
>
> Signed-off-by: James Morse <james.morse at arm.com>
> Tested-by: Kevin Hilman <khilman at baylibre.com> # Tested on Juno R2
> Cc: Catalin Marinas <catalin.marinas at arm.com>
It looks fine. Thanks.
Reviewed-by: Catalin Marinas <catalin.marinas at arm.com>
More information about the linux-arm-kernel
mailing list