The new preemtible kmap_local() implementation:

  - Consolidate all kmap_atomic() internals into a generic implementation
    which builds the base for the kmap_local() API and make the
    kmap_atomic() interface wrappers which handle the disabling/enabling of
    preemption and pagefaults.

  - Switch the storage from per-CPU to per task and provide scheduler
    support for clearing mapping when scheduling out and restoring them
    when scheduling back in.

  - Merge the migrate_disable/enable() code, which is also part of the
    scheduler pull request. This was required to make the kmap_local()
    interface available which does not disable preemption when a mapping
    is established. It has to disable migration instead to guarantee that
    the virtual address of the mapped slot is the same accross preemption.

  - Provide better debug facilities: guard pages and enforced utilization
    of the mapping mechanics on 64bit systems when the architecture allows

  - Provide the new kmap_local() API which can now be used to cleanup the
    kmap_atomic() usage sites all over the place. Most of the usage sites
    do not require the implicit disabling of preemption and pagefaults so
    the penalty on 64bit and 32bit non-highmem systems is removed and quite
    some of the code can be simplified. A wholesale conversion is not
    possible because some usage depends on the implicit side effects and
    some need to be cleaned up because they work around these side effects.

    The migrate disable side effect is only effective on highmem systems
    and when enforced debugging is enabled. On 64bit and 32bit non-highmem
    systems the overhead is completely avoided.
ARM: highmem: Fix cache_is_vivt() reference

The reference to cache_is_vivt() was moved into a header file,
which now causes a build failure in rare randconfig builds:

arch/arm/include/asm/highmem.h:52:43: error: implicit declaration of function 'cache_is_vivt' [-Werror,-Wimplicit-function-declaration]

Add an explicit include to make it build reliably.

Fixes: 2a15ba82fa6c ("ARM: highmem: Switch to generic kmap atomic")
Signed-off-by: Arnd Bergmann <>
Signed-off-by: Thomas Gleixner <>
Cc: Russell King <>
Cc: Andrew Morton <>
Cc: Ira Weiny <>

1 file changed