From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Chris Friesen <cfriesen@nortel.com>
Cc: linuxppc-dev@ozlabs.org, Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: proper way to reserve a chunk of memory at the top of the kernel?
Date: Mon, 20 Jul 2009 11:54:05 +1000 [thread overview]
Message-ID: <1248054845.13067.28.camel@pasglop> (raw)
In-Reply-To: <4A5CF62F.6020102@nortel.com>
On Tue, 2009-07-14 at 15:18 -0600, Chris Friesen wrote:
> I have a powerpc board with 512BM of memory. The BIOS has a chunk of
> memory at the top end of physical memory which it does not zero out over
> a reboot.
>
> What's the proper way to tell linux that this chunk of physical memory
> should be ignored (so that we can access it later without worrying that
> Linux will try to allocate it)? Should I be calling
>
> lmb_reserve(lmb_end_of_DRAM() - size, size);
>
> in early_reserve_mem() or is there a better mechanism?
The device-tree blob contains a special "reserve map" in the header,
which automatically turns into calls to lmb_reserve() early during boot,
so putting your special region in that map should be the right way to do
what you want without special code.
> For comparison, in an older kernel this was done in set_phys_avail(), by
> calling mem_pieces_remove(&phys_avail, total_lowmem - size, size, 1);
Cheers,
Ben.
> Thanks,
>
> Chris
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
prev parent reply other threads:[~2009-07-20 1:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-14 21:18 proper way to reserve a chunk of memory at the top of the kernel? Chris Friesen
2009-07-20 1:54 ` Benjamin Herrenschmidt [this message]
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=1248054845.13067.28.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=cfriesen@nortel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).