mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Rusty Russell <rusty@rustcorp.com.au>, Andi Kleen <ak@suse.de>,
	Chris Wright <chrisw@sous-sol.org>,
	Zachary Amsden <zach@vmware.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 3/3] boot bzImages under paravirt
Date: Fri, 04 May 2007 12:48:08 -0600	[thread overview]
Message-ID: <m1odl0pgrb.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <463B79E6.8000908@goop.org> (Jeremy Fitzhardinge's message of "Fri, 04 May 2007 11:22:30 -0700")

Jeremy Fitzhardinge <jeremy@goop.org> writes:

> Eric W. Biederman wrote:
>>> Gujin seems to have a near-zero user community, so if they have to rev
>>> their code it wouldn't be a big deal (the author keeps trying to push
>>> some crack-smoking "Gujin native" patches into the kernel, too), 
>>> breaking ELILO would hurt anyone using Intel Macs.
>>>     
>>
>> I'm thinking we just make the code start.
>> startup_32:
>> 	movl	%cs, %eax
>>         testl   $3, %eax
>>         jnz     1f
>>   
>
> I'm not really happy about using this as a way to distinguish paravirt
> from non-paravirt in general.  At some point we're going to be running
> paravirt kernels in ring0 within a VT/SVM container - but they'll still
> be completely paravirtualized kernels.

That wasn't paravirt detection that was do I have permissions to load
the gdt.

Basically we have two choices.   Either unconditionally demand
that %cs %ds %es and %ss are loaded, and so we remove all descriptor
loading.

Or we can do:
startup_32:
	movl	%cs, %eax
	testl	$3, %eax
        jnz     1f

	movl $(__BOOT_DS),%eax
	movl %eax,%ds
	movl %eax,%es
	movl %eax,%fs
	movl %eax,%gs
	movl %eax,%ss

1:

Which only demands that the segments be loaded when we aren't in ring0.
At least historically that is safe for the linux kernel but really weird.

Since there is only one fringe bootloader that cares I'm thinking just
removing all segment loading and assume we have the equivalent of
BOOT_DS in the segments probably makes the most sense.

I'm thinking that our next protocol version probably needs to be 3.0
given the significance of the change, and the fact we are breaking
in a very small ways backwards compatibility.

> I think a better approach is to just do it purely based on the boot
> params platform field.  Ie, something along the lines of:
>
> 	if (boot_params.version < new_enough)
> 		goto native_boot;
> 	else {
> 		for (int i = 0; i < nplatforms; i++)
> 			if (boot_params.platform == platforms[i].id)
> 				goto *platforms[i].startup
> 		panic();
> 	}

I think it is much better to test the boot_params.platform field where
we care.  If the platform is a native x86 subarch we don't need
a magic startup function.  If the platform is Xen or lguest
we can at best copy our boot parameters and jump to their custom
startup routines.

Eric

  reply	other threads:[~2007-05-04 18:50 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-04 12:59 [RFC PATCH 1/3] Replace paravirt_probe with "platform type" boot header field Rusty Russell
2007-05-04 13:02 ` [RFC PATCH 2/3] lguest: Boot with virtual == physical to get closer to native Linux Rusty Russell
2007-05-04 13:07   ` [RFC PATCH 3/3] boot bzImages under paravirt Rusty Russell
2007-05-04 14:38     ` Eric W. Biederman
2007-05-04 14:55       ` Rusty Russell
2007-05-04 15:49         ` H. Peter Anvin
2007-05-04 15:15       ` Jeremy Fitzhardinge
2007-05-04 15:45         ` H. Peter Anvin
2007-05-04 16:13           ` Jeremy Fitzhardinge
2007-05-04 16:43             ` H. Peter Anvin
2007-05-04 16:57             ` Eric W. Biederman
2007-05-04 17:07               ` H. Peter Anvin
2007-05-04 17:30                 ` Eric W. Biederman
2007-05-04 18:22                   ` Jeremy Fitzhardinge
2007-05-04 18:48                     ` Eric W. Biederman [this message]
2007-05-04 18:55                       ` Jeremy Fitzhardinge
2007-05-04 19:21                         ` Eric W. Biederman
2007-05-04 16:46         ` Eric W. Biederman
2007-05-04 17:25           ` Jeremy Fitzhardinge
2007-05-04 17:27             ` H. Peter Anvin
2007-05-04 17:36             ` Eric W. Biederman
2007-05-04 17:44               ` H. Peter Anvin
2007-05-04 18:25               ` Jeremy Fitzhardinge
2007-05-04 14:01 ` [RFC PATCH 1/3] Replace paravirt_probe with "platform type" boot header field Eric W. Biederman
2007-05-04 14:18   ` Rusty Russell
2007-05-04 14:23     ` Eric W. Biederman
2007-05-04 15:52       ` H. Peter Anvin
2007-05-04 16:48         ` Eric W. Biederman
2007-05-04 17:13           ` H. Peter Anvin
2007-05-04 18:30             ` Eric W. Biederman
2007-05-04 18:55               ` H. Peter Anvin
2007-05-04 19:10                 ` Eric W. Biederman
2007-05-04 19:14                   ` H. Peter Anvin
2007-05-04 19:31                     ` Eric W. Biederman
2007-05-04 19:19                   ` H. Peter Anvin
2007-05-04 15:10     ` Eric W. Biederman
2007-05-04 15:53     ` H. Peter Anvin

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=m1odl0pgrb.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=chrisw@sous-sol.org \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=torvalds@linux-foundation.org \
    --cc=zach@vmware.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

Powered by JetHome