From: ebiederm@xmission.com (Eric W. Biederman)
To: Greg KH <greg@kroah.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
"Huang, Ying" <ying.huang@intel.com>,
akpm@linux-foundation.org, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Andi Kleen <ak@suse.de>,
linux-kernel@vger.kernel.org,
Kexec Mailing List <kexec@lists.infradead.org>
Subject: Re: [PATCH -mm -v2] x86 boot : export boot_params via sysfs
Date: Wed, 12 Dec 2007 15:52:51 -0700 [thread overview]
Message-ID: <m1ejdrttj0.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20071212222146.GC16474@kroah.com> (Greg KH's message of "Wed, 12 Dec 2007 14:21:46 -0800")
Greg KH <greg@kroah.com> writes:
> On Wed, Dec 12, 2007 at 11:05:45AM -0800, H. Peter Anvin wrote:
>> Greg KH wrote:
>>>> This is a binary structure defined by protocol;
>>> What protocol? Is this a "standard" documented somewhere?
>>
>> Yes, see Documentation/i386/* (although some of it is documented by
>> reference to include/asm-x86/boot_params.h).
>
> Ah, so the structure has changed over the years, making this not so much
> a "firmware" field as originally thought :)
The structure has grown and fields have been added in a backwards
compatible way. It is very much an ABI from the bootloader to the
kernel.
>> I believe kexec currently tries to reconstitute it from what data is
>> available to it. This is incomplete, though, and has been flagged as a
>> problem for kexec.
>
> Can't kexec get this from within the kernel itself when it is running?
> It doesn't need to get this from userspace, does it?
/proc/kmem? All of this work happens in user space. The kexec
syscall interface is just load these chunks of data at this these
addresses and finally jump to this address.
All of the interesting kexec work happens in user space, and it needs
to stay that way. Otherwise we loose the flexibility and simplicity
on the kernel side.
>> It can pick it up from <asm/boot_params.h> (which is now userspace-safe);
>> or it can decode it itself. Programs like kexec can pass through most of
>> the data without examining it, this is the main reason for having it as a
>> blob.
>
> I just don't want kernel structures exported in binary fashions in
> sysfs. If there are specific portions that kexec currently can't figure
> out, why not just export those fields?
So all of the fields are binary.
The entire structure is binary.
The native format is binary.
So either we need to export the processed and chewed up version of the
information like we do today in /proc/iomem. Or we need to export the
raw binary format.
> And, by exporting the different fields (yeah, lots of files, no big
> deal), you can handle the change in the structure over time much easier
> than trying to "know" the layout of the binary blob.
Well /sbin/kexec fundamentally has to "know" the layout of that binary
blob because it generates it and hands it to the kernel.
Greg I think I am with you on this one. If something other then
/sbin/kexec is going to use that information we need to split it
by field, although I expect the fields to remain binary. Things
like the e820 memory map and most of the other fields are binary
structures defined to be returned by the firmware so at that level
we have extremely well defined binary blobs, that may possibly
be used for other things.
/sbin/kexec needs to retain the ability to parse and understand the
information because frequently it needs to change little things like
the memory map and the command line and possibly other things so it
can't blindly pass this information through.
Eric
prev parent reply other threads:[~2007-12-12 22:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-12 8:59 [PATCH -mm -v2] x86 boot : export boot_params via sysfs Huang, Ying
2007-12-12 17:46 ` Greg KH
2007-12-12 17:54 ` H. Peter Anvin
2007-12-12 18:59 ` Greg KH
2007-12-12 19:05 ` H. Peter Anvin
2007-12-12 22:21 ` Greg KH
2007-12-12 22:37 ` H. Peter Anvin
2007-12-12 22:43 ` Randy Dunlap
2007-12-12 23:08 ` Eric W. Biederman
2007-12-12 22:52 ` Eric W. Biederman [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=m1ejdrttj0.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=greg@kroah.com \
--cc=hpa@zytor.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=ying.huang@intel.com \
/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