Discontiguous memory and cacheflush

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Aug 13 12:00:08 EDT 2012


On Mon, Aug 13, 2012 at 03:42:52PM +0100, Jonathan Austin wrote:
> On my system the cacheflush(2) documentation suggests it is MIPS only:
> "This  Linux-specific  system call is only available on MIPS based
> systems.  It should not be used in programs intended to be portable."

It's been part of the ARM kernel API for a very long time.

> As you've established by looking at the code, on ARM we intentionally
> attempt to flush only the part of the given range that occurs inside the
> vma containing 'start'.

It's intention is to support self-modifying userspace code only and also
intended to be used over a _short_ range of addresses only - it works by
flushing each _individual_ cache line over the range of addreses
requested.

If it's going to be used for significantly larger areas, then we need to
think about imposing a limit, upon which we just flush the entire cache
and be done with it.



More information about the linux-arm-kernel mailing list