blob: 766f4fc76e9ede52366d5ca7936dd32097eb7a75 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From ba123fa6b2aa0ac62d1b78f327339635ae87201a 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 Bishop6e60e8b2018-02-01 10:27:11 -050024---
25 arch/ppc64.c | 28 ++--------------------------
26 1 file changed, 2 insertions(+), 26 deletions(-)
27
28diff --git a/arch/ppc64.c b/arch/ppc64.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080029index 8b6f7d5..458f06b 100644
Brad Bishop6e60e8b2018-02-01 10:27:11 -050030--- a/arch/ppc64.c
31+++ b/arch/ppc64.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080032@@ -462,38 +462,14 @@ ppc64_vtop_level4(unsigned long vaddr)
33 return paddr;
Brad Bishop6e60e8b2018-02-01 10:27:11 -050034 }
35
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080036-int
Brad Bishop6e60e8b2018-02-01 10:27:11 -050037-set_ppc64_max_physmem_bits(void)
38-{
39- long array_len = ARRAY_LENGTH(mem_section);
40- /*
41- * The older ppc64 kernels uses _MAX_PHYSMEM_BITS as 42 and the
42- * newer kernels 3.7 onwards uses 46 bits.
43- */
44-
45- info->max_physmem_bits = _MAX_PHYSMEM_BITS_ORIG ;
46- if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
47- || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
48- return TRUE;
49-
50- info->max_physmem_bits = _MAX_PHYSMEM_BITS_3_7;
51- if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
52- || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
53- return TRUE;
54-
55- return FALSE;
56-}
57-
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080058 int
Brad Bishop6e60e8b2018-02-01 10:27:11 -050059 get_machdep_info_ppc64(void)
60 {
61 unsigned long vmlist, vmap_area_list, vmalloc_start;
62
63 info->section_size_bits = _SECTION_SIZE_BITS;
64- if (!set_ppc64_max_physmem_bits()) {
65- ERRMSG("Can't detect max_physmem_bits.\n");
66- return FALSE;
67- }
68+ info->max_physmem_bits = _MAX_PHYSMEM_BITS_3_7;
69+
70 info->page_offset = __PAGE_OFFSET;
71
72 if (SYMBOL(_stext) == NOT_FOUND_SYMBOL) {