Skip to content

Commit eeb8fdf

Browse files
D Scott Phillipswilldeacon
authored andcommitted
arm64: Expose the end of the linear map in PHYSMEM_END
The memory hot-plug and resource management code needs to know the largest address which can fit in the linear map, so set PHYSMEM_END for that purpose. This fixes a crash at boot when amdgpu tries to create DEVICE_PRIVATE_MEMORY and is given a physical address by the resource management code which is outside the range which can have a `struct page` | Unable to handle kernel paging request at virtual address 000001ffa6000034 | user pgtable: 4k pages, 48-bit VAs, pgdp=000008000287c000 | [000001ffa6000034] pgd=0000000000000000, p4d=0000000000000000 | Call trace: | __init_zone_device_page.constprop.0+0x2c/0xa8 | memmap_init_zone_device+0xf0/0x210 | pagemap_range+0x1e0/0x410 | memremap_pages+0x18c/0x2e0 | devm_memremap_pages+0x30/0x90 | kgd2kfd_init_zone_device+0xf0/0x200 [amdgpu] | amdgpu_device_ip_init+0x674/0x888 [amdgpu] | amdgpu_device_init+0x7a4/0xea0 [amdgpu] | amdgpu_driver_load_kms+0x28/0x1c0 [amdgpu] | amdgpu_pci_probe+0x1a0/0x560 [amdgpu] Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com> Link: https://lore.kernel.org/r/20240903164532.3874988-1-scott@os.amperecomputing.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 7eced90 commit eeb8fdf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/arm64/include/asm/memory.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@
110110
#define PAGE_END (_PAGE_END(VA_BITS_MIN))
111111
#endif /* CONFIG_KASAN */
112112

113+
#define PHYSMEM_END __pa(PAGE_END - 1)
114+
113115
#define MIN_THREAD_SHIFT (14 + KASAN_THREAD_SHIFT)
114116

115117
/*

0 commit comments

Comments
 (0)