Skip to content

Commit

Permalink
arm64: mm: Make icache synchronisation logic huge page aware
Browse files Browse the repository at this point in the history
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+
  • Loading branch information
stevecapperlinaro authored and ctmarinas committed Jul 4, 2014
1 parent f3b766a commit 923b8f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm64/mm/flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 923b8f5

Please sign in to comment.