]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
arm64: mm: Preserve non-contiguous descriptors when mapping DRAM
authorArd Biesheuvel <ardb@kernel.org>
Fri, 29 May 2026 15:01:56 +0000 (17:01 +0200)
committerWill Deacon <will@kernel.org>
Tue, 2 Jun 2026 15:29:15 +0000 (16:29 +0100)
commitecda73ae92cab57611037cec8d29dd6f2ca68fe2
treead53e7510e8d54fd50a90e3f1422ef37978c2f04
parenta64293e993f6ee6b5dcf107d3a7aa8c6ccca029c
arm64: mm: Preserve non-contiguous descriptors when mapping DRAM

Instead of blindly overwriting existing live entries regardless of the
value of their contiguous bit when mapping DRAM regions at
contiguous-hint granularity, check whether the contiguous region in
question contains any valid descriptors that have the contiguous bit
cleared, and in that case, leave the contiguous bit unset on the entire
region. This permits the logic of mapping the kernel's linear alias to
be simplified in a subsequent patch.

Note that this can only result in a misprogrammed contiguous bit (as per
ARM ARM RNGLXZ) if the region in question already contains a mix of
valid contiguous and valid non-contiguous descriptors, in which case it
was already misprogrammed to begin with.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/pgtable.h
arch/arm64/mm/mmu.c