From: Catalin Marinas <catalin.marinas@arm.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Will Deacon <will@kernel.org>, James Morse <james.morse@arm.com>,
Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: Force NO_BLOCK_MAPPINGS if crashkernel reservation is required
Date: Fri, 20 Nov 2020 09:23:27 +0000 [thread overview]
Message-ID: <20201120092326.GA24344@gaia> (raw)
In-Reply-To: <3c76d583-12c3-691d-50c6-564831e40534@arm.com>
On Fri, Nov 20, 2020 at 09:25:22AM +0530, Anshuman Khandual wrote:
> On 11/19/20 11:25 PM, Catalin Marinas wrote:
> > mem_init() currently relies on knowing the boundaries of the crashkernel
> > reservation to map such region with page granularity for later
> > unmapping via set_memory_valid(..., 0). If the crashkernel reservation
> > is deferred, such boundaries are not known when the linear mapping is
> > created. Simply parse the command line for "crashkernel" and, if found,
> > create the linear map with NO_BLOCK_MAPPINGS.
> >
> > Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: James Morse <james.morse@arm.com>
> > Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> > ---
> >
> > Following the online (and offline) discussion with James and Nicolas,
> > this aims to avoid issues with moving the reserve_crashkernel() call to
> > after the memory map has been created (the ZONE_DMA patches).
> >
> > https://lore.kernel.org/r/e60d643e-4879-3fc3-737d-2c145332a6d7@arm.com
> >
> > arch/arm64/mm/mmu.c | 37 ++++++++++++++++---------------------
> > 1 file changed, 16 insertions(+), 21 deletions(-)
> >
> > diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> > index d7fe72ee678a..dd214157a026 100644
> > --- a/arch/arm64/mm/mmu.c
> > +++ b/arch/arm64/mm/mmu.c
> > @@ -469,6 +469,21 @@ void __init mark_linear_text_alias_ro(void)
> > PAGE_KERNEL_RO);
> > }
> >
> > +static bool crash_mem_map __initdata;
> > +
> > +static int __init enable_crash_mem_map(char *arg)
> > +{
> > + /*
> > + * Proper parameter parsing is done by reserve_crashkernel(). We only
> > + * need to know if the linear map has to avoid block mappings so that
> > + * the crashkernel reservations can be unmapped later.
> > + */
> > + crash_mem_map = true;
> > +
> > + return 0;
> > +}
> > +early_param("crashkernel", enable_crash_mem_map);
>
> Should not the crash kernel cmdline parameter gets parsed enough, just to
> ensure it is atleast a valid one ? Otherwise an invalid cmdline request
> can prevent the block mapping. In that case, the kernel will neither have
> a crash kernel nor the block mapping.
Does it actually matter? If people pass random strings on the command
line, they should expect some side-effects. That's about the intention
to have a crashkernel. We can't fully validate the crashkernel parameter
until we know the zones layout.
Also note that with defconfig, we don't get block mappings anyway
(rodata_full).
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-11-20 9:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-19 17:55 [PATCH] arm64: Force NO_BLOCK_MAPPINGS if crashkernel reservation is required Catalin Marinas
2020-11-19 18:18 ` James Morse
2020-11-19 19:08 ` Nicolas Saenz Julienne
2020-11-20 3:55 ` Anshuman Khandual
2020-11-20 9:23 ` Catalin Marinas [this message]
2020-11-20 11:08 ` Anshuman Khandual
2020-11-20 11:38 ` Catalin Marinas
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=20201120092326.GA24344@gaia \
--to=catalin.marinas@arm.com \
--cc=anshuman.khandual@arm.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=nsaenzjulienne@suse.de \
--cc=will@kernel.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).