aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mm/fault-armv.c7
-rw-r--r--arch/arm/mm/flush.c11
-rw-r--r--arch/arm/mm/mmu.c2
3 files changed, 18 insertions, 2 deletions
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index d0d17b6a3703..4fbc7de8b4ac 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -151,7 +151,14 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
151 if (!pfn_valid(pfn)) 151 if (!pfn_valid(pfn))
152 return; 152 return;
153 153
154 /*
155 * The zero page is never written to, so never has any dirty
156 * cache lines, and therefore never needs to be flushed.
157 */
154 page = pfn_to_page(pfn); 158 page = pfn_to_page(pfn);
159 if (page == ZERO_PAGE(0))
160 return;
161
155 mapping = page_mapping(page); 162 mapping = page_mapping(page);
156#ifndef CONFIG_SMP 163#ifndef CONFIG_SMP
157 if (test_and_clear_bit(PG_dcache_dirty, &page->flags)) 164 if (test_and_clear_bit(PG_dcache_dirty, &page->flags))
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 43474d8752a6..82f4b06bf6b4 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -189,7 +189,16 @@ static void __flush_dcache_aliases(struct address_space *mapping, struct page *p
189 */ 189 */
190void flush_dcache_page(struct page *page) 190void flush_dcache_page(struct page *page)
191{ 191{
192 struct address_space *mapping = page_mapping(page); 192 struct address_space *mapping;
193
194 /*
195 * The zero page is never written to, so never has any dirty
196 * cache lines, and therefore never needs to be flushed.
197 */
198 if (page == ZERO_PAGE(0))
199 return;
200
201 mapping = page_mapping(page);
193 202
194#ifndef CONFIG_SMP 203#ifndef CONFIG_SMP
195 if (!PageHighMem(page) && mapping && !mapping_mapped(mapping)) 204 if (!PageHighMem(page) && mapping && !mapping_mapped(mapping))
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index ea67be0223ac..2427cdcd9098 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1036,7 +1036,7 @@ void __init paging_init(struct machine_desc *mdesc)
1036 */ 1036 */
1037 zero_page = alloc_bootmem_low_pages(PAGE_SIZE); 1037 zero_page = alloc_bootmem_low_pages(PAGE_SIZE);
1038 empty_zero_page = virt_to_page(zero_page); 1038 empty_zero_page = virt_to_page(zero_page);
1039 flush_dcache_page(empty_zero_page); 1039 __flush_dcache_page(NULL, empty_zero_page);
1040} 1040}
1041 1041
1042/* 1042/*