linux-sg2042/arch/arm
Ard Biesheuvel 825c43f50e kmap_local: don't assume kmap PTEs are linear arrays in memory
The kmap_local conversion broke the ARM architecture, because the new
code assumes that all PTEs used for creating kmaps form a linear array
in memory, and uses array indexing to look up the kmap PTE belonging to
a certain kmap index.

On ARM, this cannot work, not only because the PTE pages may be
non-adjacent in memory, but also because ARM/!LPAE interleaves hardware
entries and extended entries (carrying software-only bits) in a way that
is not compatible with array indexing.

Fortunately, this only seems to affect configurations with more than 8
CPUs, due to the way the per-CPU kmap slots are organized in memory.

Work around this by permitting an architecture to set a Kconfig symbol
that signifies that the kmap PTEs do not form a lineary array in memory,
and so the only way to locate the appropriate one is to walk the page
tables.

Link: https://lore.kernel.org/linux-arm-kernel/20211026131249.3731275-1-ardb@kernel.org/
Link: https://lkml.kernel.org/r/20211116094737.7391-1-ardb@kernel.org
Fixes: 2a15ba82fa ("ARM: highmem: Switch to generic kmap atomic")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reported-by: Quanyang Wang <quanyang.wang@windriver.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-11-20 10:35:54 -08:00
..
boot USB / Thunderbolt changes for 5.16-rc1 2021-11-04 07:50:43 -07:00
common Merge branches 'devel-stable' and 'misc' into for-linus 2021-11-02 09:04:22 +00:00
configs ARM: defconfig updates for 5.16 2021-11-03 17:07:02 -07:00
crypto
include asm-generic: asm/syscall.h cleanup 2021-11-10 11:22:03 -08:00
kernel Devicetree updates for v5.16: 2021-11-02 22:22:13 -07:00
lib
mach-actions
mach-alpine
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 ARM: SoC updates for v5.16 2021-11-03 16:48:32 -07:00
mach-axxia
mach-bcm Devicetree updates for v5.16: 2021-11-02 22:22:13 -07:00
mach-berlin
mach-clps711x
mach-cns3xxx
mach-davinci
mach-digicolor
mach-dove
mach-ep93xx ep93xx: clock: convert in-place to COMMON_CLK 2021-10-20 17:46:36 +02:00
mach-exynos rtc: s3c: remove HAVE_S3C_RTC in favor of direct dependencies 2021-10-17 19:15:12 +02:00
mach-footbridge
mach-gemini
mach-highbank
mach-hisi memblock: rename memblock_free to memblock_phys_free 2021-11-06 13:30:41 -07:00
mach-imx ARM development for 5.16: 2021-11-02 11:33:15 -07:00
mach-integrator clk: versatile: Rename ICST to CLK_ICST 2021-10-14 18:00:25 -07:00
mach-iop32x
mach-ixp4xx
mach-keystone
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson
mach-milbeaut
mach-mmp
mach-moxart
mach-mstar
mach-mv78xx0
mach-mvebu
mach-mxs
mach-nomadik
mach-npcm
mach-nspire
mach-omap1 Updates for the interrupt subsystem: 2021-11-01 13:09:10 -07:00
mach-omap2 ARM: SoC updates for v5.16 2021-11-03 16:48:32 -07:00
mach-orion5x
mach-oxnas
mach-pxa
mach-qcom ARM: SoC drivers for 5.16 2021-11-03 17:00:52 -07:00
mach-rda
mach-realtek
mach-realview clk: versatile: Rename ICST to CLK_ICST 2021-10-14 18:00:25 -07:00
mach-rockchip
mach-rpc
mach-s3c ARM: SoC updates for v5.16 2021-11-03 16:48:32 -07:00
mach-s5pv210 rtc: s3c: remove HAVE_S3C_RTC in favor of direct dependencies 2021-10-17 19:15:12 +02:00
mach-sa1100 ARM: 9101/1: sa1100/assabet: convert LEDs to gpiod APIs 2021-10-25 13:11:54 +01:00
mach-shmobile
mach-socfpga
mach-spear
mach-sti
mach-stm32
mach-sunxi
mach-tegra
mach-uniphier
mach-ux500 clk: ux500: Add driver for the reset portions of PRCC 2021-10-26 18:06:05 -07:00
mach-versatile clk: versatile: Rename ICST to CLK_ICST 2021-10-14 18:00:25 -07:00
mach-vexpress clk: versatile: Rename ICST to CLK_ICST 2021-10-14 18:00:25 -07:00
mach-vt8500
mach-zynq
mm ARM fixes for 5.16-rc1: 2021-11-14 11:30:50 -08:00
net Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-11-01 19:59:46 -07:00
nwfpe
plat-omap
plat-orion
plat-pxa
plat-versatile
probes ARM development for 5.16: 2021-11-02 11:33:15 -07:00
tools futex,arm: Wire up sys_futex_waitv() 2021-10-07 13:51:12 +02:00
vdso
vfp
xen xen: allow pv-only hypercalls only with CONFIG_XEN_PV 2021-11-02 08:11:01 -05:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig kmap_local: don't assume kmap PTEs are linear arrays in memory 2021-11-20 10:35:54 -08:00
Kconfig-nommu
Kconfig.assembler
Kconfig.debug
Makefile ARM fixes for 5.16-rc1: 2021-11-14 11:30:50 -08:00