Re: [patch] cache flush bug in mm/filemap.c (all kernels >= 2.5.30(at least))

Russell King (rmk@arm.linux.org.uk)
Thu, 22 May 2003 15:11:56 +0100


On Thu, May 22, 2003 at 02:34:56PM +0200, LW@KARO-electronics.de wrote:
> in file 'mm/filemap.c' a call to 'flush_dcache_page' is missing as a
> replacement for the obsoleted 'flush_page_to_ram' call that was
> present there in older kernels.
>
> This missing macro call produces data errors when randomly reading an
> 'mmap'ed file (e.g. leading to segfaults, when a program is executed).
>
> In kernels < 2.5.46 the deprecated macro call was still present
> (defined to do nothing), while in later kernels the call has been
> removed.
>
> Below are two patches generated against kernel versions 2.5.30 and
> 2.5.68 which should also be applicable to other kernels (with a hunk
> offset).

We seem to have flush_icache_page() in install_page() - I wonder whether
we should also have flush_dcache_page() in there as well.

I've always been confused about what flush_icache_page() is there for,
and its a no-op on ARM. Whether it should or shouldn't be is an
unanswered question, and will probably remain unanswered until I can
sit down and go through the whole of the VM layer, working out exactly
what it requires and where today.

Maybe someone more knowledgeable of the VM layer can comment.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/