From: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>,
Florian Fainelli <f.fainelli@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
"Sverdlin,
Alexander \(Nokia - DE/Ulm\)" <alexander.sverdlin@nokia.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm: Support initrd with address in boot alias region
Date: Wed, 30 Sep 2020 13:07:01 +0200 [thread overview]
Message-ID: <408be05b-448f-7c58-9ede-e810631f56e3@nokia.com> (raw)
In-Reply-To: <20200930103521.GD1551@shell.armlinux.org.uk>
On 09/30/2020 12:35 PM, Russell King - ARM Linux admin wrote:
> It seems strange to pass the initrd in using an address that is not
> listed as part of the system memory map, especially as the initrd is
> freed during kernel initialisation.
>
> Which boot loader is this, and is there a reason it operates this way?
It is kexec which populates this address. Kexec is allowed to do that
as this region is listed as boot alias:
$ cat /proc/iomem
[cut]
c0000000-d4da1fff : System RAM (boot alias)
840000000-854da1fff : System RAM
840008000-840bfffff : Kernel code
840e00000-840ee56fb : Kernel data
[cut]
880000000-8ffffffff : System RAM
it is arch/arm/kernel/setup.c which populates this entry on line 870:
/*
* Some systems have a special memory alias which is only
* used for booting. We need to advertise this region to
* kexec-tools so they know where bootable RAM is located.
*/
boot_alias_start = phys_to_idmap(start);
if (arm_has_idmap_alias() && boot_alias_start != IDMAP_INVALID_ADDR) {
res = memblock_alloc(sizeof(*res), SMP_CACHE_BYTES);
if (!res)
panic("%s: Failed to allocate %zu bytes\n",
__func__, sizeof(*res));
res->name = "System RAM (boot alias)";
res->start = boot_alias_start;
res->end = phys_to_idmap(end);
res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
request_resource(&iomem_resource, res);
}
This is likely reason why problem has gone unnoticed for so long. I dont
think there is large number of platforms which have boot alias regions +
they use kexec. As noted earlier, bootloader passes correct address, it
is kexec which passes invalid one resulting with:
[ 0.000000] INITRD: 0xc49bb000+0x01a1a000 is not a memory region - disabling initrd
and later with failure to mount it.
Regards,
Matija
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2020-09-30 11:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 7:54 [PATCH] arm: Support initrd with address in boot alias region Matija Glavinic Pecotic
2020-09-29 17:21 ` Florian Fainelli
2020-09-30 10:35 ` Russell King - ARM Linux admin
2020-09-30 11:07 ` Matija Glavinic Pecotic [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=408be05b-448f-7c58-9ede-e810631f56e3@nokia.com \
--to=matija.glavinic-pecotic.ext@nokia.com \
--cc=alexander.sverdlin@nokia.com \
--cc=f.fainelli@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=robh+dt@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).