From: jcm@redhat.com (Jon Masters)
To: linux-arm-kernel@lists.infradead.org
Subject: Touching the initrd before paging_init
Date: Sun, 13 Dec 2015 03:47:12 -0500 [thread overview]
Message-ID: <566D3090.9090509@redhat.com> (raw)
Hi Folks,
Just a few notes that might be useful to someone else.
I mentioned before that we'll want to see ACPI_INITRD_TABLE_OVERRIDE
support on arm64 in due course for use during bringup of new systems. It
is commonly used on x86 to provide handy updated ACPI tables via a
prepended initrd cpio that is attached to the regular initrd image,
which is infinitely better than respinning firmware each time you want
to provide updated tables (yes yes, we all know the "devicetree"
directive in GRUB does this with DT and that's great and wonderful). I
know that someone is working on it, but I had a need for an interim
solution over the weekend for some hardware I am bringing up here.
The problem is that there's no mapping for the pages containing the
ramdisk data prior to paging_init. x86 does a bit of hoop jumping (and I
think they have certain assumptions about linear mapping too) and splits
the initrd setup into a couple of different phases, which we may well
need to do also if we want to be able to call something like:
#if defined(CONFIG_ACPI) && defined(CONFIG_BLK_DEV_INITRD)
acpi_initrd_override((void *)initrd_start, initrd_end -
initrd_start);
#endif
prior to acpi_boot_table_init in arch/arm64/kernel/setup.c. That routine
will correctly map memory for data it copies out of the cpio, but it
assumes that the initrd is already mapped. For the very nasty hack I
want over the weekend, I added some extra fixmaps and then do an
early_memremap on the physical address of first page of the initrd (the
cpio is tiny, and is always prepended and this is very nasty). Viz:
[ 0.000000] JCM: using fixmap for first page of ramdisk...
[ 0.000000] JCM: first physical page of ramdisk: [mem REDACTED]
[ 0.000000] JCM: first virtual page of ramdisk: [mem REDACTED]
[ 0.000000] XXXX ACPI table found in initrd
[kernel/firmware/acpi/xxxx.aml][0xxxx]
[ 0.000000] XXXX ACPI table found in initrd
[kernel/firmware/acpi/xxxx.aml][0xxx]
[ 0.000000] XXXX ACPI table found in initrd
[kernel/firmware/acpi/xxxx.aml][0xxxx]
So maybe I'll get what I want working, but a head's up to whoever from
Linaro ends up looking into the broader implementation that I think
you'll need to rework initrd mapping as part of that. Unless of course
I'm missing something. Which is more than possible.
Jon.
next reply other threads:[~2015-12-13 8:47 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-13 8:47 Jon Masters [this message]
2015-12-07 6:05 ` Touching the initrd before paging_init Mark Rutland
2015-12-13 16:54 ` [Linaro-acpi] " G Gregory
2015-12-13 16:59 ` Leif Lindholm
2015-12-13 21:36 ` Jon Masters
2015-12-13 22:02 ` Jon Masters
2015-12-13 22:15 ` G Gregory
2015-12-13 22:19 ` Jon Masters
2015-12-15 11:19 ` G Gregory
2015-12-15 15:36 ` Jon Masters
2015-12-15 16:13 ` G Gregory
2015-12-15 16:28 ` G Gregory
2015-12-15 16:31 ` Jon Masters
2015-12-15 17:08 ` G Gregory
2015-12-15 19:22 ` G Gregory
2015-12-13 22:15 ` Jon Masters
2015-12-15 4:51 ` Jon Masters
2015-12-15 10:14 ` Leif Lindholm
2015-12-15 10:22 ` Mark Rutland
2015-12-15 11:43 ` Måns Rullgård
2015-12-15 15:29 ` Jon Masters
2015-12-15 15:42 ` Mark Rutland
2015-12-15 16:31 ` Måns Rullgård
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=566D3090.9090509@redhat.com \
--to=jcm@redhat.com \
--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).