public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Andi Kleen <ak@suse.de>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Huang, Ying" <ying.huang@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	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: Wed, 22 Aug 2007 08:41:27 -0600	[thread overview]
Message-ID: <m1absjpr6w.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20070822111155.GP32640@bingen.suse.de> (Andi Kleen's message of "Wed, 22 Aug 2007 13:11:55 +0200")

Andi Kleen <ak@suse.de> writes:

> On Tue, Aug 21, 2007 at 11:43:38PM -0700, Yinghai Lu wrote:
>> On 8/21/07, Andi Kleen <ak@suse.de> wrote:
>> > > current LinuxBIOS's path: the elfboot in LinuxBIOS will prepare the
>> > > e820 table, and jump to startup_32 in kernel. is that not good and
>> > > simple?
>> >
>> > The problem is that the zero page cannot be changed at all in this
>> > setup. Or rather it can be only changed by breaking LinuxBios.
>> 
>> So you want to construct e820 table in x86_boot_params from LinuxBIOS
>> memmap in head64.c?
>
> The short term fix is probably to just add a version number to
> the zero page and make sure new changes only add stuff to the
> end and the kernel has reasonable compat code for old versions.
>
> Then LinuxBIOS would need to be changed to supply that version number.

To clear up a small misconception.  It isn't LinuxBIOS but the LinuxBIOS
bootloaders that need to be changed.  A subtle distinction. 

> Perhaps it could also include a checksum just to detect old BIOS
> that don't supply a version number.
>
> Long term I'm not sure. Adding LinuxBIOS specific tables also doesn't
> sound very attractive.

Second thinking of this as the empty_zero_page is probably the wrong
mental model of how things work.

At least until HPA's recent changes bzImage is organized as follows:

bootsector (512 bytes)
Various boot protocol variables.
  Some filled in or read by bootloaders 
  some filled in by the real mode code.
real mode code.
32bit Data+Code to load at 1MB.

The empty zero page really is the first 4K or whatever of
the current setup.S.  Any sane bootloader loading the bzImage
will just load the 16bit portion and overwrite the variables
it knows how to fill in.

To ensure there was enough space the code did:

> trampoline:    call    start_of_setup
>                .align 16
>                                        # The offset at this point is 0x240
>                .space  (0xeff-0x240+1) # E820 & EDD space (ending at 0xeff)

We already have the boot protocol revision and if this is something we
are going to support that should be enough of a revision field.  If
the bootloader can't support what the kernel is doing the bootloader
should just give up.  We have major and minor fields there so we can
distinguish between compatible and incompatible changes as well.

Further that arrangement ensures all of the data fields are initialized.

Further there is no 4K limit when used that way except as a convention
and as an implementation detail.  The bootloaders don't care.  The
have to load all of the 16bit real mode section.

I need to review HPA changes a little more from his rewrite in C.
I think he messed up with the guarantee of initialization in that
rewrite, but I'm not quite certain.

Eric


  parent reply	other threads:[~2007-08-22 14:42 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
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 [this message]
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=m1absjpr6w.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=adurbin@google.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mouli@linux.intel.com \
    --cc=yhlu.kernel@gmail.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