[OpenPower-Firmware] [PATCH 2/2] kernel: add FADump awareness in petitboot kernel

Mahesh Salgaonkar mahesh at linux.vnet.ibm.com
Thu Oct 3 18:53:53 AEST 2019


From: Hari Bathini <hbathini at linux.ibm.com>

Leveraging MPIPL feature, FADump support is added in upstream kernel
(v5.4) for OPAL based platforms. To fulfill this support, petitboot
kernel needs to be made FADump aware (config PRESERVE_FA_DUMP).

While 'config PRESERVE_FA_DUMP' is enabled, backport relevant patches
here till petitboot kernel is rebased to 5.4 version.

Also, bump up the version to indicate the additional changes included
for FADump awareness.

Signed-off-by: Hari Bathini <hbathini at linux.ibm.com>
---
 .../linux/0002-Release-OpenPower-kernel.patch      |    2 
 .../linux/0003-define-opal-mpipl-interface.patch   |  122 +++++++++
 .../linux/0004-improve-reserve-crash-area.patch    |  101 +++++++
 .../0005-make-petitboot-kernel-fadump-aware.patch  |  286 ++++++++++++++++++++
 4 files changed, 510 insertions(+), 1 deletion(-)
 create mode 100644 openpower/linux/0003-define-opal-mpipl-interface.patch
 create mode 100644 openpower/linux/0004-improve-reserve-crash-area.patch
 create mode 100644 openpower/linux/0005-make-petitboot-kernel-fadump-aware.patch

diff --git a/openpower/linux/0002-Release-OpenPower-kernel.patch b/openpower/linux/0002-Release-OpenPower-kernel.patch
index 01f56f30..d04d5f93 100644
--- a/openpower/linux/0002-Release-OpenPower-kernel.patch
+++ b/openpower/linux/0002-Release-OpenPower-kernel.patch
@@ -17,7 +17,7 @@ index f32e8d2e09c3..8fbcdcb2d96b 100644
  PATCHLEVEL = 3
  SUBLEVEL = 1
 -EXTRAVERSION =
-+EXTRAVERSION = -openpower1
++EXTRAVERSION = -openpower2
  NAME = Bobtail Squid
  
  # *DOCUMENTATION*
