public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Mikael Petterson <mikpe@it.uu.se>,
	Eric Biederman <ebiederm@xmission.com>
Subject: Re: [GIT PULL] x86 setup: correct booting on 486DX4
Date: Sun, 04 Nov 2007 15:36:37 -0800	[thread overview]
Message-ID: <472E5785.4020004@zytor.com> (raw)
In-Reply-To: <alpine.LFD.0.999.0711041522300.15101@woody.linux-foundation.org>

Linus Torvalds wrote:
> 
> On Sun, 4 Nov 2007, Linus Torvalds wrote:
>> I'm not entirely sure that it needs to be a long-jump, btw. I think any
>> regular branch is sufficient. You obviously *do* need to make the long 
>> jump later (to reload %cs in protected mode), but I'm not sure it's needed 
>> in that place. I forget the exact rules (but they definitely were 
>> documented).
> 
> Hmm. The original Linux code did
> 
> 	movw    $1, %ax
> 	lmsw    %ax
> 	jmp     flush_instr
>     flush_instr:
> 
> and I think that was straigh out of the documentation. So yeah, I think 
> that's the right fix - not a longjmp (which in itself is dangerous: it 
> potentially behaves *differently* on different CPU's, since some CPU's may 
> do the long jump with pre-protected-mode semantics, while others will do 
> it with protected mode already in effect!)
> 

Just looked it up; it was a bit hard to find (it is Intel vol 3 page 
9-27, at least in the version I have), but you're right -- the 
documentation only demands a short jump here, not a long jmp (which 
actually makes sense given what I remembered that a long jump should be 
deferrable here.)  So yes, that is definitely the right fix and avoids 
the ugly mixing of code.

I'll update the patch.

	-hpa

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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200711042259.lA4Mxa0n025210@tazenda.hos.anvin.org>
2007-11-04 23:17 ` [GIT PULL] x86 setup: correct booting on 486DX4 Linus Torvalds
2007-11-04 23:25   ` Linus Torvalds
2007-11-04 23:36     ` H. Peter Anvin [this message]
2007-11-04 23:26   ` H. Peter Anvin
2007-11-04 23:59     ` Linus Torvalds
2007-11-05  0:02       ` H. Peter Anvin
2007-11-05  0:12         ` H. Peter Anvin
2007-11-05  0:43         ` Eric W. Biederman
2007-11-05  1:10           ` Linus Torvalds
2007-11-04 23:27   ` Jeremy Fitzhardinge
2007-11-04 22:57 H. Peter Anvin
2007-11-05  0:14 ` Eric W. Biederman

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=472E5785.4020004@zytor.com \
    --to=hpa@zytor.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@it.uu.se \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox