]> Git Repo - linux.git/commitdiff
arm64: mm: Make icache synchronisation logic huge page aware
authorSteve Capper <[email protected]>
Wed, 2 Jul 2014 10:46:23 +0000 (11:46 +0100)
committerCatalin Marinas <[email protected]>
Fri, 4 Jul 2014 13:26:01 +0000 (14:26 +0100)
The __sync_icache_dcache routine will only flush the dcache for the
first page of a compound page, potentially leading to stale icache
data residing further on in a hugetlb page.

This patch addresses this issue by taking into consideration the
order of the page when flushing the dcache.

Reported-by: Mark Brown <[email protected]>
Tested-by: Mark Brown <[email protected]>
Signed-off-by: Steve Capper <[email protected]>
Acked-by: Will Deacon <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
Cc: <[email protected]> # v3.11+
arch/arm64/mm/flush.c

index e4193e3adc7f9dbbbe57c63eac0ee60b32aaa3e5..0d64089d28b517c4feef39ba350284809a159159 100644 (file)
@@ -79,7 +79,8 @@ void __sync_icache_dcache(pte_t pte, unsigned long addr)
                return;
 
        if (!test_and_set_bit(PG_dcache_clean, &page->flags)) {
-               __flush_dcache_area(page_address(page), PAGE_SIZE);
+               __flush_dcache_area(page_address(page),
+                               PAGE_SIZE << compound_order(page));
                __flush_icache_all();
        } else if (icache_is_aivivt()) {
                __flush_icache_all();
This page took 0.049553 seconds and 4 git commands to generate.