Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fix from Catalin Marinas:
"Fix arm64 regression introduced by limiting the CMA buffer to ZONE_DMA
on platforms where RAM starts above 4GB (and ZONE_DMA becoming 0)"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: Create non-empty ZONE_DMA when DRAM starts above 4GB

+13 -4
+13 -4
arch/arm64/mm/init.c
··· 60 60 early_param("initrd", early_initrd); 61 61 #endif 62 62 63 + /* 64 + * Return the maximum physical address for ZONE_DMA (DMA_BIT_MASK(32)). It 65 + * currently assumes that for memory starting above 4G, 32-bit devices will 66 + * use a DMA offset. 67 + */ 68 + static phys_addr_t max_zone_dma_phys(void) 69 + { 70 + phys_addr_t offset = memblock_start_of_DRAM() & GENMASK_ULL(63, 32); 71 + return min(offset + (1ULL << 32), memblock_end_of_DRAM()); 72 + } 73 + 63 74 static void __init zone_sizes_init(unsigned long min, unsigned long max) 64 75 { 65 76 struct memblock_region *reg; ··· 81 70 82 71 /* 4GB maximum for 32-bit only capable devices */ 83 72 if (IS_ENABLED(CONFIG_ZONE_DMA)) { 84 - unsigned long max_dma_phys = 85 - (unsigned long)(dma_to_phys(NULL, DMA_BIT_MASK(32)) + 1); 86 - max_dma = max(min, min(max, max_dma_phys >> PAGE_SHIFT)); 73 + max_dma = PFN_DOWN(max_zone_dma_phys()); 87 74 zone_size[ZONE_DMA] = max_dma - min; 88 75 } 89 76 zone_size[ZONE_NORMAL] = max - max_dma; ··· 155 146 156 147 /* 4GB maximum for 32-bit only capable devices */ 157 148 if (IS_ENABLED(CONFIG_ZONE_DMA)) 158 - dma_phys_limit = dma_to_phys(NULL, DMA_BIT_MASK(32)) + 1; 149 + dma_phys_limit = max_zone_dma_phys(); 159 150 dma_contiguous_reserve(dma_phys_limit); 160 151 161 152 memblock_allow_resize();