arm64: hibernate: Clean the __hyp_text to PoC after resume
authorJames Morse <james.morse@arm.com>
Thu, 24 Jan 2019 16:32:57 +0000 (16:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Feb 2019 16:33:28 +0000 (17:33 +0100)
commit828316e65c09dfdb6338d151b52f165f723b1d6f
tree5c165b3862b3addf1571ce3bf5dffa3c0be03e53
parentc5edde98996581443f7f5735b545f65ec050e4ec
arm64: hibernate: Clean the __hyp_text to PoC after resume

commit f7daa9c8fd191724b9ab9580a7be55cd1a67d799 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/hibernate.c