From: Sasha Levin <sasha.levin@oracle.com>
To: stable@vger.kernel.org, stable-commits@vger.kernel.org
Cc: Paul Burton <paul.burton@imgtec.com>,
Lars Persson <lars.persson@axis.com>,
Andrew Morton <akpm@linux-foundation.org>,
Jerome Marchand <jmarchan@redhat.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
Ralf Baechle <ralf@linux-mips.org>,
Sasha Levin <sasha.levin@oracle.com>
Subject: [added to the 4.1 stable tree] MIPS: Handle highmem pages in __update_cache
Date: Fri, 3 Jun 2016 17:36:24 -0400 [thread overview]
Message-ID: <1464989831-16666-89-git-send-email-sasha.levin@oracle.com> (raw)
In-Reply-To: <1464989831-16666-1-git-send-email-sasha.levin@oracle.com>
From: Paul Burton <paul.burton@imgtec.com>
This patch has been added to the 4.1 stable tree. If you have any
objections, please let us know.
===============
[ Upstream commit f4281bba818105c7c91799abe40bc05c0dbdaa25 ]
The following patch will expose __update_cache to highmem pages. Handle
them by mapping them in for the duration of the cache maintenance, just
like in __flush_dcache_page. The code for that isn't shared because we
need the page address in __update_cache so sharing became messy. Given
that the entirity is an extra 5 lines, just duplicate it.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Lars Persson <lars.persson@axis.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: stable <stable@vger.kernel.org> # v4.1+
Patchwork: https://patchwork.linux-mips.org/patch/12721/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
arch/mips/mm/cache.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index 77d96db..576169d 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -143,9 +143,17 @@ void __update_cache(struct vm_area_struct *vma, unsigned long address,
return;
page = pfn_to_page(pfn);
if (page_mapping(page) && Page_dcache_dirty(page)) {
- addr = (unsigned long) page_address(page);
+ if (PageHighMem(page))
+ addr = (unsigned long)kmap_atomic(page);
+ else
+ addr = (unsigned long)page_address(page);
+
if (exec || pages_do_alias(addr, address & PAGE_MASK))
flush_data_cache_page(addr);
+
+ if (PageHighMem(page))
+ __kunmap_atomic((void *)addr);
+
ClearPageDcacheDirty(page);
}
}
--
2.5.0
next prev parent reply other threads:[~2016-06-03 21:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1464989831-16666-1-git-send-email-sasha.levin@oracle.com>
2016-06-03 21:35 ` [added to the 4.1 stable tree] MIPS: Fix siginfo.h to use strict posix types Sasha Levin
2016-06-03 21:36 ` [added to the 4.1 stable tree] MIPS64: R6: R2 emulation bugfix Sasha Levin
2016-06-03 21:36 ` Sasha Levin [this message]
2016-06-03 21:36 ` [added to the 4.1 stable tree] MIPS: Sync icache & dcache in set_pte_at Sasha Levin
2016-06-03 21:36 ` [added to the 4.1 stable tree] SIGNAL: Move generic copy_siginfo() to signal.h Sasha Levin
2016-06-03 21:36 ` [added to the 4.1 stable tree] MIPS: math-emu: Fix jalr emulation when rd == $0 Sasha Levin
2016-06-03 21:36 ` [added to the 4.1 stable tree] MIPS: Disable preemption during prctl(PR_SET_FP_MODE, ...) Sasha Levin
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=1464989831-16666-89-git-send-email-sasha.levin@oracle.com \
--to=sasha.levin@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=jmarchan@redhat.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=lars.persson@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=paul.burton@imgtec.com \
--cc=ralf@linux-mips.org \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.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
all inboxes | Powered by JetHome®