linux/arch/sh/include/asm
Qi Zheng db6b435d73 mm: pgtable: introduce pagetable_dtor()
The pagetable_p*_dtor() are exactly the same except for the handling of
ptlock.  If we make ptlock_free() handle the case where ptdesc->ptl is
NULL and remove VM_BUG_ON_PAGE() from pmd_ptlock_free(), we can unify
pagetable_p*_dtor() into one function.  Let's introduce pagetable_dtor()
to do this.

Later, pagetable_dtor() will be moved to tlb_remove_ptdesc(), so that
ptlock and page table pages can be freed together (regardless of whether
RCU is used).  This prevents the use-after-free problem where the ptlock
is freed immediately but the page table pages is freed later via RCU.

Link: https://lkml.kernel.org/r/47f44fff9dc68d9d9e9a0d6c036df275f820598a.1736317725.git.zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Originally-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>	[s390]
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-01-25 20:22:22 -08:00
..
adc.h
addrspace.h
alignment.h
asm-offsets.h
atomic-grb.h locking/atomic: sh: add preprocessor symbols 2023-06-05 09:57:16 +02:00
atomic-irq.h locking/atomic: sh: add preprocessor symbols 2023-06-05 09:57:16 +02:00
atomic-llsc.h locking/atomic: sh: add preprocessor symbols 2023-06-05 09:57:16 +02:00
atomic.h locking/atomic: make atomic*_{cmp,}xchg optional 2023-06-05 09:57:14 +02:00
barrier.h
bitops-cas.h
bitops-grb.h
bitops-llsc.h
bitops-op32.h
bitops.h
bl_bit.h
bl_bit_32.h
bug.h
cache.h sh: move the ARCH_DMA_MINALIGN definition to asm/cache.h 2023-06-19 16:19:24 -07:00
cache_insns.h
cache_insns_32.h
cacheflush.h sh: cache: Move forward declarations to <asm/cacheflush.h> 2024-05-02 12:01:31 +02:00
cachetype.h Introduce cpu_dcache_is_aliasing() across all architectures 2024-02-22 15:27:19 -08:00
checksum.h
checksum_32.h
clock.h
cmpxchg-cas.h
cmpxchg-grb.h
cmpxchg-irq.h
cmpxchg-llsc.h
cmpxchg-xchg.h
cmpxchg.h sh: Emulate one-byte cmpxchg 2024-09-13 07:10:38 -07:00
device.h
dma-register.h
dma.h sh: dma: Remove unused functionality 2024-05-02 12:01:25 +02:00
dmabrg.h
dwarf.h
elf.h
entry-macros.S
extable.h
fixmap.h
flat.h move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
fpu.h sh: fpu: Add missing forward declarations 2024-05-02 12:01:23 +02:00
freq.h
ftrace.h sh: ftrace: Fix missing prototypes 2024-05-02 12:01:24 +02:00
futex-cas.h
futex-irq.h
futex-llsc.h
futex.h
hardirq.h
hd64461.h sh: hd64461: Handle virq offset for offchip IRQ base and HD64461 IRQ 2023-07-13 08:37:53 +02:00
heartbeat.h
hugetlb.h mm: consolidate common checks in hugetlb_get_unmapped_area 2024-11-06 20:11:10 -08:00
hw_breakpoint.h sh: hw_breakpoint: Add missing forward declaration for arch_bp_generic_fields() 2024-05-02 12:01:23 +02:00
hw_irq.h
i2c-sh7760.h
io.h asm/io: remove unnecessary xlate_dev_mem_ptr() and unxlate_dev_mem_ptr() 2023-11-23 10:37:40 +01:00
io_generic.h
io_noioport.h sh: add <asm-generic/io.h> including 2023-08-18 10:12:34 -07:00
io_trapped.h
irq.h sh: Remove unused declarations for make_maskreg_irq() and irq_mask_register 2024-09-26 17:24:51 +02:00
irqflags.h
Kbuild asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
kdebug.h
kexec.h sh, kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC 2023-12-12 17:20:18 -08:00
kgdb.h
kprobes.h kprobes: unify kprobes_exceptions_nofify() prototypes 2023-11-10 19:59:05 +09:00
linkage.h
machvec.h sh: machvec: Remove custom ioport_{un,}map() 2023-10-25 16:50:30 +02:00
mmiowb.h
mmu.h
mmu_context.h
mmu_context_32.h
mmzone.h arch, mm: move definition of node_data to generic code 2024-09-03 21:15:28 -07:00
module.h
page.h asm-generic updates for 6.13 2024-11-20 15:13:02 -08:00
pci.h
perf_event.h
pgalloc.h mm: pgtable: introduce pagetable_dtor() 2025-01-25 20:22:22 -08:00
pgtable-2level.h
pgtable-3level.h
pgtable.h sh: implement the new page table range API 2023-08-24 16:20:23 -07:00
pgtable_32.h Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
platform_early.h
posix_types.h
processor.h sh/cpu: Switch to arch_cpu_finalize_init() 2023-06-16 10:16:00 +02:00
processor_32.h
ptrace.h
ptrace_32.h
push-switch.h
reboot.h
romimage-macros.h
rtc.h init: consolidate prototypes in linux/init.h 2023-06-09 17:44:16 -07:00
seccomp.h
sections.h
setup.h sh: setup: Add missing forward declaration for sh_fdt_init() 2024-05-13 15:37:11 +02:00
sfp-machine.h
sh7760fb.h
sh_bios.h
shmparam.h
siu.h
smc37c93x.h
smp-ops.h
smp.h
sparsemem.h
spi.h
spinlock-cas.h
spinlock-llsc.h
spinlock.h
spinlock_types.h Improve consistency of '#error' directive messages 2024-11-11 17:17:04 -08:00
sram.h
stackprotector.h
stacktrace.h
string.h
string_32.h
suspend.h
switch_to.h
switch_to_32.h
syscall.h
syscall_32.h
syscalls.h sh: syscall: Add missing forward declaration for sys_cacheflush() 2024-05-02 12:01:23 +02:00
syscalls_32.h
thread_info.h thread_info: move function declarations to linux/thread_info.h 2023-06-09 17:44:16 -07:00
timex.h
tlb.h sh: tlb: Add missing forward declaration for handle_tlbmiss() 2024-05-02 12:01:23 +02:00
tlbflush.h
topology.h
traps.h
traps_32.h arch: add do_page_fault prototypes 2023-11-23 11:32:32 +01:00
types.h
uaccess.h
uaccess_32.h
uncached.h
unistd.h clone3: drop __ARCH_WANT_SYS_CLONE3 macro 2024-07-10 14:23:38 +02:00
unwinder.h
user.h
vermagic.h
vmalloc.h
vmlinux.lds.h
watchdog.h
word-at-a-time.h kernel.h: removed REPEAT_BYTE from kernel.h 2024-02-01 09:47:59 -08:00