Skip to content

Commit f7daa9c

Browse files
James Morsewildea01
authored andcommitted
arm64: hibernate: Clean the __hyp_text to PoC after resume
During resume hibernate restores all physical memory. Any memory that is accessed with the MMU disabled needs to be cleaned to the PoC. KVMs __hyp_text was previously ommitted as it runs with the MMU enabled, but now that the hyp-stub is located in this section, we must clean __hyp_text too. This ensures secondary CPUs that come online after hibernate has finished resuming, and load KVM via the freshly written hyp-stub see the correct instructions. Signed-off-by: James Morse <james.morse@arm.com> Cc: stable@vger.kernel.org Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 8fac5cb commit f7daa9c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/arm64/kernel/hibernate.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,10 @@ int swsusp_arch_suspend(void)
299299
dcache_clean_range(__idmap_text_start, __idmap_text_end);
300300

301301
/* Clean kvm setup code to PoC? */
302-
if (el2_reset_needed())
302+
if (el2_reset_needed()) {
303303
dcache_clean_range(__hyp_idmap_text_start, __hyp_idmap_text_end);
304+
dcache_clean_range(__hyp_text_start, __hyp_text_end);
305+
}
304306

305307
/* make the crash dump kernel image protected again */
306308
crash_post_resume();

0 commit comments

Comments
 (0)