mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	linuxppc64-dev <linuxppc64-dev@ozlabs.org>
Subject: [PATCH] ppc64: Fix a typo in the code that reserves memory at boot
Date: Sat, 16 Oct 2004 14:55:45 +1000	[thread overview]
Message-ID: <1097902544.8963.5.camel@gaston> (raw)

Hi !

The code that marks memory regions as "reserved" early during boot
has a typo (doing incorrect rounding of the top address) which can
cause some areas to not be properly reserved. That may explain some
cases of initrd corruption reported recently.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

===== arch/ppc64/kernel/prom_init.c 1.2 vs edited =====
--- 1.2/arch/ppc64/kernel/prom_init.c	2004-09-27 19:12:49 +10:00
+++ edited/arch/ppc64/kernel/prom_init.c	2004-10-16 14:53:28 +10:00
@@ -595,7 +595,7 @@
 	 * dumb and just copy this entire array to the boot params
 	 */
 	base = _ALIGN_DOWN(base, PAGE_SIZE);
-	top = _ALIGN_DOWN(top, PAGE_SIZE);
+	top = _ALIGN_UP(top, PAGE_SIZE);
 	size = top - base;
 
 	if (cnt >= (MEM_RESERVE_MAP_SIZE - 1))



             reply	other threads:[~2004-10-16  4:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-16  4:55 Benjamin Herrenschmidt [this message]
2004-10-16  5:02 ` Benjamin Herrenschmidt

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=1097902544.8963.5.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@ozlabs.org \
    --cc=torvalds@osdl.org \
    /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

all inboxes | Powered by JetHome®