From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: mm: restrict early_alloc_aligned to legal area
Date: Tue, 09 Jul 2013 10:03:15 -0600 [thread overview]
Message-ID: <51DC3443.3060408@wwwdotorg.org> (raw)
In-Reply-To: <1373323495-10087-1-git-send-email-swarren@wwwdotorg.org>
On 07/08/2013 04:44 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> When early_alloc_aligned() is called, it appears that only memory in the
> first memory bank is mapped for CPU access. However, memblock_alloc() is
> called to allocate the RAM, and that can return RAM that is part of any
> valid memory bank, which hence could be inaccessible to the CPU. If this
> happens, the subsequent memset() will hang or crash.
>
> Solve this by calling memblock_alloc_base() instead of memblock_alloc().
> This function takes an explicit max address. Use the end of the first
> memory bank as the address.
Scratch this; it causes problems on systems with highmem.
> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> static void __init *early_alloc_aligned(unsigned long sz, unsigned long align)
> {
> - void *ptr = __va(memblock_alloc(sz, align));
> + phys_addr_t max_pa = memblock.memory.regions[0].base +
> + memblock.memory.regions[0].size;
Perhaps that needs to be min(memblock 0 end, end of lowmem). I'll try
that...
prev parent reply other threads:[~2013-07-09 16:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-08 22:44 [PATCH] ARM: mm: restrict early_alloc_aligned to legal area Stephen Warren
2013-07-09 16:03 ` Stephen Warren [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=51DC3443.3060408@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.