mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: hpa@zytor.com (H. Peter Anvin)
Cc: linux-kernel@vger.kernel.org
Subject: Re: BOOT_CS
Date: 22 Feb 2004 08:13:04 -0700	[thread overview]
Message-ID: <m1znbbjgfz.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <c16rdh$gtk$1@terminus.zytor.com>

hpa@zytor.com (H. Peter Anvin) writes:

> Anyone happen to know of any legitimate reason not to reload %cs in
> head.S?  

Other than the fact it is strongly rude and error prone to depend on
the contents of a global descriptor table you did not setup?

If we did the lgdt boot_gdt before hand I don't see any problems
though.  

But at the point we could as easily do lgdt cpu_gdt_descr, and use
__KERNEL_CS which is better anyway.

> I think the following would be a lot cleaner, as well as a
> lot safer (the jump and indirect branch aren't guaranteed to have the
> proper effects, although technically neither should be required due to
> the %cr0 write):
> 
> @@ -117,10 +147,7 @@
>         movl %cr0,%eax
>         orl $0x80000000,%eax
>         movl %eax,%cr0          /* ..and set paging (PG) bit */
> -       jmp 1f                  /* flush the prefetch-queue */
> -1:
> -       movl $1f,%eax
> -       jmp *%eax               /* make sure eip is relocated */
> +       ljmp $__BOOT_CS,$1f     /* Clear prefetch and normalize %eip
> */
>  1:
>         /* Set up the stack pointer */
>         lss stack_start,%esp
> 
> 
> I've been doing some cleanups in head.S after making the early page
> tables dynamic.

That is almost nice.  Care to export where the bottom of the page
tables or even better where the bottom of the kernel is for those
folks who want to place their ramdisk as low in memory as possible?

Eric

  parent reply	other threads:[~2004-02-22 15:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-21  5:47 BOOT_CS H. Peter Anvin
2004-02-21 12:43 ` BOOT_CS Coywolf Qi Hunt
2004-02-21 16:32   ` BOOT_CS Jamie Lokier
2004-02-23  4:43     ` [PATCH] BOOT_CS Coywolf Qi Hunt
2004-02-23 14:30       ` Jamie Lokier
2004-02-23 15:24         ` Rene Herman
2004-02-24  3:11         ` [PATCH] Remove the extra jmp Coywolf Qi Hunt
2004-02-24  3:30           ` Brian Gerst
2004-02-24 10:10             ` Coywolf Qi Hunt
2004-02-22 15:13 ` Eric W. Biederman [this message]
2004-02-22 19:47   ` BOOT_CS H. Peter Anvin
2004-02-22 22:05     ` BOOT_CS Eric W. Biederman
2004-02-23 10:27 ` Does Flushing the Queue after PG REALLY a Necessity? Coywolf Qi Hunt
2004-02-23 15:18   ` Philippe Elie
2004-02-24  2:36     ` Coywolf Qi Hunt
2004-02-24  3:10       ` H. Peter Anvin
2004-02-24  4:55       ` Randy.Dunlap
2004-02-24  9:17         ` Coywolf Qi Hunt
2004-02-24 11:21           ` Herbert Poetzl
2004-02-24 11:33             ` Coywolf Qi Hunt
2004-02-24 10:05 BOOT_CS Etienne Lorrain
2004-02-24 15:39 ` BOOT_CS H. Peter Anvin
2004-02-25 10:30 BOOT_CS Etienne Lorrain
2004-02-25 16:23 ` BOOT_CS H. Peter Anvin
2004-02-26 12:17 BOOT_CS Etienne Lorrain
2004-02-26 21:49 ` BOOT_CS Denis Vlasenko
2004-02-27 10:03   ` BOOT_CS Etienne Lorrain
2004-02-27 18:41 ` BOOT_CS 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=m1znbbjgfz.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®