Skip to content

Commit 6722b25

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm/altmap: Fix altmap boundary check
altmap->free includes the entire free space from which altmap blocks can be allocated. So when checking whether the kernel is doing altmap block free, compute the boundary correctly, otherwise memory hotunplug can fail. Fixes: 9ef3463 ("powerpc/mm: Fallback to RAM if the altmap is unusable") Signed-off-by: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230724181320.471386-1-aneesh.kumar@linux.ibm.com
1 parent 106ea7f commit 6722b25

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/powerpc/mm/init_64.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,7 @@ void __ref vmemmap_free(unsigned long start, unsigned long end,
314314
start = ALIGN_DOWN(start, page_size);
315315
if (altmap) {
316316
alt_start = altmap->base_pfn;
317-
alt_end = altmap->base_pfn + altmap->reserve +
318-
altmap->free + altmap->alloc + altmap->align;
317+
alt_end = altmap->base_pfn + altmap->reserve + altmap->free;
319318
}
320319

321320
pr_debug("vmemmap_free %lx...%lx\n", start, end);

0 commit comments

Comments
 (0)