netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@in.ibm.com>
To: Morton Andrew Morton <akpm@osdl.org>
Cc: Steve Fox <drfickle@us.ibm.com>, Andi Kleen <ak@suse.de>,
	Badari Pulavarty <pbadari@us.ibm.com>,
	Martin Bligh <mbligh@mbligh.org>,
	lkml <linux-kernel@vger.kernel.org>,
	netdev@vger.kernel.org, kmannth@us.ibm.com,
	Andy Whitcroft <apw@shadowen.org>, Adrian Bunk <bunk@stusta.de>,
	Mel Gorman <mel@csn.ul.ie>
Subject: Re: 2.6.18-mm2 boot failure on x86-64
Date: Mon, 16 Oct 2006 14:16:13 -0400	[thread overview]
Message-ID: <20061016181613.GA30090@in.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0610091049390.30765@skynet.skynet.ie>

On Mon, Oct 09, 2006 at 10:53:58AM +0100, Mel Gorman wrote:
> On Fri, 6 Oct 2006, Vivek Goyal wrote:
> 
> >On Fri, Oct 06, 2006 at 01:03:50PM -0500, Steve Fox wrote:
> >>On Fri, 2006-10-06 at 18:11 +0100, Mel Gorman wrote:
> >>>On (06/10/06 11:36), Vivek Goyal didst pronounce:
> >>>>Where is bss placed in physical memory? I guess bss_start and bss_stop
> >>>>from System.map will tell us. That will confirm that above memset step 
> >>>>is
> >>>>stomping over bss. Then we have to just find that somewhere probably
> >>>>we allocated wrong physical memory area for bootmem allocator map.
> >>>>
> >>>
> >>>BSS is at 0x643000 -> 0x777BC4
> >>>init_bootmem wipes from 0x777000 -> 0x8F7000
> >>>
> >>>So the BSS bytes from 0x777000 ->0x777BC4 (which looks very suspiciously
> >>>pile a page alignment of addr & PAGE_MASK) gets set to 0xFF. One possible
> >>>fix is below. It adds a check in bad_addr() to see if the BSS section is
> >>>about to be used for bootmap. It Seems To Work For Me (tm) and 
> >>>illustrates
> >>>the source of the problem even if it's not the 100% correct fix.
> >>
> >>I was able to boot the machine with Mel's patch applied on top of
> >>-git22.
> >
> >
> >Please have a look at the attached patch. Does it make some sense.
> >
> 
> It makes some sense. As you state, it wastes memory but that is better 
> than breaking.
> 
> >Steve, can you please give this patch a try if it fixes the problem?
> >
> 
> I boottested the patch on the same machine as Steve was using and it 
> completed successfully.
>

Hi Andrew,

Can you please have a look at the attached patch and include it in -mm.
This fixes the issue for steve. It also figures in the list of Adrian Bunk
of known regressions.

Subject    : oops in xfrm_register_mode
References : http://lkml.org/lkml/2006/10/4/170
Submitter  : Steve Fox <drfickle@us.ibm.com>
Handled-By : Vivek Goyal <vgoyal@in.ibm.com>
Status     : patch available



o Currently some code pieces assume that address returned by find_e820_area()
  are page aligned. But looks like find_e820_area() had no such intention
  and hence one might end up stomping over some of the data. One such
  case is bootmem allocator initialization code stomped over bss.

