From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: mmu: fix the hang when we steal a section unaligned size memory
Date: Tue, 18 Jun 2013 17:52:47 +0100 [thread overview]
Message-ID: <20130618165246.GC2718@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20130618152905.GB8534@mudshark.cambridge.arm.com>
On Tue, Jun 18, 2013 at 04:29:05PM +0100, Will Deacon wrote:
> Wouldn't this be better achieved with a parameter, rather than a global
> state variable? That said, I don't completely follow why memblock_alloc is
> giving you back an unmapped physical address. It sounds like we're freeing
> too much as part of the stealing (or simply that stealing has to be section
> aligned), but memblock only deals with physical addresses.
>
> Could you elaborate please?
It's a catch-22 situation. memblock allocates from the top of usable
memory.
While setting up the page tables for the second time, we insert section
mappings. If the last mapping is not section sized, we will try to set
it up using page mappings. For this, we need to allocate L2 page
tables from memblock.
memblock returns a 4K page in the last non-section sized mapping - which
we're trying to setup, and hence is not yet mapped.
This is why I've always said - if you steal memory from memblock, it
_must_ be aligned to 1MB (the section size) to avoid this. Not only
that, but we didn't _used_ to allow page-sized mappings for MT_MEMORY -
that got added for OMAP's SRAM support.
next prev parent reply other threads:[~2013-06-18 16:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 8:57 [PATCH 1/2] ARM: mmu: fix the hang when we steal a section unaligned size memory Huang Shijie
2013-06-13 8:57 ` [PATCH 2/2] ARM: mm: dump the memblock info in the later place Huang Shijie
2013-06-17 2:44 ` [PATCH 1/2] ARM: mmu: fix the hang when we steal a section unaligned size memory Huang Shijie
2013-06-18 15:29 ` Will Deacon
2013-06-18 16:52 ` Russell King - ARM Linux [this message]
2013-06-19 2:36 ` Huang Shijie
2013-06-19 8:28 ` Russell King - ARM Linux
2013-06-19 8:47 ` Huang Shijie
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=20130618165246.GC2718@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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 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).