Return-path: Received: from tyo201.gate.nec.co.jp ([202.32.8.193]) by casper.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RdFQq-0001bs-Lo for kexec@lists.infradead.org; Wed, 21 Dec 2011 06:13:44 +0000 Subject: Re: [PATCH] makedumpfile: s390x: Auto-detect the correct MAX_PHYSMEM_BITSused in vmcore being analyzed. In-reply-to: <20111220101459.26622.49407.stgit@mars.in.ibm.com> Message-Id: <20111221151141tachibana@mail.jp.nec.com> References: <20111220101459.26622.49407.stgit@mars.in.ibm.com> Mime-Version: 1.0 From: tachibana@mxm.nes.nec.co.jp Date: Wed, 21 Dec 2011 15:11:41 +0900 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: kexec-bounces@lists.infradead.org Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Mahesh J Salgaonkar Cc: Tachibana-san , Michael Holzheu , Kexec-ml , Ananth Narayan , Reinhard Hi Mahesh, Thank you for the patch. I will review it. However I have never dumped 1 terabyte or more data using makedumpfile. Has anyone ever dumped it successfully? Thanks. tachibana On 2011/12/20 16:06:01 +0530, Mahesh J Salgaonkar wrote: > Hi Tachibana, > > As part of the s390 patch to add support for > 4TB system memory (present in > linux-next tree), the newer s390 kernel will bump the MAX_PHYSMEM_BITS from > 42 to 46. Once that patch makes into umpstream kernel, this change will need > to go into makedumpfile. For now, I am posting this patch for a review. > > Reference: http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commit;h=8980036860565a6d2a4f95bb097927e832 fa3d1a > > Thanks, > -Mahesh. > > > From: Mahesh Salgaonkar > > So far s390x kernel was using 42 bits for MAX_PHYSMEM_BITS that use to > support maximum of 4TB of memory. In order to support bigger systems, > the newer s390x kernel will now use 46 bits for MAX_PHYSMEM_BITS to support > maximum of 64TB of memory. > > This patch auto-detects the correct value to use for MAX_PHYSMEM_BITS by > examining the mem_section array size from the vmcore being analyzed. > > Signed-off-by: Mahesh Salgaonkar > --- > arch/s390x.c | 27 ++++++++++++++++++++++++++- > makedumpfile.h | 3 ++- > 2 files changed, 28 insertions(+), 2 deletions(-) > > diff --git a/arch/s390x.c b/arch/s390x.c > index 9237eaa..c73220a 100644 > --- a/arch/s390x.c > +++ b/arch/s390x.c > @@ -60,6 +60,28 @@ > #define pte_offset(x) (pte_index(x) * sizeof(unsigned long)) > > int > +set_s390x_max_physmem_bits(void) > +{ > + long array_len = ARRAY_LENGTH(mem_section); > + /* > + * The older s390x kernels uses _MAX_PHYSMEM_BITS as 42 and the > + * newer kernels uses 46 bits. > + */ > + > + info->max_physmem_bits = _MAX_PHYSMEM_BITS_OLD; > + if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME())) > + || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) > + return TRUE; > + > + info->max_physmem_bits = _MAX_PHYSMEM_BITS_NEW; > + if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME())) > + || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) > + return TRUE; > + > + return FALSE; > +} > + > +int > get_machdep_info_s390x(void) > { > unsigned long vmalloc_start; > @@ -70,7 +92,10 @@ get_machdep_info_s390x(void) > flag_ignore_r_char = 1; > > info->section_size_bits = _SECTION_SIZE_BITS; > - info->max_physmem_bits = _MAX_PHYSMEM_BITS; > + if (!set_s390x_max_physmem_bits()) { > + ERRMSG("Can't detect max_physmem_bits.\n"); > + return FALSE; > + } > info->page_offset = __PAGE_OFFSET; > > if (SYMBOL(_stext) == NOT_FOUND_SYMBOL) { > diff --git a/makedumpfile.h b/makedumpfile.h > index b3de521..a95d132 100644 > --- a/makedumpfile.h > +++ b/makedumpfile.h > @@ -531,7 +531,8 @@ do { \ > #define KERNELBASE (0) > #define KVBASE KERNELBASE > #define _SECTION_SIZE_BITS (28) > -#define _MAX_PHYSMEM_BITS (42) > +#define _MAX_PHYSMEM_BITS_OLD (42) > +#define _MAX_PHYSMEM_BITS_NEW (46) > > /* Bits in the segment/region table address-space-control-element */ > #define _ASCE_TYPE_MASK 0x0c > _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec