blob: 1707df3e37725971741c44c469f1b25ae206a400 [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From 9045b72bdb703bf58a6586d77461eea8f59f50f7 Mon Sep 17 00:00:00 2001
Brad Bishop6e60e8b2018-02-01 10:27:11 -05002From: Alexandru Moise <alexandru.moise@windriver.com>
3Date: Fri, 29 Apr 2016 07:40:46 +0000
4Subject: [PATCH] mem_section: Support only 46 bit for MAX_PHYSMEM_BITS on
5 PPC64
6
7Related to change:
8http://lists.infradead.org/pipermail/kexec/2013-January/007849.html
9
10Linux on PPC64 has supported only 46 bit MAX_PHYSMEM_BITS since commit:
11048ee0993ec8360abb0b51bdf8f8721e9ed62ec4
12
13Also remove set_ppc64_max_physmem_bits and set info->max_physmem_bits in
14get_machdep_info_ppc64 instead. set_ppc64_max_physmem_bits is broken
15for all kernels compiled with CONFIG_SPARSEMEM=n. makedumpfile is
16unable to get mem_section field from powerpc kernel since commit:
17fd59d231f81cb02870b9cf15f456a897f3669b4e
18
19Upstream-Status: Pending
20
21Signed-off-by: Alexandru Moise <alexandru.moise@windriver.com>
22Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080023
Brad Bishop19323692019-04-05 15:28:33 -040024[hqBai: adjusted patch for context, no logical change]
25Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
Brad Bishop26bdd442019-08-16 17:08:17 -040026Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Brad Bishop6e60e8b2018-02-01 10:27:11 -050027---
Brad Bishop26bdd442019-08-16 17:08:17 -040028 arch/ppc64.c | 38 ++------------------------------------
29 1 file changed, 2 insertions(+), 36 deletions(-)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050030
31diff --git a/arch/ppc64.c b/arch/ppc64.c
Brad Bishop26bdd442019-08-16 17:08:17 -040032index 9d8f252..6f4860f 100644
Brad Bishop6e60e8b2018-02-01 10:27:11 -050033--- a/arch/ppc64.c
34+++ b/arch/ppc64.c
Brad Bishop26bdd442019-08-16 17:08:17 -040035@@ -462,48 +462,14 @@ ppc64_vtop_level4(unsigned long vaddr)
36 return paddr;
Brad Bishop6e60e8b2018-02-01 10:27:11 -050037 }
38
Brad Bishop26bdd442019-08-16 17:08:17 -040039-int
Brad Bishop6e60e8b2018-02-01 10:27:11 -050040-set_ppc64_max_physmem_bits(void)
41-{
42- long array_len = ARRAY_LENGTH(mem_section);
43- /*
44- * The older ppc64 kernels uses _MAX_PHYSMEM_BITS as 42 and the
45- * newer kernels 3.7 onwards uses 46 bits.
46- */
47-
48- info->max_physmem_bits = _MAX_PHYSMEM_BITS_ORIG ;
49- if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
50- || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
51- return TRUE;
52-
53- info->max_physmem_bits = _MAX_PHYSMEM_BITS_3_7;
54- if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
55- || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
56- return TRUE;
57-
Brad Bishop19323692019-04-05 15:28:33 -040058- info->max_physmem_bits = _MAX_PHYSMEM_BITS_4_19;
59- if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
60- || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
61- return TRUE;
62-
Brad Bishop26bdd442019-08-16 17:08:17 -040063- info->max_physmem_bits = _MAX_PHYSMEM_BITS_4_20;
64- if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
65- || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
66- return TRUE;
67-
Brad Bishop6e60e8b2018-02-01 10:27:11 -050068- return FALSE;
69-}
70-
Brad Bishop26bdd442019-08-16 17:08:17 -040071 int
Brad Bishop6e60e8b2018-02-01 10:27:11 -050072 get_machdep_info_ppc64(void)
73 {
74 unsigned long vmlist, vmap_area_list, vmalloc_start;
75
76 info->section_size_bits = _SECTION_SIZE_BITS;
77- if (!set_ppc64_max_physmem_bits()) {
78- ERRMSG("Can't detect max_physmem_bits.\n");
79- return FALSE;
80- }
81+ info->max_physmem_bits = _MAX_PHYSMEM_BITS_3_7;
82+
83 info->page_offset = __PAGE_OFFSET;
84
85 if (SYMBOL(_stext) == NOT_FOUND_SYMBOL) {
Brad Bishop19323692019-04-05 15:28:33 -040086--
Brad Bishop26bdd442019-08-16 17:08:17 -0400872.21.0
Brad Bishop19323692019-04-05 15:28:33 -040088