[Question] flush_dcache_page() need to flush icache?

Catalin Marinas catalin.marinas at arm.com
Tue Apr 30 11:26:35 EDT 2013


On Tue, Apr 30, 2013 at 11:02:36AM +0100, Ming Lei wrote:
> On Tue, Apr 30, 2013 at 5:05 PM, Catalin Marinas
> <catalin.marinas at arm.com> wrote:
> > On Tue, Apr 30, 2013 at 09:16:16AM +0100, Ming Lei wrote:
> >> Looks flush_dcache_page() need to deal with both dcache alias and I/D
> >> cache coherency, but set_pte_at() has already run __sync_icache_dcache()
> >> to make I/D cache coherency in the path of executable page fault.
> >>
> >> So could the flushing icache be removed in flush_dcache_page()?
> >
> > That's the case for (mapping && mapping_mapped(mapping)) where the
> > kernel modifies a page cache page which is already mapped in user space
> > and we won't get a subsequent set_pte_at() call.
> 
> OK, I got it, so looks it is only needed in self-modifying-code case,
> but I am wondering why it is always done for all cases of (mapping &&
> mapping_mapped(mapping))......

It's not self-modifying code, this would be code running in user space
which modifies some other code and it would invoke the ARM-specific
syscall for flushing.

Here it is about kernel modifying a page which is already mapped in user
space, hence the check for mapping && mapping_mapped.

-- 
Catalin



More information about the linux-arm-kernel mailing list