PM / Hibernate: Call flush_icache_range() on pages restored in-place
authorJames Morse <james.morse@arm.com>
Wed, 27 Apr 2016 16:47:11 +0000 (17:47 +0100)
committerAlex Shi <alex.shi@linaro.org>
Thu, 10 Nov 2016 07:55:00 +0000 (15:55 +0800)
commit4d4fe8f2b27ceb29c16b32c3882ebd19bf21800f
tree7408d9fc46eba1cf37eaa81bc42b3007924f8fc4
parent5249f3c1e453fc3a1661976e94500da09f2cdcf1
PM / Hibernate: Call flush_icache_range() on pages restored in-place

Some architectures require code written to memory as if it were data to be
'cleaned' from any data caches before the processor can fetch them as new
instructions.

During resume from hibernate, the snapshot code copies some pages directly,
meaning these architectures do not get a chance to perform their cache
maintenance. Modify the read and decompress code to call
flush_icache_range() on all pages that are restored, so that the restored
in-place pages are guaranteed to be executable on these architectures.

Signed-off-by: James Morse <james.morse@arm.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Rafael J. Wysocki <rjw@rjwysocki.net>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
[will: make clean_pages_on_* static and remove initialisers]
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit f6cf0545ec697ddc278b7457b7d0c0d86a2ea88e)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
kernel/power/swap.c