Commit b1f2bfc9 authored by Catalin Marinas's avatar Catalin Marinas Committed by Greg Kroah-Hartman

arm64: Do not synchronise I and D caches for special ptes

commit 71fdb6bf upstream.

Special pte mappings are not intended to be executable and do not even
have an associated struct page. This patch ensures that we do not call
__sync_icache_dcache() on such ptes.
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Reported-by: default avatarSteve Capper <Steve.Capper@arm.com>
Tested-by: default avatarLaura Abbott <lauraa@codeaurora.org>
Tested-by: default avatarBharat Bhushan <Bharat.Bhushan@freescale.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bdec4322
...@@ -161,7 +161,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, ...@@ -161,7 +161,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, pte_t pte) pte_t *ptep, pte_t pte)
{ {
if (pte_valid_user(pte)) { if (pte_valid_user(pte)) {
if (pte_exec(pte)) if (!pte_special(pte) && pte_exec(pte))
__sync_icache_dcache(pte, addr); __sync_icache_dcache(pte, addr);
if (!pte_dirty(pte)) if (!pte_dirty(pte))
pte = pte_wrprotect(pte); pte = pte_wrprotect(pte);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment