aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/mem.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2008-02-05 14:43:26 -0500
committerPaul Mackerras <paulus@samba.org>2008-02-06 00:30:01 -0500
commit551ed332da2f52daf5d01fc76d2a894aba79d316 (patch)
treea7b6ef800cf9d32344fe3e6989eb17607e00fd3c /arch/powerpc/mm/mem.c
parentf5903ede0015db5b53458092b6ae2af074fa49d4 (diff)
[POWERPC] update_mmu_cache: Don't cache-flush non-readable pages
Currently, update_mmu_cache will crash if given a no-access PTE. There's no need to synchronize dcache/icache unless it's an exec mapping -- however, due to the existence of older glibc versions that execute out of a read-but-no-exec page, readability is tested instead. This assumes no exec-only mappings; if such mappings become supported, they will need to go through the kmap_atomic() version of dcache/icache synchronization. This fixes a bug reported by some users where the kernel would crash while dumping core on a threaded program. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/mm/mem.c')
-rw-r--r--arch/powerpc/mm/mem.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index e8122447f019..c7d7bd43a251 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -483,7 +483,12 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
483 */ 483 */
484 _tlbie(address, 0 /* 8xx doesn't care about PID */); 484 _tlbie(address, 0 /* 8xx doesn't care about PID */);
485#endif 485#endif
486 if (!PageReserved(page) 486 /* The _PAGE_USER test should really be _PAGE_EXEC, but
487 * older glibc versions execute some code from no-exec
488 * pages, which for now we are supporting. If exec-only
489 * pages are ever implemented, this will have to change.
490 */
491 if (!PageReserved(page) && (pte_val(pte) & _PAGE_USER)
487 && !test_bit(PG_arch_1, &page->flags)) { 492 && !test_bit(PG_arch_1, &page->flags)) {
488 if (vma->vm_mm == current->active_mm) { 493 if (vma->vm_mm == current->active_mm) {
489 __flush_dcache_icache((void *) address); 494 __flush_dcache_icache((void *) address);