Skip to content

Commit 6475957

Browse files
stevecapperlinaroJoseph Salisbury
authored andcommitted
arm64: mm: Make icache synchronisation logic huge page aware
BugLink: http://bugs.launchpad.net/bugs/1356913 commit 923b8f5 upstream. 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 <broonie@linaro.org> Tested-by: Mark Brown <broonie@linaro.org> Signed-off-by: Steve Capper <steve.capper@linaro.org> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
1 parent 21c757e commit 6475957

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm64/mm/flush.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ void __sync_icache_dcache(pte_t pte, unsigned long addr)
7979
return;
8080

8181
if (!test_and_set_bit(PG_dcache_clean, &page->flags)) {
82-
__flush_dcache_area(page_address(page), PAGE_SIZE);
82+
__flush_dcache_area(page_address(page),
83+
PAGE_SIZE << compound_order(page));
8384
__flush_icache_all();
8485
} else if (icache_is_aivivt()) {
8586
__flush_icache_all();

0 commit comments

Comments
 (0)