From: john.stultz@linaro.org (John Stultz)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC/PATCH] arm64: Fix /proc/iomem for reserved but not memory regions
Date: Mon, 24 Sep 2018 11:52:54 -0700 [thread overview]
Message-ID: <CALAqxLX6oadOT80qCyj-P0ZBMJvTt1XZ-viM1uw34BrofHmOVg@mail.gmail.com> (raw)
In-Reply-To: <20180910141636.21813-1-james.morse@arm.com>
On Mon, Sep 10, 2018 at 7:16 AM, James Morse <james.morse@arm.com> wrote:
> commit 50d7ba36b916 ("arm64: export memblock_reserve()d regions via
> /proc/iomem") wrongly assumed that memblock_reserve() would not be used to
> reserve regions that aren't memory. It turns out, this is exactly what
> early_init_dt_reserve_memory_arch() will do if it finds a reservation
> that was also carved out of the memory node.
>
> reserve_memblock_reserved_regions() now needs to cope with reserved regions
> that aren't memory, which means we must walk two lists at once.
>
> We can't use walk_system_ram_res() and reserve_region_with_split()
> together, as the former hands its callback a copied resource on
> the stack, where as the latter expects the in-tree resource to be
> provided.
>
> Allocate an array of struct resources during request_standard_resources()
> so that we have all the 'System RAM' regions on hand.
>
> Increasing the mem_idx cursor is optional as multiple memblock_reserved()
> regions may exist in one System RAM region.
> Because adjacent memblock_reserved() regions will be merged, we also need
> to consider multiple System RAM regions for one span of memblock_reserved()
> address space.
>
> Fixes: 50d7ba36b916 ("arm64: export memblock_reserve()d regions via /proc/iomem")
> Reported-by: John Stultz <john.stultz@linaro.org>
> CC: Akashi Takahiro <takahiro.akashi@linaro.org>
> CC: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Signed-off-by: James Morse <james.morse@arm.com>
> ---
> John, any chance you could give this a test on the platform that the warning
> fires on? Thanks!
Seems to fix it.
Tested-by: John Stultz <john.stultz@linaro.org>
thanks
-john
prev parent reply other threads:[~2018-09-24 18:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-10 14:16 [RFC/PATCH] arm64: Fix /proc/iomem for reserved but not memory regions James Morse
2018-09-24 18:52 ` John Stultz [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=CALAqxLX6oadOT80qCyj-P0ZBMJvTt1XZ-viM1uw34BrofHmOVg@mail.gmail.com \
--to=john.stultz@linaro.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 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).