]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: kernel: Add support for hibernate/suspend-to-disk
authorJames Morse <james.morse@arm.com>
Wed, 27 Apr 2016 16:47:12 +0000 (17:47 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 28 Apr 2016 12:36:22 +0000 (13:36 +0100)
commit04d8f9e2e3ec9be951bc69acf7967ae6989460cd
tree23a5ef05a0b05aed9032c3a8f517b2dc76cb7bfb
parent8a8693511f1587f52689310a9b2fb19d9340ad4c
arm64: kernel: Add support for hibernate/suspend-to-disk

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.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Kevin Hilman <khilman@baylibre.com> # Tested on Juno R2
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/Kconfig
arch/arm64/include/asm/suspend.h
arch/arm64/kernel/Makefile
arch/arm64/kernel/asm-offsets.c
arch/arm64/kernel/hibernate-asm.S [new file with mode: 0644]
arch/arm64/kernel/hibernate.c [new file with mode: 0644]
arch/arm64/kernel/vmlinux.lds.S