From: Brian Gerst <bgerst@didntduck.org>
To: Coywolf Qi Hunt <coywolf@greatcn.org>
Cc: Jamie Lokier <jamie@shareable.org>,
"H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Remove the extra jmp
Date: Mon, 23 Feb 2004 22:30:43 -0500 [thread overview]
Message-ID: <403AC563.3020306@quark.didntduck.org> (raw)
In-Reply-To: <403AC0F3.7050107@greatcn.org>
Coywolf Qi Hunt wrote:
> Jamie Lokier wrote:
>
>>
>> Your patch uses two instructions to flush the queue (push+ret) instead
>> of one (jmp or ljmp). Is that documented as reliable? I can easily
>> imagine an implementation which decodes one instruction after a mode
>> change predictably, but not two.
>>
>> I doubt that it makes a difference - we're setting PG, not changing
>> the instruction format - but I'd like us to be sure it cannot fail on
>> things like 386s and 486s, and similar non-Intel chips.
>
>
> push+ret is encouraged/borrowed/stolen from FreeBSD ;) it should be
> reliable. And also, old linux uses ret. Since old linux runs on 386, it
> is quite reliable. If you still doubt, we can push before PG.
>
>
>
> Hello Anvin,
>
> Please either take the push+ret patch or take the one near jmp patch
> enclosed in this email. thanks
>
> Coywolf
>
>
>
> ------------------------------------------------------------------------
>
> --- head.S.orig 2004-02-18 11:57:16.000000000 +0800
> +++ head.S 2004-02-24 11:08:34.000000000 +0800
> @@ -117,9 +117,6 @@
> 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 */
> -1:
> /* Set up the stack pointer */
> lss stack_start,%esp
>
This won't work, because the indirect jump is what adds PAGE_OFFSET to
%eip (remember, call/jump use relative addressing). Either keep just
the indirect jump, or use "jmp __PAGE_OFFSET+1f".
--
Brian Gerst
next prev parent reply other threads:[~2004-02-24 3:27 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 ` [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 [this message]
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=403AC563.3020306@quark.didntduck.org \
--to=bgerst@didntduck.org \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox