android_kernel_motorola_sm6375/arch/sparc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Roberts dc076ef13a sparc/mm: disable preemption in lazy mmu mode
commit a1d416bf9faf4f4871cb5a943614a07f80a7d70f upstream.

Since commit 38e0edb15b ("mm/apply_to_range: call pte function with lazy
updates") it's been possible for arch_[enter|leave]_lazy_mmu_mode() to be
called without holding a page table lock (for the kernel mappings case),
and therefore it is possible that preemption may occur while in the lazy
mmu mode.  The Sparc lazy mmu implementation is not robust to preemption
since it stores the lazy mode state in a per-cpu structure and does not
attempt to manage that state on task switch.

Powerpc had the same issue and fixed it by explicitly disabling preemption
in arch_enter_lazy_mmu_mode() and re-enabling in
arch_leave_lazy_mmu_mode().  See commit b9ef323ea168 ("powerpc/64s:
Disable preemption in hash lazy mmu mode").

Given Sparc's lazy mmu mode is based on powerpc's, let's fix it in the
same way here.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 38e0edb15b ("mm/apply_to_range: call pte function with lazy updates")
Signed-off-by: Ryan Roberts <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Acked-by: Andreas Larsson <[email protected]>
Acked-by: Juergen Gross <[email protected]>
Cc: Borislav Betkov <[email protected]>
Cc: Boris Ostrovsky <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Juegren Gross <[email protected]>
Cc: Matthew Wilcow (Oracle) <[email protected]>
Cc: Thomas Gleinxer <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2025-05-02 07:39:16 +02:00
..
boot
configs
crypto
include sparc64: Fix incorrect function signature and add prototype for prom_cif_init 2024-08-19 05:33:32 +02:00
kernel sparc: fix old compat_sys_select() 2024-07-05 09:08:27 +02:00
lib
math-emu
mm sparc/mm: disable preemption in lazy mmu mode 2025-05-02 07:39:16 +02:00
net
oprofile
power
prom sparc64: Fix incorrect function signature and add prototype for prom_cif_init 2024-08-19 05:33:32 +02:00
vdso sparc: vDSO: fix return value of __setup handler 2024-04-13 12:51:22 +02:00
Kbuild
Kconfig sparc/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:56:34 +02:00
Kconfig.debug
Makefile