]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: hibernate: Support DEBUG_PAGEALLOC
authorJames Morse <james.morse@arm.com>
Wed, 24 Aug 2016 17:27:30 +0000 (18:27 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 25 Aug 2016 17:00:30 +0000 (18:00 +0100)
commit3735c6f1ca9bc311990f8c3e6a53137f8b333e72
tree24cc917fb9078acdc2b1deee131c4744d625cf1e
parent841ac47038988e3603a2b164c932e55e026d2e73
arm64: hibernate: Support DEBUG_PAGEALLOC

DEBUG_PAGEALLOC removes the valid bit of page table entries to prevent
any access to unallocated memory. Hibernate uses this as a hint that those
pages don't need to be saved/restored. This patch adds the
kernel_page_present() function it uses.

hibernate.c copies the resume kernel's linear map for use during restore.
Add _copy_pte() to fill-in the holes made by DEBUG_PAGEALLOC in the resume
kernel, so we can restore data the original kernel had at these addresses.

Finally, DEBUG_PAGEALLOC means the linear-map alias of KERNEL_START to
KERNEL_END may have holes in it, so we can't lazily clean this whole
area to the PoC. Only clean the new mmuoff region, and the kernel/kvm
idmaps.

This reverts commit 8f695b122012ff69b2359401783272f41ff8a0a0.

Reported-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/Kconfig
arch/arm64/include/asm/pgtable.h
arch/arm64/kernel/hibernate.c
arch/arm64/mm/pageattr.c