All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Jeff Garzik <jeff@garzik.org>, Andi Kleen <ak@suse.de>,
	patches@x86-64.org, Vivek Goyal <vgoyal@in.ibm.com>,
	linux-kernel@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	virtualization <virtualization@lists.linux-foundation.org>
Subject: Re: [patches] [PATCH] [21/22] x86_64: Extend bzImage protocol for relocatable bzImage
Date: Mon, 30 Apr 2007 17:10:59 -0600	[thread overview]
Message-ID: <m14pmx31bw.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <463670D1.3000003@goop.org> (Jeremy Fitzhardinge's message of "Mon, 30 Apr 2007 15:42:25 -0700")

Jeremy Fitzhardinge <jeremy@goop.org> writes:

> Eric W. Biederman wrote:
>>> I think I'd prefer to have the domain builder decompress/relocate the
>>> kernel from the bzImage and start it directly, rather than have it
>>> decompress/relocate itself, but I'm not really set on that.
>>>     
>>
>> We can change a lot more implementation details arbitrarily if you don't
>> know what needs to happen for decompression and relocation.
>
> Yes, and if it can be made to work, it ultimately means less work
> for me ;)

Now you are beginning to sound like a bootloader author.
Make it work and forget about it :)

>> We have to avoid the writes decompressor-prinnt routines 
>
> At worst, we could set up chunk of memory as a dummy framebuffer.  That
> might be useful for debugging anyway.

I'm trying to recall how we handle this on the LinuxBIOS side.
Because we have machines without a framebuffer setup.  Oh yeah,
we started in 32bit mode...

I do have some parameters to parse the command line in misc.c that
would accomplish this goal.

>> and 
>> possibly the reload of the segment registers.  But otherwise
>> we should be fine.  I don't see any other privileged instructions
>> in arch/i386/boot/compressed/{head.S, misc.c}
>>   
>
> Xen will start the domain with a GDT loaded, and all the segment
> registers loaded with flat segments.  I guess boot/compressed/head.S
> could do the %cs ring check before deciding to do privileged
> operations.

I'm tempted to just reload the segments in setup.S, but that might
break loadlin support or one of the other bootloaders that starts the
kernel in 32bit mode so we need to be careful.


> I presume bzImage jumps straight to startup_32 on the newly decompressed
> kernel?

Straight isn't the way I would but it but yes. startup_32 in arch/i386/head.S
is the first piece of code that outside of the decompressor that it runs.

> I haven't checked if it already has this, but it would be nice if the
> bzImage had a memory range/list of memory ranges it needs mapped to get
> the kernel on its feet, so that the domain builder can just go and map
> those areas for it (either P==V mappings, or with a constant offset;
> whichever is more useful).

P==V mappings I suspect.

> Also, if its a PAE kernel, Xen will start with PAE mode enabled, so
> bzImage will have to deal with that.  But if its not touching
> pagetables, it won't matter.

Exactly.

>> What I really want to do is go back to sticking an ELF header on the
>> bzImage.  We still can't support multiple entry points that way but we
>> can include ELF notes fairly easily.
>>   
>
> That's OK.  We'll be able to use the boot info to go into the
> Xen-specific path shortly after startup_32 anyway.

Yes.

> BTW, the test for a non-ring 0 %cs won't always be a good test for
> paravirtualization; we're likely to start seeing hybrid execution models
> where we run a largely paravirtualized kernel in a SVM/VT container.  If
> we can just unconditionally use the bootloader arch definition to
> determine the entry path into the kernel, it will clean things up nicely.

Yes.  That is why we need a distinct field for this and not overloading
the bootloader id.  That way if the field is non-zero we need to do
something special.

>> It looks like for the next version of booting lguest and Xen are
>> actually coming closer together again.  Yea.
>>
>> For boot protocol. 2.0.7 We currently need a subarchitecture field (16bits?).
>> default == 0, Xen, lguest, voyager?, visws?, numaq?, efi?
>>
>> We need a subarchitecture data pointer field (32bits).
>>   
>
> Do we want to support starting a 64-bit guest in 64-bit mode?

