[PATCH v2 0/2] alpha: enable DMA CMA support

From: Magnus Lindholm

Date: Sat Nov 14 2026 - 04:54:08 EST


This revision addresses Matt Turner's review of the original CMA patch.

Split early parameter parsing into a prerequisite patch. Use the generic
DMA contiguous allocation/free helpers, skip CMA on the GFP_DMA retry,
and use exact-size buddy allocations to match current helper semantics.
Remove the redundant highmem check and preserve existing zeroing.

Reserve top-down below the direct-map window and usable RAM limits.
This avoids preferentially taking low memory with bottom-up allocation;
it is not a strict exclusion of the first 16 MiB. Explicit cma= address
ranges retain the generic override semantics. If there is no direct-map
window, skip the default reservation.

The configured default is 16 MiB; cma=0 disables the default reservation.

These two patches apply independently on for-next at 0b4cadbe7c39.
The ES40 test kernel additionally contains jump-label v3. The combined
kernel, boot image and modules cross-build with W=1. Both CMA patches
pass checkpatch with no warnings or errors.

CMA testing on a three-CPU AlphaServer ES40 with cma=64M:

- Reserved 64 MiB at 0x7c000000, above the first 16 MiB and below
the 2 GiB direct-map limit.
- Ran four allocation cases on each CPU (12 cases total).
- 32 MiB and 24 KiB (three-page) GFP_KERNEL allocations used CMA.
- 8 KiB (one-page) GFP_KERNEL and 24 KiB GFP_ATOMIC allocations
bypassed CMA.
- All buffers passed zeroing and CPU write/read checks.
- CMA allocation/release counters balanced, and available_pages
returned to its pre-test value after each allocation was freed.

The initial harness compared CmaFree immediately after freeing a small
allocation. That was not a reliable per-allocation check; verification
using the CMA sysfs counters confirmed that all test pages were released.

No new kernel warnings or faults appeared during testing. These tests
exercise coherent allocation and freeing, not device-initiated DMA.
GFP_ATOMIC was tested from process context. Boots with cma=0, cma=4M
and the default size, fragmentation stress, and no-IOMMU platform
validation remain outstanding.

Link to v1:
https://lore.kernel.org/linux-alpha/20260219205514.4434-1-linmag7@xxxxxxxxx/

Magnus Lindholm (2):
alpha: parse early parameters before reserving contiguous memory
alpha: enable contiguous memory allocation for coherent DMA

.../io/dma-contiguous/arch-support.txt | 2 +-
arch/alpha/Kconfig | 1 +
arch/alpha/kernel/pci_iommu.c | 13 +++++++++----
arch/alpha/kernel/setup.c | 18 ++++++++++++++++++
4 files changed, 29 insertions(+), 5 deletions(-)


base-commit: 0b4cadbe7c39d830dec35c4a2655483de0dae568
--
2.43.0