diff --git a/openpower/linux/0003-define-opal-mpipl-interface.patch b/openpower/linux/0003-define-opal-mpipl-interface.patch
new file mode 100644
index 00000000..ddd4d9b6
--- /dev/null
+++ b/openpower/linux/0003-define-opal-mpipl-interface.patch
@@ -0,0 +1,122 @@
+powerpc/opal: add MPIPL interface definitions
+
+From: Hari Bathini <hbathini at linux.ibm.com>
+
+MPIPL is Memory Preserving IPL supported from POWER9. This enables the
+kernel to reset the system with memory 'preserved'. Also, it supports
+copying memory from a source address to some destination address during
+MPIPL boot. Add MPIPL interface definitions here to leverage these f/w
+features in adding FADump support for PowerNV platform.
+
+This is the backport of linux commit 6f5f193e84d3.
+
+Signed-off-by: Hari Bathini <hbathini at linux.ibm.com>
+---
+ arch/powerpc/include/asm/opal-api.h        |   44 +++++++++++++++++++++++++++-
+ arch/powerpc/include/asm/opal.h            |    5 +++
+ arch/powerpc/platforms/powernv/opal-call.c |    3 ++
+ 3 files changed, 51 insertions(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h
+index 09a8553..9b02f07 100644
+--- a/arch/powerpc/include/asm/opal-api.h
++++ b/arch/powerpc/include/asm/opal-api.h
+@@ -208,7 +208,10 @@
+ #define OPAL_HANDLE_HMI2			166
+ #define	OPAL_NX_COPROC_INIT			167
+ #define OPAL_XIVE_GET_VP_STATE			170
+-#define OPAL_LAST				170
++#define OPAL_MPIPL_UPDATE			173
++#define OPAL_MPIPL_REGISTER_TAG			174
++#define OPAL_MPIPL_QUERY_TAG			175
++#define OPAL_LAST				175
+ 
+ #define QUIESCE_HOLD			1 /* Spin all calls at entry */
+ #define QUIESCE_REJECT			2 /* Fail all calls with OPAL_BUSY */
+@@ -1058,6 +1061,7 @@ enum {
+ 	OPAL_REBOOT_NORMAL		= 0,
+ 	OPAL_REBOOT_PLATFORM_ERROR	= 1,
+ 	OPAL_REBOOT_FULL_IPL		= 2,
++	OPAL_REBOOT_MPIPL		= 3,
+ };
+ 
+ /* Argument to OPAL_PCI_TCE_KILL */
+@@ -1134,6 +1138,44 @@ enum {
+ #define OPAL_PCI_P2P_LOAD		0x2
+ #define OPAL_PCI_P2P_STORE		0x4
+ 
++/* MPIPL update operations */
++enum opal_mpipl_ops {
++	OPAL_MPIPL_ADD_RANGE			= 0,
++	OPAL_MPIPL_REMOVE_RANGE			= 1,
++	OPAL_MPIPL_REMOVE_ALL			= 2,
++	OPAL_MPIPL_FREE_PRESERVED_MEMORY	= 3,
++};
++
++/* Tag will point to various metadata area. Kernel will
++ * use tag to get metadata value.
++ */
++enum opal_mpipl_tags {
++	OPAL_MPIPL_TAG_CPU	= 0,
++	OPAL_MPIPL_TAG_OPAL	= 1,
++	OPAL_MPIPL_TAG_KERNEL	= 2,
++	OPAL_MPIPL_TAG_BOOT_MEM	= 3,
++};
++
++/* Preserved memory details */
++struct opal_mpipl_region {
++	__be64	src;
++	__be64	dest;
++	__be64	size;
++};
++
++/* Structure version */
++#define OPAL_MPIPL_VERSION		0x01
++
++struct opal_mpipl_fadump {
++	u8	version;
++	u8	reserved[7];
++	__be32	crashing_pir;	/* OPAL crashing CPU PIR */
++	__be32	cpu_data_version;
++	__be32	cpu_data_size;
++	__be32	region_cnt;
++	struct	opal_mpipl_region region[];
++} __packed;
++
+ #endif /* __ASSEMBLY__ */
+ 
+ #endif /* __OPAL_API_H */
+diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
+index 4ed5d57..0c7b99b 100644
+--- a/arch/powerpc/include/asm/opal.h
++++ b/arch/powerpc/include/asm/opal.h
+@@ -39,6 +39,7 @@ int64_t opal_npu_spa_clear_cache(uint64_t phb_id, uint32_t bdfn,
+ 				uint64_t PE_handle);
+ int64_t opal_npu_tl_set(uint64_t phb_id, uint32_t bdfn, long cap,
+ 			uint64_t rate_phys, uint32_t size);
++
+ int64_t opal_console_write(int64_t term_number, __be64 *length,
+ 			   const uint8_t *buffer);
+ int64_t opal_console_read(int64_t term_number, __be64 *length,
+@@ -299,6 +300,10 @@ int opal_sensor_group_clear(u32 group_hndl, int token);
+ int opal_sensor_group_enable(u32 group_hndl, int token, bool enable);
+ int opal_nx_coproc_init(uint32_t chip_id, uint32_t ct);
+ 
++s64 opal_mpipl_update(enum opal_mpipl_ops op, u64 src, u64 dest, u64 size);
++s64 opal_mpipl_register_tag(enum opal_mpipl_tags tag, u64 addr);
++s64 opal_mpipl_query_tag(enum opal_mpipl_tags tag, u64 *addr);
++
+ s64 opal_signal_system_reset(s32 cpu);
+ s64 opal_quiesce(u64 shutdown_type, s32 cpu);
+ 
+diff --git a/arch/powerpc/platforms/powernv/opal-call.c b/arch/powerpc/platforms/powernv/opal-call.c
+index 36c8fa3..a2286a9 100644
+--- a/arch/powerpc/platforms/powernv/opal-call.c
++++ b/arch/powerpc/platforms/powernv/opal-call.c
+@@ -288,3 +288,6 @@ OPAL_CALL(opal_pci_set_pbcq_tunnel_bar,		OPAL_PCI_SET_PBCQ_TUNNEL_BAR);
+ OPAL_CALL(opal_sensor_read_u64,			OPAL_SENSOR_READ_U64);
+ OPAL_CALL(opal_sensor_group_enable,		OPAL_SENSOR_GROUP_ENABLE);
+ OPAL_CALL(opal_nx_coproc_init,			OPAL_NX_COPROC_INIT);
++OPAL_CALL(opal_mpipl_update,			OPAL_MPIPL_UPDATE);
++OPAL_CALL(opal_mpipl_register_tag,		OPAL_MPIPL_REGISTER_TAG);
++OPAL_CALL(opal_mpipl_query_tag,			OPAL_MPIPL_QUERY_TAG);
diff --git a/openpower/linux/0004-improve-reserve-crash-area.patch b/openpower/linux/0004-improve-reserve-crash-area.patch
new file mode 100644
index 00000000..52edd571
--- /dev/null
+++ b/openpower/linux/0004-improve-reserve-crash-area.patch
@@ -0,0 +1,101 @@
+powerpc/fadump: improve how crashed kernel's memory is reserved
+
+From: Hari Bathini <hbathini at linux.ibm.com>
+
+The size parameter to fadump_reserve_crash_area() function is not needed
+as all the memory above boot memory size must be preserved anyway. Update
+the function by dropping this redundant parameter.
+
+This is the backport of linux commit b2a815a554a3.
+
+Signed-off-by: Hari Bathini <hbathini at linux.ibm.com>
+---
+ arch/powerpc/kernel/fadump.c |   53 ++++++++++++++++++++++++------------------
+ 1 file changed, 30 insertions(+), 23 deletions(-)
+
+diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
+index 4eab972..4dacce3 100644
+--- a/arch/powerpc/kernel/fadump.c
++++ b/arch/powerpc/kernel/fadump.c
+@@ -33,6 +33,9 @@
+ #include <asm/setup.h>
+ 
+ static struct fw_dump fw_dump;
++
++static void __init fadump_reserve_crash_area(u64 base);
++
+ static struct fadump_mem_struct fdm;
+ static const struct fadump_mem_struct *fdm_active;
+ #ifdef CONFIG_CMA
+@@ -426,26 +429,6 @@ static unsigned long get_fadump_area_size(void)
+ 	return size;
+ }
+ 
+-static void __init fadump_reserve_crash_area(unsigned long base,
+-					     unsigned long size)
+-{
+-	struct memblock_region *reg;
+-	unsigned long mstart, mend, msize;
+-
+-	for_each_memblock(memory, reg) {
+-		mstart = max_t(unsigned long, base, reg->base);
+-		mend = reg->base + reg->size;
+-		mend = min(base + size, mend);
+-
+-		if (mstart < mend) {
+-			msize = mend - mstart;
+-			memblock_reserve(mstart, msize);
+-			pr_info("Reserved %ldMB of memory at %#016lx for saving crash dump\n",
+-				(msize >> 20), mstart);
+-		}
+-	}
+-}
+-
+ int __init fadump_reserve_mem(void)
+ {
+ 	unsigned long base, size, memory_boundary;
+@@ -510,13 +493,13 @@ int __init fadump_reserve_mem(void)
+ #endif
+ 		/*
+ 		 * If last boot has crashed then reserve all the memory
+-		 * above boot_memory_size so that we don't touch it until
++		 * above boot memory size so that we don't touch it until
+ 		 * dump is written to disk by userspace tool. This memory
+-		 * will be released for general use once the dump is saved.
++		 * can be released for general use by invalidating fadump.
+ 		 */
+ 		base = fw_dump.boot_memory_size;
+ 		size = memory_boundary - base;
+-		fadump_reserve_crash_area(base, size);
++		fadump_reserve_crash_area(base);
+ 
+ 		fw_dump.fadumphdr_addr =
+ 				be64_to_cpu(fdm_active->rmr_region.destination_address) +
+@@ -1701,3 +1684,27 @@ int __init setup_fadump(void)
+ 	return 1;
+ }
+ subsys_initcall(setup_fadump);
++
++/* Preserve everything above the base address */
++static void __init fadump_reserve_crash_area(u64 base)
++{
++	struct memblock_region *reg;
++	u64 mstart, msize;
++
++	for_each_memblock(memory, reg) {
++		mstart = reg->base;
++		msize  = reg->size;
++
++		if ((mstart + msize) < base)
++			continue;
++
++		if (mstart < base) {
++			msize -= (base - mstart);
++			mstart = base;
++		}
++
++		pr_info("Reserving %lluMB of memory at %#016llx for preserving crash data",
++			(msize >> 20), mstart);
++		memblock_reserve(mstart, msize);
++	}
++}
diff --git a/openpower/linux/0005-make-petitboot-kernel-fadump-aware.patch b/openpower/linux/0005-make-petitboot-kernel-fadump-aware.patch
new file mode 100644
index 00000000..a7a34fa8
--- /dev/null
+++ b/openpower/linux/0005-make-petitboot-kernel-fadump-aware.patch
@@ -0,0 +1,286 @@
+powerpc/fadump: add support to preserve crash data on FADUMP disabled kernel
+
+From: Hari Bathini <hbathini at linux.ibm.com>
+
+Add a new kernel config option, CONFIG_PRESERVE_FA_DUMP that ensures
+that crash data, from previously crash'ed kernel, is preserved. This
+helps in cases where FADump is not enabled but the subsequent memory
+preserving kernel boot is likely to process this crash data. One
+typical usecase for this config option is petitboot kernel.
+
+As OPAL allows registering address with it in the first kernel and
+retrieving it after MPIPL, use it to store the top of boot memory.
+A kernel that intends to preserve crash data retrieves it and avoids
+using memory beyond this address.
+
+Move arch_reserved_kernel_pages() function as it is needed for both
+FA_DUMP and PRESERVE_FA_DUMP configurations.
+
+This is the backport of linux commit bec53196adf4. Also, OPAL FADump
+kernel metadata definition from linux commit 742a265accd3 ("powerpc/
+fadump: register kernel metadata address with opal") is backported
+here for completeness.
+
+Signed-off-by: Hari Bathini <hbathini at linux.ibm.com>
+---
+ arch/powerpc/Kconfig              |    9 +++
+ arch/powerpc/include/asm/fadump.h |   17 ++++-
+ arch/powerpc/kernel/Makefile      |    4 +
+ arch/powerpc/kernel/fadump.c      |  123 +++++++++++++++++++++++++++++++++++--
+ arch/powerpc/kernel/prom.c        |    4 +
+ 5 files changed, 146 insertions(+), 11 deletions(-)
+
+diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
+index f7a363c..65fe740 100644
+--- a/arch/powerpc/Kconfig
++++ b/arch/powerpc/Kconfig
+@@ -571,6 +571,15 @@ config FA_DUMP
+ 
+ 	  If unsure, say "N"
+ 
++config PRESERVE_FA_DUMP
++	bool "Preserve Firmware-assisted dump"
++	depends on PPC64 && PPC_POWERNV && !FA_DUMP
++	help
++	  On a kernel with FA_DUMP disabled, this option helps to preserve
++	  crash data from a previously crash'ed kernel. Useful when the next
++	  memory preserving kernel boot would process this crash data.
++	  Petitboot kernel is the typical usecase for this option.
++
+ config IRQ_ALL_CPUS
+ 	bool "Distribute interrupts on all CPUs by default"
+ 	depends on SMP
+diff --git a/arch/powerpc/include/asm/fadump.h b/arch/powerpc/include/asm/fadump.h
+index 17d9b6a..0401a6f 100644
+--- a/arch/powerpc/include/asm/fadump.h
++++ b/arch/powerpc/include/asm/fadump.h
+@@ -193,9 +193,6 @@ struct fad_crash_memory_ranges {
+ };
+ 
+ extern int is_fadump_memory_area(u64 addr, ulong size);
+-extern int early_init_dt_scan_fw_dump(unsigned long node,
+-		const char *uname, int depth, void *data);
+-extern int fadump_reserve_mem(void);
+ extern int setup_fadump(void);
+ extern int is_fadump_active(void);
+ extern int should_fadump_crash(void);
+@@ -208,4 +205,18 @@ static inline int should_fadump_crash(void) { return 0; }
+ static inline void crash_fadump(struct pt_regs *regs, const char *str) { }
+ static inline void fadump_cleanup(void) { }
+ #endif
++
++#ifdef CONFIG_PRESERVE_FA_DUMP
++/* Firmware-assisted dump configuration details. */
++struct fw_dump {
++	u64	boot_mem_top;
++	u64	dump_active;
++};
++#endif
++
++#if defined(CONFIG_FA_DUMP) || defined(CONFIG_PRESERVE_FA_DUMP)
++extern int early_init_dt_scan_fw_dump(unsigned long node, const char *uname,
++				      int depth, void *data);
++extern int fadump_reserve_mem(void);
++#endif
+ #endif
+diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
+index 21dfff2..f5c41e8 100644
+--- a/arch/powerpc/kernel/Makefile
++++ b/arch/powerpc/kernel/Makefile
+@@ -78,7 +78,9 @@ obj-$(CONFIG_EEH)              += eeh.o eeh_pe.o eeh_dev.o eeh_cache.o \
+ 				  eeh_driver.o eeh_event.o eeh_sysfs.o
+ obj-$(CONFIG_GENERIC_TBSYNC)	+= smp-tbsync.o
+ obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
+-obj-$(CONFIG_FA_DUMP)		+= fadump.o
++ifneq ($(CONFIG_FA_DUMP)$(CONFIG_PRESERVE_FA_DUMP),)
++obj-y				+= fadump.o
++endif
+ ifdef CONFIG_PPC32
+ obj-$(CONFIG_E500)		+= idle_e500.o
+ endif
+diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
+index 4dacce3..1202dad 100644
+--- a/arch/powerpc/kernel/fadump.c
++++ b/arch/powerpc/kernel/fadump.c
+@@ -24,11 +24,13 @@
+ #include <linux/slab.h>
+ #include <linux/cma.h>
+ #include <linux/hugetlb.h>
++#include <linux/libfdt.h>
+ 
+ #include <asm/debugfs.h>
+ #include <asm/page.h>
+ #include <asm/prom.h>
+ #include <asm/rtas.h>
++#include <asm/opal.h>
+ #include <asm/fadump.h>
+ #include <asm/setup.h>
+ 
+@@ -36,6 +38,7 @@ static struct fw_dump fw_dump;
+ 
+ static void __init fadump_reserve_crash_area(u64 base);
+ 
++#ifndef CONFIG_PRESERVE_FA_DUMP
+ static struct fadump_mem_struct fdm;
+ static const struct fadump_mem_struct *fdm_active;
+ #ifdef CONFIG_CMA
+@@ -542,11 +545,6 @@ int __init fadump_reserve_mem(void)
+ 	return 1;
+ }
+ 
+-unsigned long __init arch_reserved_kernel_pages(void)
+-{
+-	return memblock_reserved_size() / PAGE_SIZE;
+-}
+-
+ /* Look for fadump= cmdline option. */
+ static int __init early_fadump_param(char *p)
+ {
+@@ -1684,6 +1682,116 @@ int __init setup_fadump(void)
+ 	return 1;
+ }
+ subsys_initcall(setup_fadump);
++#else /* !CONFIG_PRESERVE_FA_DUMP */
++
++/* Maximum number of memory regions kernel supports */
++#define OPAL_FADUMP_MAX_MEM_REGS		128
++
++/*
++ * OPAL FADump kernel metadata
++ *
++ * The address of this structure will be registered with f/w for retrieving
++ * and processing during crash dump.
++ */
++struct opal_fadump_mem_struct {
++	u8	version;
++	u8	reserved[3];
++	u16	region_cnt;             /* number of regions */
++	u16	registered_regions;     /* Regions registered for MPIPL */
++	u64	fadumphdr_addr;
++	struct opal_mpipl_region	rgn[OPAL_FADUMP_MAX_MEM_REGS];
++} __packed;
++
++
++/*
++ * When dump is active but PRESERVE_FA_DUMP is enabled on the kernel,
++ * ensure crash data is preserved in hope that the subsequent memory
++ * preserving kernel boot is going to process this crash data.
++ */
++void __init opal_fadump_dt_scan(struct fw_dump *fadump_conf, u64 node)
++{
++	const struct opal_fadump_mem_struct *opal_fdm_active;
++	const __be32 *prop;
++	unsigned long dn;
++	u64 addr = 0;
++	s64 ret;
++
++	dn = of_get_flat_dt_subnode_by_name(node, "dump");
++	if (dn == -FDT_ERR_NOTFOUND)
++		return;
++
++	/*
++	 * Check if dump has been initiated on last reboot.
++	 */
++	prop = of_get_flat_dt_prop(dn, "mpipl-boot", NULL);
++	if (!prop)
++		return;
++
++	ret = opal_mpipl_query_tag(OPAL_MPIPL_TAG_KERNEL, &addr);
++	if ((ret != OPAL_SUCCESS) || !addr) {
++		pr_debug("Could not get Kernel metadata (%lld)\n", ret);
++		return;
++	}
++
++	/*
++	 * Preserve memory only if kernel memory regions are registered
++	 * with f/w for MPIPL.
++	 */
++	addr = be64_to_cpu(addr);
++	pr_debug("Kernel metadata addr: %llx\n", addr);
++	opal_fdm_active = (void *)addr;
++	if (opal_fdm_active->registered_regions == 0)
++		return;
++
++	ret = opal_mpipl_query_tag(OPAL_MPIPL_TAG_BOOT_MEM, &addr);
++	if ((ret != OPAL_SUCCESS) || !addr) {
++		pr_err("Failed to get boot memory tag (%lld)\n", ret);
++		return;
++	}
++
++	/*
++	 * Memory below this address can be used for booting a
++	 * capture kernel or petitboot kernel. Preserve everything
++	 * above this address for processing crashdump.
++	 */
++	fadump_conf->boot_mem_top = be64_to_cpu(addr);
++	pr_debug("Preserve everything above %llx\n", fadump_conf->boot_mem_top);
++
++	pr_info("Firmware-assisted dump is active.\n");
++	fadump_conf->dump_active = 1;
++}
++
++/* Scan the Firmware Assisted dump configuration details. */
++int __init early_init_dt_scan_fw_dump(unsigned long node, const char *uname,
++				      int depth, void *data)
++{
++	if ((depth != 1) || (strcmp(uname, "ibm,opal") != 0))
++		return 0;
++
++	opal_fadump_dt_scan(&fw_dump, node);
++	return 1;
++}
++
++/*
++ * When dump is active but PRESERVE_FA_DUMP is enabled on the kernel,
++ * preserve crash data. The subsequent memory preserving kernel boot
++ * is likely to process this crash data.
++ */
++int __init fadump_reserve_mem(void)
++{
++	if (fw_dump.dump_active) {
++		/*
++		 * If last boot has crashed then reserve all the memory
++		 * above boot memory to preserve crash data.
++		 */
++		pr_info("Preserving crash data for processing in next boot.\n");
++		fadump_reserve_crash_area(fw_dump.boot_mem_top);
++	} else
++		pr_debug("FADump-aware kernel..\n");
++
++	return 1;
++}
++#endif /* CONFIG_PRESERVE_FA_DUMP */
+ 
+ /* Preserve everything above the base address */
+ static void __init fadump_reserve_crash_area(u64 base)
+@@ -1708,3 +1816,8 @@ static void __init fadump_reserve_crash_area(u64 base)
+ 		memblock_reserve(mstart, msize);
+ 	}
+ }
++
++unsigned long __init arch_reserved_kernel_pages(void)
++{
++	return memblock_reserved_size() / PAGE_SIZE;
++}
+diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
+index 7159e79..9c3861b 100644
+--- a/arch/powerpc/kernel/prom.c
++++ b/arch/powerpc/kernel/prom.c
+@@ -704,7 +704,7 @@ void __init early_init_devtree(void *params)
+ 	of_scan_flat_dt(early_init_dt_scan_opal, NULL);
+ #endif
+ 
+-#ifdef CONFIG_FA_DUMP
++#if defined(CONFIG_FA_DUMP) || defined(CONFIG_PRESERVE_FA_DUMP)
+ 	/* scan tree to see if dump is active during last boot */
+ 	of_scan_flat_dt(early_init_dt_scan_fw_dump, NULL);
+ #endif
+@@ -731,7 +731,7 @@ void __init early_init_devtree(void *params)
+ 	if (PHYSICAL_START > MEMORY_START)
+ 		memblock_reserve(MEMORY_START, 0x8000);
+ 	reserve_kdump_trampoline();
+-#ifdef CONFIG_FA_DUMP
++#if defined(CONFIG_FA_DUMP) || defined(CONFIG_PRESERVE_FA_DUMP)
+ 	/*
+ 	 * If we fail to reserve memory for firmware-assisted dump then
+ 	 * fallback to kexec based kdump.



More information about the OpenPower-Firmware mailing list