public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: Andi Kleen <ak@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Chandramouli Narayanan <mouli@linux.intel.com>,
	linux-kernel@vger.kernel.org, Aaron Durbin <adurbin@google.com>
Subject: Re: [PATCH 0/3] x86_64 EFI runtime service support
Date: Mon, 20 Aug 2007 10:12:41 -0700	[thread overview]
Message-ID: <46C9CB89.7020603@zytor.com> (raw)
In-Reply-To: <1187580031.27947.67.camel@caritas-dev.intel.com>

Huang, Ying wrote:
>>
>> I propose that, in addition to the aforementioned version number and
>> magic fields, we add a pointer, which should be the last pointer added
>> that doesn't point into I/O space or reserved memory (i.e. memory that
>> is off limit anyway for the operating system.)
>>
>> This pointer should point to a linked list of suggested form:
>>
>> struct setup_data {
>> 	u64 next;
>> 	u32 type;
>> 	u32 len;
>> 	u8 data[];
>> };
>>
>> This can thus encapsulate large objects as necessary, and the early
>> kernel entry can linearize them if it needs to move them out of the way.
>>  Better yet, this information can be made available to sysfs for
>> debuggability, and/or use by kexec.
> 
> This is a good interface. It is extensible. In the future, when we need
> more boot information, we can just define a new type.
> 
> And with this interface, it is not necessary to export the "zero page
> protocol" as a external boot protocol (ABI) of the kernel. So, I
> proposed that:
> 
> 1. Keep "zero page" as a internal interface, even make that explicitly
> in the document.
> 2. Increase the version number of standard boot protocol.
> 3. Append this pointer (pointed to linked list of struct setup_data) to
> standard boot protocol.
> 4. Define a set of types of struct setup_data, each for one zero_page
> field.
> 5. The kernel 16-bit setup code generates "linked list of struct
> setup_data" instead of generating "zero page". On machine with BIOS
> other than legacy BIOS (such as EFI, LinuxBIOS, etc), the bootloader
> (incuding kexec) generates the "linked list of struct setup_data"
> instead of generating "zero page" too.
> 6. In kernel early booting code, the "zero page" is generated from the
> "linked list of struct setup_data".
> 7. In the future, most booting code uses "linked list of struct
> setup_data" directly instead of "zero page".
> 
> So, we need not define a new boot protocol, just extend the standard
> boot protocol. The version number and magic need not to be added to
> "zero page". But, at the same time, the bootloader on EFI, LinuxBIOS and
> kexec must be changed accordingly.
> 

I think this is too radical of a change to be practical.  Instead, I
propose the following:

- "struct boot_params" (the zeropage) is kept as a legacy interface.
%esi will continue to point to it on entry to the 32-bit entrypoint
(presumably that is %rsi on entry to a 64-bit entrypoint?)

- We add a magic number and a pointer chain to the zeropage.  The
presence of the magic number indicates that:

	- Any unused fields in the zeropage is zero;
	- The pointer chain is valid (unless zero);
	- The old "HD info" fields (and possibly the EDD fields)
	  can be recycled.

What a post-upgrade kernel should do upon encountering an old structure
(sans magic) is to zero out any fields that wasn't present in the legacy
structure definition, including the pointer chain, then it can use it as-is.

We should avoid adding fields to the zero_page after that, unless
necessary for backwards compatibility reasons.  In general, new data
items should be added as pointer capabilities.

Compare this to the legacy PCI header vs. PCI capabilities.

	-hpa

  reply	other threads:[~2007-08-20 17:13 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-13  7:30 [PATCH 0/3] x86_64 EFI runtime service support Huang, Ying
2007-08-15 22:42 ` Andrew Morton
2007-08-16  7:51   ` Huang, Ying
2007-08-16 14:11     ` Andi Kleen
2007-08-17  1:25       ` Huang, Ying
2007-08-17 16:11         ` H. Peter Anvin
2007-08-20  3:20           ` Huang, Ying
2007-08-20 17:12             ` H. Peter Anvin [this message]
2007-08-21  1:44               ` Huang, Ying
2007-08-21  3:54                 ` H. Peter Anvin
2007-08-21  4:53                   ` Huang, Ying
2007-08-21 11:33               ` Andi Kleen
2007-08-21 10:41                 ` H. Peter Anvin
2007-08-21 11:45                   ` Andi Kleen
2007-08-21 23:58                     ` Yinghai Lu
2007-08-22  1:22                       ` Andi Kleen
2007-08-22  6:43                         ` Yinghai Lu
2007-08-22 11:11                           ` Andi Kleen
2007-08-22 14:23                             ` huang ying
2007-08-22 16:28                               ` H. Peter Anvin
2007-08-23  2:21                                 ` Huang, Ying
2007-08-23  2:46                                   ` H. Peter Anvin
2007-08-22 14:41                             ` Eric W. Biederman
2007-08-22 16:44                               ` H. Peter Anvin
2007-08-22  7:20                         ` Yinghai Lu
2007-08-15 23:16 ` Andrew Morton
2007-08-15 23:22   ` H. Peter Anvin
2007-08-16  8:00     ` Huang, Ying
2007-08-16 16:09       ` H. Peter Anvin
2007-08-19 22:27         ` Eric W. Biederman
2007-08-19 22:25       ` Eric W. Biederman
2007-08-19 23:46         ` Yinghai Lu
2007-08-20 17:05           ` H. Peter Anvin
2007-08-20 17:20             ` San Mehat
2007-08-20 20:13             ` Matthew Garrett
2007-08-20  5:14         ` Huang, Ying
2007-08-16  7:52   ` Huang, Ying

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=46C9CB89.7020603@zytor.com \
    --to=hpa@zytor.com \
    --cc=adurbin@google.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mouli@linux.intel.com \
    --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