diff options
author | Shaokun Zhang <zhangshaokun@hisilicon.com> | 2016-06-21 15:32:57 +0800 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-06-21 20:10:18 +0100 |
commit | 20c27a4270c775d7ed661491af8ac03264d60fc6 (patch) | |
tree | 1cca6a11a7cb4fa984194821138b2cfe1113baf9 /arch/arm64 | |
parent | 9ca4e58c20d5cb2a5bc378238188c71317aceac5 (diff) | |
download | linux-20c27a4270c775d7ed661491af8ac03264d60fc6.tar.gz linux-20c27a4270c775d7ed661491af8ac03264d60fc6.tar.bz2 linux-20c27a4270c775d7ed661491af8ac03264d60fc6.zip |
arm64: mm: remove page_mapping check in __sync_icache_dcache
__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 7249b79f6b4cc ("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>
Cc: <stable@vger.kernel.org>
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>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/mm/flush.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c index dbd12ea8ce68..43a76b07eb32 100644 --- a/arch/arm64/mm/flush.c +++ b/arch/arm64/mm/flush.c @@ -71,10 +71,6 @@ void __sync_icache_dcache(pte_t pte, unsigned long addr) { struct page *page = pte_page(pte); - /* no flushing needed for anonymous pages */ - if (!page_mapping(page)) - return; - if (!test_and_set_bit(PG_dcache_clean, &page->flags)) sync_icache_aliases(page_address(page), PAGE_SIZE << compound_order(page)); |