From: steve.capper@linaro.org (Steve Capper)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] arm: mm: fix dcache flush logic for compound high pages
Date: Fri, 13 Dec 2013 12:06:30 +0000 [thread overview]
Message-ID: <1386936391-30493-2-git-send-email-steve.capper@linaro.org> (raw)
In-Reply-To: <1386936391-30493-1-git-send-email-steve.capper@linaro.org>
When given a compound high page, __flush_dcache_page will only flush
the first page of the compound page repeatedly rather than the entire
set of constituent pages.
This patch corrects the logic such that all constituent pages are now
flushed.
Signed-off-by: Steve Capper <steve.capper@linaro.org>
---
arch/arm/mm/flush.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 6d5ba9a..4962302 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -173,18 +173,19 @@ void __flush_dcache_page(struct address_space *mapping, struct page *page)
__cpuc_flush_dcache_area(page_address(page), page_size);
} else {
unsigned long i;
+ struct page *cpage = page;
if (cache_is_vipt_nonaliasing()) {
- for (i = 0; i < (1 << compound_order(page)); i++) {
- void *addr = kmap_atomic(page);
+ for (i = 0; i < (1 << compound_order(page)); cpage++, i++) {
+ void *addr = kmap_atomic(cpage);
__cpuc_flush_dcache_area(addr, PAGE_SIZE);
kunmap_atomic(addr);
}
} else {
- for (i = 0; i < (1 << compound_order(page)); i++) {
- void *addr = kmap_high_get(page);
+ for (i = 0; i < (1 << compound_order(page)); cpage++, i++) {
+ void *addr = kmap_high_get(cpage);
if (addr) {
__cpuc_flush_dcache_area(addr, PAGE_SIZE);
- kunmap_high(page);
+ kunmap_high(cpage);
}
}
}
--
1.8.1.4
next prev parent reply other threads:[~2013-12-13 12:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-13 12:06 [PATCH 0/2] Cache flush fixes Steve Capper
2013-12-13 12:06 ` Steve Capper [this message]
2013-12-13 16:38 ` [PATCH 1/2] arm: mm: fix dcache flush logic for compound high pages Will Deacon
2013-12-16 15:07 ` Steve Capper
2013-12-13 12:06 ` [PATCH 2/2] arm: cacheflush: Fix user split-caching logic Steve Capper
2013-12-13 12:41 ` Steve Capper
2013-12-13 12:51 ` Steve Capper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1386936391-30493-2-git-send-email-steve.capper@linaro.org \
--to=steve.capper@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).