summaryrefslogtreecommitdiff
path: root/arch/powerpc/kexec/file_load_64.c
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2023-02-12 22:11:56 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2023-02-12 22:11:56 +1100
commitfc8a898cfdbb0e63cfde547715c2031de22e7893 (patch)
treee1eaae008d673bb68cdc003d72eadc4ba5535a18 /arch/powerpc/kexec/file_load_64.c
parent544f823ec7a34332550f22735959d3e1ffcf4684 (diff)
parent2ea31e2e62bbc4d11c411eeb36f1b02841dbcab1 (diff)
Merge branch 'fixes' into next
Merge our fixes branch to bring in some changes that conflict with upcoming next content.
Diffstat (limited to 'arch/powerpc/kexec/file_load_64.c')
-rw-r--r--arch/powerpc/kexec/file_load_64.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c
index af8854f9eae3..9be3e818a240 100644
--- a/arch/powerpc/kexec/file_load_64.c
+++ b/arch/powerpc/kexec/file_load_64.c
@@ -26,6 +26,7 @@
#include <asm/firmware.h>
#include <asm/kexec_ranges.h>
#include <asm/crashdump-ppc64.h>
+#include <asm/mmzone.h>
#include <asm/prom.h>
struct umem_info {
@@ -989,10 +990,13 @@ unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image)
* linux,drconf-usable-memory properties. Get an approximate on the
* number of usable memory entries and use for FDT size estimation.
*/
- usm_entries = ((memblock_end_of_DRAM() / drmem_lmb_size()) +
- (2 * (resource_size(&crashk_res) / drmem_lmb_size())));
-
- extra_size = (unsigned int)(usm_entries * sizeof(u64));
+ if (drmem_lmb_size()) {
+ usm_entries = ((memory_hotplug_max() / drmem_lmb_size()) +
+ (2 * (resource_size(&crashk_res) / drmem_lmb_size())));
+ extra_size = (unsigned int)(usm_entries * sizeof(u64));
+ } else {
+ extra_size = 0;
+ }
/*
* Get the number of CPU nodes in the current DT. This allows to