o This patch modified find_e820_area() to return page aligned address. This
  might be little wasteful of memory but at the same time probably it is
  easier to handle page aligned memory. 

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 arch/x86_64/kernel/e820.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff -puN arch/x86_64/kernel/e820.c~x86_64-return-page-aligned-phy-addr-from-find-e820-area arch/x86_64/kernel/e820.c
--- linux-2.6.19-rc1-1M/arch/x86_64/kernel/e820.c~x86_64-return-page-aligned-phy-addr-from-find-e820-area	2006-10-06 15:28:13.000000000 -0400
+++ linux-2.6.19-rc1-1M-root/arch/x86_64/kernel/e820.c	2006-10-06 15:44:45.000000000 -0400
@@ -54,13 +54,13 @@ static inline int bad_addr(unsigned long
 
 	/* various gunk below that needed for SMP startup */
 	if (addr < 0x8000) { 
-		*addrp = 0x8000;
+		*addrp = PAGE_ALIGN(0x8000);
 		return 1; 
 	}
 
 	/* direct mapping tables of the kernel */
 	if (last >= table_start<<PAGE_SHIFT && addr < table_end<<PAGE_SHIFT) { 
-		*addrp = table_end << PAGE_SHIFT; 
+		*addrp = PAGE_ALIGN(table_end << PAGE_SHIFT);
 		return 1;
 	} 
 
@@ -68,18 +68,18 @@ static inline int bad_addr(unsigned long
 #ifdef CONFIG_BLK_DEV_INITRD
 	if (LOADER_TYPE && INITRD_START && last >= INITRD_START && 
 	    addr < INITRD_START+INITRD_SIZE) { 
-		*addrp = INITRD_START + INITRD_SIZE; 
+		*addrp = PAGE_ALIGN(INITRD_START + INITRD_SIZE);
 		return 1;
 	} 
 #endif
 	/* kernel code */
-	if (last >= __pa_symbol(&_text) && last < __pa_symbol(&_end)) {
-		*addrp = __pa_symbol(&_end);
+	if (last >= __pa_symbol(&_text) && addr < __pa_symbol(&_end)) {
+		*addrp = PAGE_ALIGN(__pa_symbol(&_end));
 		return 1;
 	}
 
 	if (last >= ebda_addr && addr < ebda_addr + ebda_size) {
-		*addrp = ebda_addr + ebda_size;
+		*addrp = PAGE_ALIGN(ebda_addr + ebda_size);
 		return 1;
 	}
 
@@ -152,7 +152,7 @@ unsigned long __init find_e820_area(unsi
 			continue; 
 		while (bad_addr(&addr, size) && addr+size <= ei->addr+ei->size)
 			;
-		last = addr + size;
+		last = PAGE_ALIGN(addr) + size;
 		if (last > ei->addr + ei->size)
 			continue;
 		if (last > end) 
_

  reply	other threads:[~2006-10-16 18:16 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060928014623.ccc9b885.akpm@osdl.org>
     [not found] ` <efh217$8au$1@sea.gmane.org>
2006-09-28 21:01   ` 2.6.18-mm2 Andrew Morton
2006-09-28 22:45     ` 2.6.18-mm2 Stephen Hemminger
2006-10-04 13:42     ` 2.6.18-mm2 boot failure on x86-64 Steve Fox
2006-10-04 15:45       ` Andrew Morton
2006-10-04 15:55         ` Vivek Goyal
2006-10-04 15:56         ` Andi Kleen
2006-10-05  1:57           ` Keith Mannthey
2006-10-04 16:41         ` Steve Fox
2006-10-05  0:06           ` Andrew Morton
2006-10-05  0:51             ` Vivek Goyal
2006-10-05  0:57               ` Andi Kleen
2006-10-05  1:08                 ` Martin Bligh
2006-10-05  2:05                   ` Keith Mannthey
2006-10-05 14:53                   ` Steve Fox
2006-10-05 15:12                     ` Badari Pulavarty
2006-10-05 15:32                       ` Steve Fox
2006-10-05 15:40                         ` Andi Kleen
2006-10-05 17:57                           ` Steve Fox
2006-10-05 18:27                             ` Andi Kleen
2006-10-05 18:51                               ` Steve Fox
2006-10-05 19:05                                 ` Andi Kleen
2006-10-05 20:42                                   ` Steve Fox
2006-10-05 20:50                                     ` Andi Kleen
2006-10-06  2:23                                       ` Steve Fox
2006-10-06 14:33                                         ` Mel Gorman
2006-10-06 15:36                                           ` Vivek Goyal
2006-10-06 17:11                                             ` Mel Gorman
2006-10-06 17:34                                               ` Vivek Goyal
2006-10-06 17:59                                               ` Vivek Goyal
2006-10-06 18:03                                               ` Steve Fox
2006-10-06 20:04                                                 ` Vivek Goyal
2006-10-09  9:53                                                   ` Mel Gorman
2006-10-16 18:16                                                     ` Vivek Goyal [this message]
2006-10-16 23:58                                                       ` Andrew Morton
2006-10-17 12:18                                                         ` Adrian Bunk
2006-10-17 17:32                                                           ` Mel Gorman
2006-10-05 18:52                               ` Vivek Goyal
2006-10-05 19:08                                 ` Andi Kleen
2006-10-05 20:25                                   ` Steve Fox
2006-10-05 20:39                                   ` Mel Gorman
2006-10-05 20:51                                     ` Andi Kleen
2006-10-05 23:14                                       ` 2.6.18-mm2 boot failure on x86-64 II Andi Kleen
2006-10-05 23:32                                         ` keith mannthey
2006-10-05 23:35                                           ` Andi Kleen
2006-10-05 23:58                                             ` keith mannthey
2006-10-06  0:02                                               ` Badari Pulavarty
2006-10-06  0:12                                                 ` Andrew Morton
     [not found] ` <200609290319.k8T3JOwS005455@turing-police.cc.vt.edu>
     [not found]   ` <20060928202931.dc324339.akpm@osdl.org>
     [not found]     ` <200609291519.k8TFJfvw004256@turing-police.cc.vt.edu>
     [not found]       ` <20060929124558.33ef6c75.akpm@osdl.org>
2006-09-30  0:01         ` 2.6.18-mm2 - oops in cache_alloc_refill() Valdis.Kletnieks
2006-09-30  1:20           ` Andrew Morton
2006-09-30  1:33             ` Jean Tourrilhes
2006-09-30  3:31               ` Valdis.Kletnieks
2006-09-30  7:50                 ` Valdis.Kletnieks
2006-09-30  8:33                   ` Andrew Morton
2006-09-30  1:40             ` Jean Tourrilhes
2006-09-30  3:31               ` Valdis.Kletnieks
2006-09-30  1:57             ` Makefile for linux modules x z
2006-09-30  8:55               ` Sam Ravnborg
2006-09-30  1:59             ` x z
2006-10-02 17:52             ` 2.6.18-mm2 - oops in cache_alloc_refill() Jean Tourrilhes
2006-10-02 19:57               ` Valdis.Kletnieks
2006-10-03 15:58               ` Samuel Tardieu
2006-10-03 16:34                 ` Jean Tourrilhes
2006-10-03 16:45                   ` Samuel Tardieu
2006-10-03 17:07                     ` Jean Tourrilhes
2006-10-05 22:37                   ` Pavel Roskin
2006-10-05 22:42                     ` Jean Tourrilhes
     [not found] ` <20060930133706.GA3291@melchior.yamamaya.is-a-geek.org>
2006-09-30 19:53   ` 2.6.18-mm2 Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061016181613.GA30090@in.ibm.com \
    --to=vgoyal@in.ibm.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=apw@shadowen.org \
    --cc=bunk@stusta.de \
    --cc=drfickle@us.ibm.com \
    --cc=kmannth@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@mbligh.org \
    --cc=mel@csn.ul.ie \
    --cc=netdev@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).