Skip to content

Commit 8fac67c

Browse files
Sudarshan Rajagopalanwilldeacon
authored andcommitted
arm64: mm: update max_pfn after memory hotplug
After new memory blocks have been hotplugged, max_pfn and max_low_pfn needs updating to reflect on new PFNs being hot added to system. Without this patch, debug-related functions that use max_pfn such as get_max_dump_pfn() or read_page_owner() will not work with any page in memory that is hot-added after boot. Fixes: 4ab2150 ("arm64: Add memory hotplug support") Signed-off-by: Sudarshan Rajagopalan <[email protected]> Signed-off-by: Chris Goldsworthy <[email protected]> Acked-by: David Hildenbrand <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Georgi Djakov <[email protected]> Tested-by: Georgi Djakov <[email protected]> Link: https://lore.kernel.org/r/a51a27ee7be66024b5ce626310d673f24107bcb8.1632853776.git.quic_cgoldswo@quicinc.com Signed-off-by: Will Deacon <[email protected]>
1 parent f8b46c4 commit 8fac67c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/arm64/mm/mmu.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,11 @@ int arch_add_memory(int nid, u64 start, u64 size,
14991499
if (ret)
15001500
__remove_pgd_mapping(swapper_pg_dir,
15011501
__phys_to_virt(start), size);
1502+
else {
1503+
max_pfn = PFN_UP(start + size);
1504+
max_low_pfn = max_pfn;
1505+
}
1506+
15021507
return ret;
15031508
}
15041509

0 commit comments

Comments
 (0)