linux/arch/arm64
Shaokun Zhang c8793561f7 arm64: mm: remove page_mapping check in __sync_icache_dcache
commit 20c27a4270 upstream.

__sync_icache_dcache unconditionally skips the cache maintenance for
anonymous pages, under the assumption that flushing is only required in
the presence of D-side aliases [see 7249b79f6b ("arm64: Do not flush
the D-cache for anonymous pages")].

Unfortunately, this breaks migration of anonymous pages holding
self-modifying code, where userspace cannot be reasonably expected to
reissue maintenance instructions in response to a migration.

This patch fixes the problem by removing the broken page_mapping(page)
check from the cache syncing code, otherwise we may end up fetching and
executing stale instructions from the PoU.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2016-08-22 22:38:17 +01:00
..
boot arm64: dts: Add more serial port nodes in APM X-Gene device tree 2014-06-18 12:41:55 +01:00
configs arm64: defconfig update for LTP 2014-06-18 12:40:52 +01:00
crypto crypto: prefix module autoloading with "crypto-" 2015-02-04 10:57:48 +00:00
include arm64: Provide "model name" in /proc/cpuinfo for PER_LINUX32 tasks 2016-08-22 22:38:07 +01:00
kernel arm64: Provide "model name" in /proc/cpuinfo for PER_LINUX32 tasks 2016-08-22 22:38:07 +01:00
kvm arm64: KVM: Fix AArch32 to AArch64 register mapping 2015-12-18 16:06:35 +00:00
lib arm64: __clear_user: handle exceptions on strb 2014-11-27 11:21:47 +00:00
mm arm64: mm: remove page_mapping check in __sync_icache_dcache 2016-08-22 22:38:17 +01:00
xen arm: xen: implement multicall hypercall support. 2014-04-24 13:09:46 +01:00
Kconfig arm64: errata: add module build workaround for erratum #843419 2015-10-06 11:52:29 +01:00
Kconfig.debug arm64: remove arch specific earlyprintk 2014-04-24 16:32:27 -07:00
Makefile arm64: errata: Add -mpc-relative-literal-loads to build flags 2016-02-17 10:22:40 +00:00