From 905e945fabfd97f9ed667c4500cb7f4b7396a5ef Mon Sep 17 00:00:00 2001 From: Tengfei Fan Date: Fri, 13 Dec 2019 15:57:49 +0800 Subject: [PATCH 1/3] soc: qcom: use MODULES_END instead of KIMAGE_VADDR Because of KIMAGE_VADDR is not defined by ARM32, so in order to support minidump function on ARM32, so use MODULES_END instead of KIMAGE_VADDR, because MODULES_END are defined by ARM64 and ARM32. Change-Id: Ie0d990baa17a207ceb7ed56faa9b5256f31a3e17 Signed-off-by: Tengfei Fan --- drivers/soc/qcom/minidump_log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/minidump_log.c b/drivers/soc/qcom/minidump_log.c index 1313f7e5e135..9c18be966ebe 100644 --- a/drivers/soc/qcom/minidump_log.c +++ b/drivers/soc/qcom/minidump_log.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. */ #include @@ -264,7 +264,7 @@ void dump_stack_minidump(u64 sp) is_vmap_stack = IS_ENABLED(CONFIG_VMAP_STACK); - if (sp < KIMAGE_VADDR || sp > -256UL) + if (sp < MODULES_END || sp > -256UL) sp = current_stack_pointer; /* From 9f0b6f9c8f9e6c96adc7ceb443e982b18f63f180 Mon Sep 17 00:00:00 2001 From: Deepak Dimri Date: Thu, 5 Nov 2020 14:03:37 +0530 Subject: [PATCH 2/3] minidump: Add support for !CONFIG_SMP kernel __per_cpu variables are only applicable for the systems with multiple cpu Minidump code without any check for same was causing the kernel compilation to fail for the single core cpu where __per_cpu symbols are not applicable so added conditional compilation to the __per_cpu code based on CONFIG_SMP. Change-Id: I626fc3c47fd9600608ea721ef6f8811110e1ee1d Signed-off-by: Deepak Dimri --- drivers/soc/qcom/minidump_log.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/soc/qcom/minidump_log.c b/drivers/soc/qcom/minidump_log.c index 9c18be966ebe..921e2a6ea63b 100644 --- a/drivers/soc/qcom/minidump_log.c +++ b/drivers/soc/qcom/minidump_log.c @@ -191,9 +191,11 @@ static void __init register_kernel_sections(void) struct md_region ksec_entry; char *data_name = "KDATABSS"; char *rodata_name = "KROAIDATA"; +#ifdef CONFIG_SMP const size_t static_size = __per_cpu_end - __per_cpu_start; void __percpu *base = (void __percpu *)__per_cpu_start; unsigned int cpu; +#endif strlcpy(ksec_entry.name, data_name, sizeof(ksec_entry.name)); ksec_entry.virt_addr = (uintptr_t)_sdata; @@ -209,6 +211,7 @@ static void __init register_kernel_sections(void) if (msm_minidump_add_region(&ksec_entry) < 0) pr_err("Failed to add rodata section in Minidump\n"); +#ifdef CONFIG_SMP /* Add percpu static sections */ for_each_possible_cpu(cpu) { void *start = per_cpu_ptr(base, cpu); @@ -222,6 +225,7 @@ static void __init register_kernel_sections(void) if (msm_minidump_add_region(&ksec_entry) < 0) pr_err("Failed to add percpu sections in Minidump\n"); } +#endif } static inline bool in_stack_range( From 9e798cb682559c8d9a2f00b38698c9911398728c Mon Sep 17 00:00:00 2001 From: Melody Olvera Date: Wed, 19 May 2021 14:20:32 -0700 Subject: [PATCH 3/3] defconfig: sdxlemur: Enable configs for minidump Enable defconfigs needed for minidump. Change-Id: I9c2ea879cc6e36915db72b26e1e3da5f9fd3859e Signed-off-by: Melody Olvera --- arch/arm/configs/vendor/sdxlemur.config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/configs/vendor/sdxlemur.config b/arch/arm/configs/vendor/sdxlemur.config index 5974ea0c7c99..30171ec7eb2b 100644 --- a/arch/arm/configs/vendor/sdxlemur.config +++ b/arch/arm/configs/vendor/sdxlemur.config @@ -342,6 +342,8 @@ CONFIG_QCOM_EUD=y CONFIG_POWER_RESET_QCOM_DOWNLOAD_MODE=y CONFIG_POWER_RESET_QCOM_DOWNLOAD_MODE_DEFAULT=y CONFIG_POWER_RESET_QCOM_REBOOT_REASON=y +CONFIG_POWER_RESET_MSM=y +CONFIG_QCOM_MINIDUMP=y CONFIG_ENABLE_SFE=y # CONFIG_ENABLE_VMALLOC_SAVING is not set # CONFIG_SLUB_DEBUG is not set