aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.sfo1.dsl.speakeasy.net>2006-06-01 20:47:25 -0400
committerDavid S. Miller <davem@sunset.sfo1.dsl.speakeasy.net>2006-06-01 20:47:25 -0400
commit0b0968a3e691771bf87e1ce747b2c7d23b5526c8 (patch)
tree71787e376b7aef54b48e99d15a0fc11c7cf7ee8d /include/asm-mips
parent951bc82c53f30ec6b4c2d04a051e74ea9a89b669 (diff)
[SPARC64]: Fix D-cache corruption in mremap
If we move a mapping from one virtual address to another, and this changes the virtual color of the mapping to those pages, we can see corrupt data due to D-cache aliasing. Check for and deal with this by overriding the move_pte() macro. Set things up so that other platforms can cleanly override the move_pte() macro too. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-mips')
-rw-r--r--include/asm-mips/pgtable.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 702a28fa7a34..69cebbd9f3e0 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -70,7 +70,15 @@ extern unsigned long zero_page_mask;
70#define ZERO_PAGE(vaddr) \ 70#define ZERO_PAGE(vaddr) \
71 (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))) 71 (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask)))
72 72
73#define __HAVE_ARCH_MULTIPLE_ZERO_PAGE 73#define __HAVE_ARCH_MOVE_PTE
74#define move_pte(pte, prot, old_addr, new_addr) \
75({ \
76 pte_t newpte = (pte); \
77 if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \
78 pte_page(pte) == ZERO_PAGE(old_addr)) \
79 newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \
80 newpte; \
81})
74 82
75extern void paging_init(void); 83extern void paging_init(void);
76 84