linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* proper way to reserve a chunk of memory at the top of the kernel?
@ 2009-07-14 21:18 Chris Friesen
  2009-07-20  1:54 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Friesen @ 2009-07-14 21:18 UTC (permalink / raw)
  To: linuxppc-dev, Linux kernel

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?

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);

Thanks,

Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: proper way to reserve a chunk of memory at the top of the kernel?
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2009-07-20  1:54 UTC (permalink / raw)
  To: Chris Friesen; +Cc: linuxppc-dev, Linux kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-20  1:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).