mirror-linux/arch/alpha/include/asm
Magnus Lindholm dd5712f337 alpha: fix user-space corruption during memory compaction
Alpha systems can suffer sporadic user-space crashes and heap
corruption when memory compaction is enabled.

Symptoms include SIGSEGV, glibc allocator failures (e.g. "unaligned
tcache chunk"), and compiler internal errors. The failures disappear
when compaction is disabled or when using global TLB invalidation.

The root cause is insufficient TLB shootdown during page migration.
Alpha relies on ASN-based MM context rollover for instruction cache
coherency, but this alone is not sufficient to prevent stale data or
instruction translations from surviving migration.

Fix this by introducing a migration-specific helper that combines:
  - MM context invalidation (ASN rollover),
  - immediate per-CPU TLB invalidation (TBI),
  - synchronous cross-CPU shootdown when required.

The helper is used only by migration/compaction paths to avoid changing
global TLB semantics.

Additionally, update flush_tlb_other(), pte_clear(), to use
READ_ONCE()/WRITE_ONCE() for correct SMP memory ordering.

This fixes observed crashes on both UP and SMP Alpha systems.

Reviewed-by: Ivan Kokshaysky <ink@unseen.parts>
Tested-by: Matoro Mahri <matoro_mailinglist_kernel@matoro.tk>
Tested-by: Michael Cree <mcree@orcon.net.nz>
Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
Link: https://lore.kernel.org/r/20260102173603.18247-2-linmag7@gmail.com
Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
2026-01-24 10:35:52 +01:00
..
Kbuild asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
agp_backend.h
asm-prototypes.h alpha: move __udiv_qrnnd library function to arch/alpha/lib/ 2021-09-18 14:45:48 -07:00
atomic.h locking/atomic: treewide: delete arch_atomic_*() kerneldoc 2023-06-05 09:57:24 +02:00
barrier.h alpha: Override READ_ONCE() with barriered implementation 2020-07-21 10:50:35 +01:00
bitops.h alpha: Add __attribute_const__ to ffs()-family implementations 2025-09-08 14:58:51 -07:00
bug.h
cache.h
cacheflush.h mm: rationalise flush_icache_pages() and flush_icache_page() 2023-08-24 16:20:25 -07:00
checksum.h saner calling conventions for csum_and_copy_..._user() 2020-08-20 15:45:15 -04:00
cmpxchg.h alpha: no need to include asm/xchg.h twice 2024-08-19 09:45:27 +02:00
compiler.h alpha: remove undef inline in compiler.h 2021-07-25 22:18:20 -07:00
console.h alpha: Replace __ASSEMBLY__ with __ASSEMBLER__ in the alpha headers 2025-12-08 23:10:30 +01:00
core_cia.h alpha: add full ioread64/iowrite64 implementation 2022-10-04 11:23:29 +02:00
core_irongate.h
core_marvel.h alpha: add full ioread64/iowrite64 implementation 2022-10-04 11:23:29 +02:00
core_mcpcia.h alpha: add full ioread64/iowrite64 implementation 2022-10-04 11:23:29 +02:00
core_polaris.h
core_t2.h alpha: sable: remove early machine support 2024-05-03 22:09:55 +02:00
core_titan.h
core_tsunami.h
core_wildfire.h
delay.h
device.h
dma-mapping.h alpha: remove DECpc AXP150 (Jensen) support 2024-05-03 22:09:50 +02:00
dma.h alpha: remove LCA and APECS based machines 2024-05-03 22:09:59 +02:00
elf.h alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support 2025-02-06 07:35:38 -08:00
emergency-restart.h
err_common.h
err_ev6.h
err_ev7.h
extable.h
floppy.h floppy: Remove unused CROSS_64KB() macro from arch/ code 2025-08-25 14:46:42 -06:00
fpu.h alpha: lazy FPU switching 2023-02-24 23:14:22 -05:00
ftrace.h
futex.h futex: arch_futex_atomic_op_inuser() calling conventions change 2020-03-27 23:58:51 -04:00
gct.h
hardirq.h
hw_irq.h
hwrpb.h alpha: Replace one-element array with flexible array member 2025-02-14 14:06:15 -05:00
io.h alpha: stop using asm-generic/iomap.h 2025-03-10 16:20:25 +01:00
io_trivial.h alpha: add full ioread64/iowrite64 implementation 2022-10-04 11:23:29 +02:00
irq.h alpha: cabriolet: remove EV5 CPU support 2024-05-03 22:10:03 +02:00
irqflags.h
linkage.h
local.h locking/local, arch: Rewrite local_add_unless() as a static inline function 2023-10-04 11:38:11 +02:00
machvec.h alpha: drop pre-EV56 support 2024-05-06 12:05:00 +02:00
mc146818rtc.h
mce.h
mmu.h
mmu_context.h alpha: drop pre-EV56 support 2024-05-06 12:05:00 +02:00
module.h
page.h alpha: Replace __ASSEMBLY__ with __ASSEMBLER__ in the alpha headers 2025-12-08 23:10:30 +01:00
pal.h alpha: Replace __ASSEMBLY__ with __ASSEMBLER__ in the alpha headers 2025-12-08 23:10:30 +01:00
parport.h
pci.h PCI/sysfs: Move declarations to linux/pci.h 2023-08-14 12:05:18 -05:00
percpu.h mm/percpu: conditionally define _shared_alloc_tag via CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU 2025-07-09 22:42:15 -07:00
perf_event.h
pgalloc.h mm/thp: define default pmd_pgtable() 2021-07-01 11:06:03 -07:00
pgtable.h alpha: fix user-space corruption during memory compaction 2026-01-24 10:35:52 +01:00
processor.h alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support 2025-02-06 07:35:38 -08:00
ptrace.h kill signal_pt_regs() 2022-10-23 18:06:54 -04:00
rwonce.h alpha: Override READ_ONCE() with barriered implementation 2020-07-21 10:50:35 +01:00
serial.h
setup.h alpha: Use absolute_pointer to define COMMAND_LINE 2021-09-15 12:04:28 -07:00
sfp-machine.h
shmparam.h
signal.h
smp.h
socket.h
sparsemem.h alpha: switch from DISCONTIGMEM to SPARSEMEM 2020-12-15 12:13:42 -08:00
special_insns.h alpha: drop pre-EV56 support 2024-05-06 12:05:00 +02:00
spinlock.h
spinlock_types.h Improve consistency of '#error' directive messages 2024-11-11 17:17:04 -08:00
string.h
switch_to.h
syscall.h alpha: Add syscall_get_return_value() 2021-07-25 22:33:03 -07:00
thread_info.h alpha: Replace __ASSEMBLY__ with __ASSEMBLER__ in the alpha headers 2025-12-08 23:10:30 +01:00
timex.h alpha: define get_cycles macro for arch-override 2022-05-13 23:59:23 +02:00
tlb.h
tlbflush.h alpha: fix user-space corruption during memory compaction 2026-01-24 10:35:52 +01:00
topology.h alpha: remove DISCONTIGMEM and NUMA 2021-06-29 10:53:55 -07:00
types.h
uaccess.h alpha: drop pre-EV56 support 2024-05-06 12:05:00 +02:00
ucontext.h
unistd.h alpha: replace NR_SYSCALLS by NR_syscalls 2023-02-14 12:37:17 -05:00
user.h asm/user.h: killed unused macros 2022-01-30 21:17:00 -05:00
vga.h alpha: sort scr_mem{cpy,move}w() out 2024-05-03 22:08:50 +02:00
vmalloc.h mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
word-at-a-time.h
wrperfmon.h
xor.h lib/xor: make xor prototypes more friendly to compiler vectorization 2022-02-11 20:39:39 +11:00