Skip to content

Commit 41dcfc0

Browse files
Nicolas Saenz Juliennegregkh
authored andcommitted
arm64: mm: Fix ARCH_LOW_ADDRESS_LIMIT when !CONFIG_ZONE_DMA
commit 095507d upstream. Systems configured with CONFIG_ZONE_DMA32, CONFIG_ZONE_NORMAL and !CONFIG_ZONE_DMA will fail to properly setup ARCH_LOW_ADDRESS_LIMIT. The limit will default to ~0ULL, effectively spanning the whole memory, which is too high for a configuration that expects low memory to be capped at 4GB. Fix ARCH_LOW_ADDRESS_LIMIT by falling back to arm64_dma32_phys_limit when arm64_dma_phys_limit isn't set. arm64_dma32_phys_limit will honour CONFIG_ZONE_DMA32, or span the entire memory when not enabled. Fixes: 1a8e1ce ("arm64: use both ZONE_DMA and ZONE_DMA32") Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20201218163307.10150-1-nsaenzjulienne@suse.de Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d4a7eb9 commit 41dcfc0

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎arch/arm64/include/asm/processor.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
#endif /* CONFIG_ARM64_FORCE_52BIT */
9797

9898
extern phys_addr_t arm64_dma_phys_limit;
99-
#define ARCH_LOW_ADDRESS_LIMIT (arm64_dma_phys_limit - 1)
99+
extern phys_addr_t arm64_dma32_phys_limit;
100+
#define ARCH_LOW_ADDRESS_LIMIT ((arm64_dma_phys_limit ? : arm64_dma32_phys_limit) - 1)
100101

101102
struct debug_info {
102103
#ifdef CONFIG_HAVE_HW_BREAKPOINT

‎arch/arm64/mm/init.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ EXPORT_SYMBOL(memstart_addr);
6060
* bit addressable memory area.
6161
*/
6262
phys_addr_t arm64_dma_phys_limit __ro_after_init;
63-
static phys_addr_t arm64_dma32_phys_limit __ro_after_init;
63+
phys_addr_t arm64_dma32_phys_limit __ro_after_init;
6464

6565
#ifdef CONFIG_KEXEC_CORE
6666
/*

0 commit comments

Comments
 (0)