Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f0b6f9c authored by Deepak Dimri's avatar Deepak Dimri Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarDeepak Dimri <ddimri@codeaurora.org>
parent 905e945f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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(