Style comment below.... > From: Mike Frysinger <vapier....@gmail.com> > > When working with FDPIC, there are many shared mappings of read-only code > regions between applications (the C library, applet packages like busybox, > etc.), but the current do_mmap_pgoff() function will issue an icache flush > whenever a VMA is added to an MM instead of only doing it when the map is > initially created.
[...] > Signed-off-by: David Howells <dhowe...@redhat.com> > --- [...] > diff --git a/mm/nommu.c b/mm/nommu.c > index 1544a65..bffbdfc 100644 > --- a/mm/nommu.c > +++ b/mm/nommu.c > @@ -432,6 +432,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) > /* > * Ok, looks good - let it rip. > */ > + flush_icache_range(mm->brk, brk); > return mm->brk = brk; > } > > @@ -1354,10 +1355,14 @@ unsigned long do_mmap_pgoff(struct file *file, > share: > add_vma_to_mm(current->mm, vma); > > - up_write(&nommu_region_sem); > + /* we flush the region from the icache only when the first executable > + * mapping of it is made */ > + if (vma->vm_flags & VM_EXEC && !region->vm_icache_flushed) { As a "style pointer", would you please put parens around your bit masking.... It would make me feel better. :) if ((vma->vm_flags & VM_EXEC) && ... Similar comment for part 4. Thanks for all your work on this!! all the best, *brianW > + flush_icache_range(region->vm_start, region->vm_end); > + region->vm_icache_flushed = true; > + } > > - if (prot & PROT_EXEC) > - flush_icache_range(result, result + len); > + up_write(&nommu_region_sem); > > kleave(" = %lx", result); > return result; > > _______________________________________________ > uClinux-dev mailing list _______________________________________________ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev