diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> | 2023-07-24 23:43:20 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-07-28 16:47:19 +1000 |
commit | 6722b25712054c0f903b839b8f5088438dd04df3 (patch) | |
tree | 4573d65e6c31fdf5903bdaa2640cc79bb54a49ed /arch | |
parent | 106ea7ffd56b0f9454cd4f625474967f12ac4dbd (diff) | |
download | linux-stable-6722b25712054c0f903b839b8f5088438dd04df3.tar.gz linux-stable-6722b25712054c0f903b839b8f5088438dd04df3.tar.bz2 linux-stable-6722b25712054c0f903b839b8f5088438dd04df3.zip |
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: 9ef34630a461 ("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
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/mm/init_64.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index fe1b83020e0d..0ec5b45b1e86 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c @@ -314,8 +314,7 @@ void __ref vmemmap_free(unsigned long start, unsigned long end, start = ALIGN_DOWN(start, page_size); if (altmap) { alt_start = altmap->base_pfn; - alt_end = altmap->base_pfn + altmap->reserve + - altmap->free + altmap->alloc + altmap->align; + alt_end = altmap->base_pfn + altmap->reserve + altmap->free; } pr_debug("vmemmap_free %lx...%lx\n", start, end); |