Return-path: Received: from e06smtp12.uk.ibm.com ([195.75.94.108]) by casper.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RczdX-0002Md-MJ for kexec@lists.infradead.org; Tue, 20 Dec 2011 13:21:44 +0000 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 20 Dec 2011 13:21:34 -0000 Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pBKDLWJB2437270 for ; Tue, 20 Dec 2011 13:21:32 GMT Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pBKDLVXv016329 for ; Tue, 20 Dec 2011 06:21:31 -0700 Message-ID: <1324387291.22248.4.camel@br98xy6r> Subject: Re: [PATCH] makedumpfile: s390x: Auto-detect the correct MAX_PHYSMEM_BITS used in vmcore being analyzed. From: Michael Holzheu Date: Tue, 20 Dec 2011 14:21:31 +0100 In-Reply-To: <20111220101459.26622.49407.stgit@mars.in.ibm.com> References: <20111220101459.26622.49407.stgit@mars.in.ibm.com> Mime-Version: 1.0 Reply-To: holzheu@linux.vnet.ibm.com 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 , Kexec-ml , Ananth Narayan , Reinhard Hello, The s390 kernel patch is queued for the next merge window therefore will go upstream. My recommendation is to include the makedumpfile patch already now if it passes the review. Best Regards Michael On Tue, 2011-12-20 at 16:06 +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=8980036860565a6d2a4f95bb097927e832fa3d1a > > 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