linux/kernel/power
Vlastimil Babka a2bbfa414c FROMGIT: kernel/power: allow hibernation with page_poison sanity checking
Page poisoning used to be incompatible with hibernation, as the state of
poisoned pages was lost after resume, thus enabling CONFIG_HIBERNATION
forces CONFIG_PAGE_POISONING_NO_SANITY.  For the same reason, the
poisoning with zeroes variant CONFIG_PAGE_POISONING_ZERO used to disable
hibernation.  The latter restriction was removed by commit 1ad1410f63
("PM / Hibernate: allow hibernation with PAGE_POISONING_ZERO") and
similarly for init_on_free by commit 18451f9f9e ("PM: hibernate: fix
crashes with init_on_free=1") by making sure free pages are cleared after
resume.

We can use the same mechanism to instead poison free pages with
PAGE_POISON after resume.  This covers both zero and 0xAA patterns.  Thus
we can remove the Kconfig restriction that disables page poison sanity
checking when hibernation is enabled.

Link: https://lkml.kernel.org/r/20201113104033.22907-4-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>	[hibernation]
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Laura Abbott <labbott@kernel.org>
Cc: Mateusz Nosek <mateusznosek0@gmail.com>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit 03b6c9a3e8
 https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm)
Bug: 182930667
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Ieea49ebb4d3eeddd18eb2040f13b8121978facca
2021-03-24 15:09:16 -07:00
..
autosleep.c PM / wakeup: Show wakeup sources stats in sysfs 2019-08-21 00:20:40 +02:00
console.c
energy_model.c UPSTREAM: PM: EM: Add a flag indicating units of power values in Energy Model 2021-03-02 17:34:28 -08:00
hibernate.c FROMGIT: kernel/power: allow hibernation with page_poison sanity checking 2021-03-24 15:09:16 -07:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
main.c notifier: Fix broken error handling pattern 2020-09-01 09:58:03 +02:00
Makefile Merge faa392181a ("Merge tag 'drm-next-2020-06-02' of git://anongit.freedesktop.org/drm/drm") into android-mainline 2020-06-12 15:13:27 +02:00
power.h FROMGIT: kernel/power: allow hibernation with page_poison sanity checking 2021-03-24 15:09:16 -07:00
poweroff.c kernel/power: constify sysrq_key_op 2020-05-15 14:53:20 +02:00
process.c ANDROID: power: add vendor hooks for try_to_freeze fail 2021-02-04 23:55:59 +00:00
qos.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
snapshot.c FROMGIT: kernel/power: allow hibernation with page_poison sanity checking 2021-03-24 15:09:16 -07:00
suspend_test.c PM: sleep: Switch to rtc_time64_to_tm()/rtc_tm_to_time64() 2019-12-20 09:58:08 +01:00
suspend.c Merge dd502a8107 ("Merge tag 'core-static_call-2020-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline 2020-10-21 12:04:36 +02:00
swap.c PM: hibernate: flush swap writer after marking 2021-02-03 23:28:40 +01:00
user.c block-5.10-2020-10-12 2020-10-13 12:12:44 -07:00
wakelock.c PM / wakeup: Show wakeup sources stats in sysfs 2019-08-21 00:20:40 +02:00
wakeup_reason.c ANDROID: power: Export log_{suspend_abort,abnormal_wakeup}_reason 2020-08-25 00:32:03 +00:00