LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kumar Gala <galak@kernel.crashing.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: PPC list <linuxppc-dev@lists.ozlabs.org>
Subject: early_init_devtree() order of memblock limit setting
Date: Sun, 4 Sep 2011 15:08:32 -0500	[thread overview]
Message-ID: <8A961C15-8762-4350-B96D-5173F18C785B@kernel.crashing.org> (raw)

Ben,

I've got an issue on Book-E 64 with the bolted linear mapping and how =
big it might be.  We have to take into account things like mem=3D when =
determining how to set ppc64_rma_size.  So I'm wondering if there is a =
reason w/regards to the order in which we call =
setup_initial_memory_limit() vs parsing the cmdline and calling =
memblock_enforce_memory_limit(limit) in early_init_devtree().

Could we reorder the follow code such that we call =
setup_initial_memory_limit() to after memblock_enforce_memory_limit()?

- k

void __init early_init_devtree(void *params)
{
	=85

        setup_initial_memory_limit(memstart_addr, first_memblock_size);

        /* Save command line for /proc/cmdline and then parse parameters =
*/
        strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
        parse_early_param();

        /* Reserve MEMBLOCK regions used by kernel, initrd, dt, etc... =
*/
        memblock_reserve(PHYSICAL_START, __pa(klimit) - PHYSICAL_START);
        /* If relocatable, reserve first 32k for interrupt vectors etc. =
*/
        if (PHYSICAL_START > MEMORY_START)
                memblock_reserve(MEMORY_START, 0x8000);
        reserve_kdump_trampoline();
        reserve_crashkernel();
        early_reserve_mem();
        phyp_dump_reserve_mem();

        limit =3D memory_limit;
        if (! limit) {
                phys_addr_t memsize;

                /* Ensure that total memory size is page-aligned, =
because
                 * otherwise mark_bootmem() gets upset. */
                memblock_analyze();
                memsize =3D memblock_phys_mem_size();
                if ((memsize & PAGE_MASK) !=3D memsize)
                        limit =3D memsize & PAGE_MASK;
        }
        memblock_enforce_memory_limit(limit);

	=85
}=

                 reply	other threads:[~2011-09-04 20:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=8A961C15-8762-4350-B96D-5173F18C785B@kernel.crashing.org \
    --to=galak@kernel.crashing.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.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