It's the only way that will be sane.  When I was doing my ELF header on
bzImage work I had that working.  But it got dropped due to some unexplained,
unreproducible testing failures and not really being necessary at the
time.  We also need that if we want to be certain we don't play with
page tables.

The other thing the ELF headers gave was a precise accounting of where
the kernel was, which is essentially what needs to be mapped at boot
time.

The hard part I suspect is going to be handling Xen when setup the
physical == virtual page tables

>> We need to target .23 because it is to late for .22.
>
> Yes.  I'll need to do a moderate amount of work on the Xen side to make
> this work, I think.

I think we all will but the upside if we design this carefully is
something that we won't have to change.

Eric


  parent reply	other threads:[~2007-04-30 23:11 UTC|newest]

Thread overview: 217+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-28 17:58 [PATCH] [0/22] x86 candidate patches for review II: 64bit relocatable kernel Andi Kleen
2007-04-28 17:58 ` [PATCH] [1/22] x86_64: dma_ops as const Andi Kleen
2007-04-28 17:58 ` [PATCH] [2/22] x86_64: Assembly safe page.h and pgtable.h Andi Kleen
2007-04-28 17:58 ` [PATCH] [3/22] x86_64: Kill temp boot pmds Andi Kleen
2007-04-28 17:58 ` [PATCH] [4/22] x86_64: Clean up the early boot page table Andi Kleen
2007-04-28 17:58 ` [PATCH] [5/22] x86_64: Fix early printk to use standard ISA mapping Andi Kleen
2007-04-28 17:58 ` [PATCH] [6/22] x86_64: modify copy_bootdata to use virtual addresses Andi Kleen
2007-04-28 17:58 ` [PATCH] [7/22] x86_64: cleanup segments Andi Kleen
2007-04-28 17:58 ` [PATCH] [8/22] x86_64: Add EFER to the register set saved by save_processor_state Andi Kleen
2007-04-28 17:58 ` [PATCH] [9/22] x86_64: 64bit PIC SMP trampoline Andi Kleen
2007-04-28 17:58 ` [PATCH] [10/22] x86_64: Get rid of dead code in suspend resume Andi Kleen
2007-04-28 17:58 ` [PATCH] [11/22] x86_64: wakeup.S rename registers to reflect right names Andi Kleen
2007-04-28 17:58 ` [PATCH] [12/22] x86_64: wakeup.S misc cleanups Andi Kleen
2007-04-28 17:59 ` [PATCH] [13/22] x86_64: 64bit ACPI wakeup trampoline Andi Kleen
2007-04-28 17:59 ` [PATCH] [14/22] x86_64: Modify discover_ebda to use virtual addresses Andi Kleen
2007-04-28 17:59 ` [PATCH] [15/22] x86_64: Remove the identity mapping as early as possible Andi Kleen
2007-04-28 17:59 ` [PATCH] [16/22] x86: Move swsusp __pa() dependent code to arch portion Andi Kleen
2007-04-28 17:59 ` [PATCH] [17/22] x86_64: do not use virt_to_page on kernel data address Andi Kleen
2007-04-28 17:59 ` [PATCH] [18/22] x86: __pa and __pa_symbol address space separation Andi Kleen
2007-04-28 17:59 ` [PATCH] [19/22] x86_64: Relocatable Kernel Support Andi Kleen
2007-04-28 17:59 ` [PATCH] [20/22] x86_64: build-time checking Andi Kleen
2007-04-28 17:59 ` [PATCH] [21/22] x86_64: Extend bzImage protocol for relocatable bzImage Andi Kleen
2007-04-28 18:07   ` Jeff Garzik
2007-04-28 18:24     ` Andi Kleen
2007-04-28 20:18     ` [patches] " Eric W. Biederman
2007-04-28 20:38       ` H. Peter Anvin
2007-04-28 20:46         ` Eric W. Biederman
2007-04-29  4:50           ` Vivek Goyal
2007-04-28 20:39       ` Jeff Garzik
2007-04-29  7:24       ` Jeremy Fitzhardinge
2007-04-29 15:11         ` Eric W. Biederman
2007-04-29 15:11           ` Eric W. Biederman
2007-04-30  3:03           ` Rusty Russell
2007-04-30  3:03           ` Rusty Russell
2007-04-30  4:38             ` H. Peter Anvin
2007-04-30  4:38               ` H. Peter Anvin
2007-04-30  5:03               ` Rusty Russell
2007-04-30  5:03               ` Rusty Russell
2007-04-30  5:25                 ` Eric W. Biederman
2007-04-30  5:25                   ` Eric W. Biederman
2007-04-30 16:03                   ` H. Peter Anvin
2007-04-30 16:03                   ` H. Peter Anvin
2007-04-30 16:47                     ` Eric W. Biederman
2007-04-30 16:47                       ` Eric W. Biederman
2007-04-30 15:34                 ` Eric W. Biederman
2007-04-30 15:34                 ` Eric W. Biederman
2007-05-01  3:38                   ` Rusty Russell
2007-05-01  3:45                     ` H. Peter Anvin
2007-05-01  3:45                       ` H. Peter Anvin
2007-05-01  3:59                       ` Rusty Russell
2007-05-01  3:59                         ` Rusty Russell
2007-05-01  4:00                       ` H. Peter Anvin
2007-05-01  4:00                         ` H. Peter Anvin
2007-05-01  4:50                         ` Rusty Russell
2007-05-01  4:50                         ` Rusty Russell
2007-05-01  5:28                           ` H. Peter Anvin
2007-05-01  5:28                             ` H. Peter Anvin
2007-05-01  6:05                             ` Eric W. Biederman
2007-05-01  6:05                             ` Eric W. Biederman
2007-05-01  3:57                     ` Eric W. Biederman
2007-05-01  3:57                       ` Eric W. Biederman
2007-05-01  5:37                       ` Jeremy Fitzhardinge
2007-05-01  5:37                       ` Jeremy Fitzhardinge
2007-05-01  6:11                         ` Eric W. Biederman
2007-05-01  6:11                         ` Eric W. Biederman
2007-05-01  7:34                         ` Rusty Russell
2007-05-01  7:34                         ` Rusty Russell
2007-05-01  8:03                           ` Jeremy Fitzhardinge
2007-05-01  8:03                           ` Jeremy Fitzhardinge
2007-05-01  3:38                   ` Rusty Russell
2007-04-30 18:50           ` Jeremy Fitzhardinge
2007-04-30 18:50             ` Jeremy Fitzhardinge
2007-04-30 22:10             ` Eric W. Biederman
2007-04-30 22:42               ` Jeremy Fitzhardinge
2007-04-30 22:51                 ` Jeremy Fitzhardinge
2007-04-30 22:51                 ` Jeremy Fitzhardinge
2007-04-30 23:10                 ` Eric W. Biederman [this message]
2007-04-30 23:16                   ` H. Peter Anvin
2007-04-30 23:16                     ` H. Peter Anvin
2007-04-30 23:35                     ` Eric W. Biederman
2007-04-30 23:35                       ` Eric W. Biederman
2007-05-01  3:39                     ` Andi Kleen
2007-05-01  3:39                     ` Andi Kleen
2007-05-01  2:48                       ` H. Peter Anvin
2007-05-01  2:48                         ` H. Peter Anvin
2007-04-30 23:10                 ` Eric W. Biederman
2007-04-30 22:42               ` Jeremy Fitzhardinge
2007-04-30 22:10             ` Eric W. Biederman
2007-05-02  9:31             ` Gerd Hoffmann
2007-05-02  9:31             ` Gerd Hoffmann
2007-05-02 15:16               ` Jeremy Fitzhardinge
2007-05-02 20:51                 ` H. Peter Anvin
2007-05-02 21:01                   ` Jeremy Fitzhardinge
2007-05-02 21:01                   ` Jeremy Fitzhardinge
2007-05-02 21:09                     ` H. Peter Anvin
2007-05-02 21:09                     ` H. Peter Anvin
2007-05-02 21:39                       ` Jeremy Fitzhardinge
2007-05-02 21:59                         ` H. Peter Anvin
2007-05-02 23:03                           ` Jeremy Fitzhardinge
2007-05-02 23:03                           ` Jeremy Fitzhardinge
2007-05-03  4:50                           ` Vivek Goyal
2007-05-03  6:42                             ` Eric W. Biederman
2007-05-03  6:42                             ` Eric W. Biederman
2007-05-03  7:05                               ` Jeremy Fitzhardinge
2007-05-03  7:05                               ` Jeremy Fitzhardinge
2007-05-03 13:23                                 ` Eric W. Biederman
2007-05-03 16:23                                   ` Jeremy Fitzhardinge
2007-05-03 16:23                                   ` Jeremy Fitzhardinge
2007-05-03 13:23                                 ` Eric W. Biederman
2007-05-08 16:41                               ` yhlu
2007-05-08 16:41                               ` yhlu
2007-05-08 17:18                                 ` Eric W. Biederman
2007-05-08 17:18                                 ` Eric W. Biederman
2007-05-08 17:33                                   ` yhlu
2007-05-08 17:33                                     ` yhlu
2007-05-08 18:51                                     ` yhlu
2007-05-08 19:01                                       ` yhlu
2007-05-08 19:01                                       ` yhlu
2007-05-08 19:11                                       ` Eric W. Biederman
2007-05-08 22:00                                         ` yhlu
2007-05-08 22:00                                         ` yhlu
2007-05-08 22:07                                           ` Jeremy Fitzhardinge
2007-05-08 22:07                                           ` Jeremy Fitzhardinge
2007-05-08 22:35                                             ` H. Peter Anvin
2007-05-08 22:41                                               ` yhlu
2007-05-08 23:13                                                 ` H. Peter Anvin
2007-05-09  1:44                                                   ` Eric W. Biederman
2007-05-09  2:23                                                     ` H. Peter Anvin
2007-05-09  2:23                                                     ` H. Peter Anvin
2007-05-09  3:30                                                       ` Eric W. Biederman
2007-05-09  3:30                                                       ` Eric W. Biederman
2007-05-09  4:52                                                         ` yhlu
2007-05-09  4:52                                                         ` yhlu
2007-05-09  4:52                                                         ` yhlu
2007-05-09  5:04                                                           ` H. Peter Anvin
2007-05-09  5:04                                                           ` H. Peter Anvin
2007-05-09  5:08                                                             ` H. Peter Anvin
2007-05-09  5:08                                                             ` H. Peter Anvin
2007-05-09  5:08                                                             ` H. Peter Anvin
2007-05-09  5:08                                                             ` H. Peter Anvin
2007-05-09  5:08                                                             ` H. Peter Anvin
2007-05-09  5:48                                                               ` yhlu
2007-05-09  5:48                                                               ` yhlu
2007-05-09  5:48                                                               ` yhlu
2007-05-09  5:54                                                                 ` H. Peter Anvin
2007-05-09  5:54                                                                 ` H. Peter Anvin
2007-05-09  5:54                                                                 ` H. Peter Anvin
2007-05-09  5:54                                                                 ` H. Peter Anvin
2007-05-09  5:54                                                                 ` H. Peter Anvin
2007-05-09  5:54                                                                 ` H. Peter Anvin
2007-05-09  5:55                                                                 ` H. Peter Anvin
2007-05-09  5:55                                                                 ` H. Peter Anvin
2007-05-09 10:52                                                                   ` Eric W. Biederman
2007-05-09 16:31                                                                     ` yhlu
2007-05-09 16:31                                                                     ` yhlu
2007-05-09 19:21                                                                     ` H. Peter Anvin
2007-05-10  0:52                                                                       ` Eric W. Biederman
2007-05-10  0:52                                                                         ` Eric W. Biederman
2007-05-09 19:21                                                                     ` H. Peter Anvin
2007-05-09 10:52                                                                   ` Eric W. Biederman
2007-05-09  5:55                                                                 ` H. Peter Anvin
2007-05-09  5:55                                                                 ` H. Peter Anvin
2007-05-09  5:55                                                                 ` H. Peter Anvin
2007-05-09  5:55                                                                 ` H. Peter Anvin
2007-05-09  5:48                                                               ` yhlu
2007-05-09  5:08                                                             ` H. Peter Anvin
2007-05-09  5:04                                                           ` H. Peter Anvin
2007-05-09  5:04                                                           ` H. Peter Anvin
2007-05-09  5:04                                                           ` H. Peter Anvin
2007-05-09  5:04                                                           ` H. Peter Anvin
2007-05-09  7:58                                                         ` Gerd Hoffmann
2007-05-09 11:21                                                           ` Eric W. Biederman
2007-05-09 11:21                                                           ` Eric W. Biederman
2007-05-10  0:55                                                           ` yhlu
2007-05-10  0:55                                                           ` yhlu
2007-05-09  7:58                                                         ` Gerd Hoffmann
2007-05-09  2:44                                                     ` yhlu
2007-05-09  2:44                                                     ` yhlu
2007-05-09  1:44                                                   ` Eric W. Biederman
2007-05-08 23:13                                                 ` H. Peter Anvin
2007-05-08 22:41                                               ` yhlu
2007-05-08 22:35                                             ` H. Peter Anvin
2007-05-08 19:11                                       ` Eric W. Biederman
2007-05-09  3:33                                       ` Vivek Goyal
2007-05-09  3:33                                       ` Vivek Goyal
2007-05-09  4:42                                         ` yhlu
2007-05-09  4:42                                         ` yhlu
2007-05-09  4:58                                           ` Eric W. Biederman
2007-05-09  4:58                                           ` ebiederm
2007-05-09  4:58                                           ` ebiederm
2007-05-09  4:58                                           ` ebiederm
2007-05-09  4:58                                           ` Eric W. Biederman
2007-05-09  4:58                                           ` ebiederm
2007-05-09  4:42                                         ` yhlu
2007-05-09  4:42                                         ` yhlu
2007-05-08 18:51                                     ` yhlu
2007-05-08 17:24                                 ` Vivek Goyal
2007-05-08 17:24                                 ` Vivek Goyal
2007-05-08 17:34                                   ` yhlu
2007-05-08 17:34                                   ` yhlu
2007-05-03  4:50                           ` Vivek Goyal
2007-05-02 21:59                         ` H. Peter Anvin
2007-05-02 21:39                       ` Jeremy Fitzhardinge
2007-05-03  2:01                       ` Rusty Russell
2007-05-03  2:01                       ` Rusty Russell
2007-05-02 21:17                   ` Eric W. Biederman
2007-05-02 21:17                   ` Eric W. Biederman
2007-05-02 21:24                     ` H. Peter Anvin
2007-05-02 21:36                       ` Eric W. Biederman
2007-05-02 21:36                       ` Eric W. Biederman
2007-05-02 21:24                     ` H. Peter Anvin
2007-05-02 20:51                 ` H. Peter Anvin
2007-05-02 15:16               ` Jeremy Fitzhardinge
2007-04-29 17:51         ` H. Peter Anvin
2007-04-29 18:10           ` Eric W. Biederman
2007-04-30  4:41         ` Rusty Russell
2007-04-28 17:59 ` [PATCH] [22/22] x86_64: Move cpu verification code to common file Andi Kleen

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=m14pmx31bw.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=ak@suse.de \
    --cc=hpa@zytor.com \
    --cc=jeff@garzik.org \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@x86-64.org \
    --cc=rusty@rustcorp.com.au \
    --cc=vgoyal@in.ibm.com \
    --cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.