Blame SOURCES/kexec-tools-2.0.14-makedumpfile-book3s-ppc64-Lower-the-max-real-address-to-53-bits.patch

23ef29
From cbfef9297e3082c296f8d43ca41b1f7f608dbb92 Mon Sep 17 00:00:00 2001
23ef29
From: Bhupesh Sharma <bhsharma@redhat.com>
23ef29
Date: Wed, 6 Sep 2017 17:29:58 +0530
23ef29
Subject: [Makedumpfile PATCH v2] book3s/ppc64: Lower the max real address to
23ef29
 53 bits for kernels >= v4.11
23ef29
23ef29
Kernel commit 2f18d533757da3899f4bedab0b2c051b080079dc lowered the
23ef29
max real address on ppc64 to 53 bits.
23ef29
23ef29
Make similar changes in makedumpfile (on basis of the underlying kernel
23ef29
version), without which the makedumpfile will fail to create a dumpfile
23ef29
and instead throw a SEGV fault as shown below on kernels >= v4.11:
23ef29
23ef29
 # makedumpfile --split -d 31 -x vmlinux vmcore dumpfile_{1,2,3} 2>&1
23ef29
23ef29
 The kernel version is not supported.
23ef29
 The makedumpfile operation may be incomplete.
23ef29
 [ 1196.252094] makedumpfile[2367]: unhandled signal 11 at
23ef29
 00000100f7011ca8 nip 000000001001eecc lr 000000001001f3c0 code 30001
23ef29
 Segmentation fault
23ef29
23ef29
Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
23ef29
---
23ef29
Changes since v1:
23ef29
- As per Atsushi's comments introduced macros for 4_11 directly
23ef29
  in v2 and use them in arch/ppc64.c
23ef29
23ef29
 arch/ppc64.c   | 8 +++++++-
23ef29
 makedumpfile.h | 5 +++++
23ef29
 2 files changed, 12 insertions(+), 1 deletion(-)
23ef29
23ef29
diff --git a/makedumpfile-1.6.1/arch/ppc64.c b/makedumpfile-1.6.1/arch/ppc64.c
23ef29
index bacac778f73c..2f5a0daa16b2 100644
23ef29
--- a/makedumpfile-1.6.1/arch/ppc64.c
23ef29
+++ b/makedumpfile-1.6.1/arch/ppc64.c
23ef29
@@ -307,11 +307,17 @@ ppc64_vmalloc_init(void)
23ef29
 	}
23ef29
 
23ef29
 	info->pte_rpn_mask = PTE_RPN_MASK_DEFAULT;
23ef29
-	if (info->kernel_version >= KERNEL_VERSION(4, 6, 0)) {
23ef29
+	if ((info->kernel_version >= KERNEL_VERSION(4, 6, 0)) &&
23ef29
+	    (info->kernel_version < KERNEL_VERSION(4, 11, 0))) {
23ef29
 		info->pte_rpn_mask = PTE_RPN_MASK_L4_4_6;
23ef29
 		info->pte_rpn_shift = PTE_RPN_SHIFT_L4_4_6;
23ef29
 	}
23ef29
 
23ef29
+	if (info->kernel_version >= KERNEL_VERSION(4, 11, 0)) {
23ef29
+		info->pte_rpn_mask = PTE_RPN_MASK_L4_4_11;
23ef29
+		info->pte_rpn_shift = PTE_RPN_SHIFT_L4_4_11;
23ef29
+	}
23ef29
+
23ef29
 	/*
23ef29
 	 * Compute ptrs per each level
23ef29
 	 */
23ef29
diff --git a/makedumpfile-1.6.1/makedumpfile.h b/makedumpfile-1.6.1/makedumpfile.h
23ef29
index 7d81bbcf2234..f4ba02d11f09 100644
23ef29
--- a/makedumpfile-1.6.1/makedumpfile.h
23ef29
+++ b/makedumpfile-1.6.1/makedumpfile.h
23ef29
@@ -692,6 +692,11 @@ unsigned long get_kvbase_arm64(void);
23ef29
 #define PUD_MASKED_BITS_4_7  0xc0000000000000ffUL
23ef29
 #define PMD_MASKED_BITS_4_7  0xc0000000000000ffUL
23ef29
 
23ef29
+#define PTE_RPN_SIZE_L4_4_11  53
23ef29
+#define PTE_RPN_MASK_L4_4_11   \
23ef29
+	(((1UL << PTE_RPN_SIZE_L4_4_11) - 1) & ~((1UL << info->page_shift) - 1))
23ef29
+#define PTE_RPN_SHIFT_L4_4_11  info->page_shift
23ef29
+
23ef29
 /*
23ef29
  * Supported MMU types
23ef29
  */
23ef29
-- 
23ef29
2.7.4
23ef29