From: Coywolf Qi Hunt <coywolf@greatcn.org>
To: Jamie Lokier <jamie@shareable.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>, linux-kernel@vger.kernel.org
Subject: [PATCH] Re: BOOT_CS
Date: Mon, 23 Feb 2004 12:43:09 +0800 [thread overview]
Message-ID: <403984DD.4030108@greatcn.org> (raw)
In-Reply-To: <20040221163213.GB15991@mail.shareable.org>
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
Jamie Lokier wrote:
> Coywolf Qi Hunt wrote:
>
>>>(the jump and indirect branch aren't guaranteed to have the
>>>proper effects, although technically neither should be required due to
>>>the %cr0 write):
???
>>
>>
>>IMHO, why bother to re-reload %cs again?
>>
>>In setup.S, %cs is reloaded already. The enable paging code maps the
>>address identically, so %cs already contains the proper selector.
>
>
> It's to flush the instruction prefetch queue: that's one of the side
> effects of ljmp.
Re-loading %cs and flushing prefetch queue are two different things.
>
> I recall an Intel manual that said ljmp is required when switching
> between real and protected modes, to flush the prefetch queue.
Not necessarily ljmp, imho
>
> Unfortunately I don't remember what that manual said about just setting PG.
>
> I'd guess that current generation CPUs don't care about ljmp when
> changing modes, but older ones certainly do.
>
> -- Jamie
>
FYI, intel's example code located in STARTUP.ASM Listing arround line
180, chapter 9, IA-32 Intel Architecture Software Developer's Manual,
Volume 3: System Programming Guide
Please consider my patch for this issue.
Coywolf
--
Coywolf Qi Hunt
Admin of http://GreatCN.org and http://LoveCN.org
[-- Attachment #2: patch-cy0402230 --]
[-- Type: text/plain, Size: 456 bytes --]
--- head.S.orig 2004-02-18 11:57:16.000000000 +0800
+++ head.S 2004-02-23 12:35:24.000000000 +0800
@@ -115,10 +115,8 @@
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 */
+ pushl $1f /* flush the prefetch-queue */
+ ret /* and normalize $eip */
1:
/* Set up the stack pointer */
lss stack_start,%esp
next prev parent reply other threads:[~2004-02-23 4:44 UTC|newest]
Thread overview: 20+ 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 ` Coywolf Qi Hunt [this message]
2004-02-23 14:30 ` [PATCH] BOOT_CS 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 ` BOOT_CS Eric W. Biederman
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
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=403984DD.4030108@greatcn.org \
--to=coywolf@greatcn.org \
--cc=hpa@zytor.com \
--cc=jamie@shareable.org \
--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 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.