Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=551ed332da2f52daf5d01fc76d2a894aba79d316
Commit:     551ed332da2f52daf5d01fc76d2a894aba79d316
Parent:     f5903ede0015db5b53458092b6ae2af074fa49d4
Author:     Scott Wood <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 6 06:43:26 2008 +1100
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Wed Feb 6 16:30:01 2008 +1100

    [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 <[EMAIL PROTECTED]>
    Acked-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/mm/mem.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index e812244..c7d7bd4 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,
                 */
                _tlbie(address, 0 /* 8xx doesn't care about PID */);
 #endif
-               if (!PageReserved(page)
+               /* The _PAGE_USER test should really be _PAGE_EXEC, but
+                * older glibc versions execute some code from no-exec
+                * pages, which for now we are supporting.  If exec-only
+                * pages are ever implemented, this will have to change.
+                */
+               if (!PageReserved(page) && (pte_val(pte) & _PAGE_USER)
                    && !test_bit(PG_arch_1, &page->flags)) {
                        if (vma->vm_mm == current->active_mm) {
                                __flush_dcache_icache((void *) address);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to