]> www.infradead.org Git - users/jedix/linux-maple.git/commit
arm64: Expose the end of the linear map in PHYSMEM_END
authorD Scott Phillips <scott@os.amperecomputing.com>
Tue, 3 Sep 2024 16:45:32 +0000 (09:45 -0700)
committerWill Deacon <will@kernel.org>
Wed, 4 Sep 2024 15:39:58 +0000 (16:39 +0100)
commiteeb8fdfcf0901578c26ecfb11e814f36bc9a92f5
tree8db23f198f15bc7752a762e68f3818517e729342
parent7eced90b202d63cdc1b9b11b1353adb1389830f9
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>
arch/arm64/include/asm/memory.h