Blame SOURCES/kexec-tools-2.0.15-makedumpfile-Support-symbol-__cpu_online_mask.patch

06c2a2
From d6d5b443c82471818d43cb87c9280a0252e763e7 Mon Sep 17 00:00:00 2001
06c2a2
From: Takao Indoh <indou.takao@jp.fujitsu.com>
06c2a2
Date: Thu, 26 Oct 2017 20:32:48 +0900
06c2a2
Subject: [PATCH 1/4] [PATCH v3 1/4] Support symbol __cpu_online_mask
06c2a2
06c2a2
In the upstream kernel, by commit 5aec01b83 cpu_online_mask was replaced
06c2a2
with macros and new variables __cpu_online_mask was added instead of it.
06c2a2
Sadump uses cpu_online_mask to check the cpu was online or not,
06c2a2
therefore it also need __cpu_online_mask symbol for this in the latest
06c2a2
kernel.
06c2a2
06c2a2
Signed-off-by: Takao Indoh <indou.takao@jp.fujitsu.com>
06c2a2
Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
06c2a2
---
06c2a2
 makedumpfile.c | 9 +++++++--
06c2a2
 makedumpfile.h | 1 +
06c2a2
 sadump_info.c  | 3 ++-
06c2a2
 3 files changed, 10 insertions(+), 3 deletions(-)
06c2a2
06c2a2
diff --git a/makedumpfile.c b/makedumpfile.c
06c2a2
index 567ac5dc1f9e..5f2ca7d0fbc8 100644
06c2a2
--- a/makedumpfile-1.6.2/makedumpfile.c
06c2a2
+++ b/makedumpfile-1.6.2/makedumpfile.c
06c2a2
@@ -1519,8 +1519,13 @@ get_symbol_info(void)
06c2a2
 	SYMBOL_INIT(__per_cpu_load, "__per_cpu_load");
06c2a2
 	SYMBOL_INIT(__per_cpu_offset, "__per_cpu_offset");
06c2a2
 	SYMBOL_INIT(cpu_online_mask, "cpu_online_mask");
06c2a2
-	if (SYMBOL(cpu_online_mask) == NOT_FOUND_SYMBOL)
06c2a2
-		SYMBOL_INIT(cpu_online_mask, "cpu_online_map");
06c2a2
+	SYMBOL_INIT(__cpu_online_mask, "__cpu_online_mask");
06c2a2
+	if (SYMBOL(cpu_online_mask) == NOT_FOUND_SYMBOL) {
06c2a2
+		if (SYMBOL(__cpu_online_mask) == NOT_FOUND_SYMBOL)
06c2a2
+			SYMBOL_INIT(cpu_online_mask, "cpu_online_map");
06c2a2
+		else
06c2a2
+			SYMBOL_INIT(cpu_online_mask, "__cpu_online_mask");
06c2a2
+	}
06c2a2
 	SYMBOL_INIT(kexec_crash_image, "kexec_crash_image");
06c2a2
 	SYMBOL_INIT(node_remap_start_vaddr, "node_remap_start_vaddr");
06c2a2
 	SYMBOL_INIT(node_remap_end_vaddr, "node_remap_end_vaddr");
06c2a2
diff --git a/makedumpfile.h b/makedumpfile.h
06c2a2
index f4ba02d11f09..704a6bc2f8f4 100644
06c2a2
--- a/makedumpfile-1.6.2/makedumpfile.h
06c2a2
+++ b/makedumpfile-1.6.2/makedumpfile.h
06c2a2
@@ -1596,6 +1596,7 @@ struct symbol_table {
06c2a2
 	unsigned long long	__per_cpu_offset;
06c2a2
 	unsigned long long	__per_cpu_load;
06c2a2
 	unsigned long long	cpu_online_mask;
06c2a2
+	unsigned long long	__cpu_online_mask;
06c2a2
 	unsigned long long	kexec_crash_image;
06c2a2
 
06c2a2
 	/*
06c2a2
diff --git a/sadump_info.c b/sadump_info.c
06c2a2
index 257f1be5e686..7dd22e704234 100644
06c2a2
--- a/makedumpfile-1.6.2/sadump_info.c
06c2a2
+++ b/makedumpfile-1.6.2/sadump_info.c
06c2a2
@@ -953,7 +953,8 @@ cpu_online_mask_init(void)
06c2a2
 		return FALSE;
06c2a2
 	}
06c2a2
 
06c2a2
-	if (SIZE(cpumask) == NOT_FOUND_STRUCTURE)
06c2a2
+	if ((SIZE(cpumask) == NOT_FOUND_STRUCTURE) ||
06c2a2
+	    (SYMBOL(__cpu_online_mask) != NOT_FOUND_SYMBOL))
06c2a2
 		cpu_online_mask_addr = SYMBOL(cpu_online_mask);
06c2a2
 
06c2a2
 	else {
06c2a2
-- 
06c2a2
2.5.5
06c2a2