]> git.baikalelectronics.ru Git - kernel.git/commit
xtensa/mm/highmem: Make generic kmap_atomic() work correctly
authorThomas Gleixner <tglx@linutronix.de>
Mon, 16 Nov 2020 19:32:53 +0000 (11:32 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 16 Nov 2020 20:19:24 +0000 (21:19 +0100)
commit7cb253c7e3868b7e71b00a3f63d9f00b53a0a5c5
tree402ec6ffc60b8f0e24495b78684704a4c3eeb19b
parentbaf080177aeedae450818edec6e4adbdfb5b204a
xtensa/mm/highmem: Make generic kmap_atomic() work correctly

The conversion to the generic kmap_atomic() implementation missed the fact
that xtensa's fixmap works bottom up while all other implementations work
top down. There is no real reason why xtensa needs to work that way.

Cure it by:

  - Using the generic fix_to_virt()/virt_to_fix() functions which work top
    down
  - Adjusting the mapping defines
  - Using the generic index calculation for the non cache aliasing case
  - Making the cache colour offset reverse so the effective index is correct

While at it, remove the outdated and misleading comment above the fixmap
enum which originates from the initial copy&pasta of this code from i386.

[ Max: Fixed the off by one in the index calculation ]

Fixes: 72fddec3042f ("xtensa/mm/highmem: Switch to generic kmap atomic")
Reported-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Link: https://lore.kernel.org/r/20201116193253.23875-1-jcmvbkbc@gmail.com
arch/xtensa/include/asm/fixmap.h
arch/xtensa/include/asm/highmem.h
arch/xtensa/mm/highmem.c
arch/xtensa/mm/init.c
arch/xtensa/mm/mmu.c