All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@vger.kernel.org>,
	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>
Subject: Re: [GIT PULL] x86 setup: correct booting on 486DX4
Date: Sun, 04 Nov 2007 17:14:41 -0700	[thread overview]
Message-ID: <m1bqa9blam.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <200711042257.lA4Mvobr025200@tazenda.hos.anvin.org> (H. Peter Anvin's message of "Sun, 4 Nov 2007 14:57:50 -0800")

"H. Peter Anvin" <hpa@zytor.com> writes:

> Hi Linus; please pull:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup.git
> for-linus
>
> H. Peter Anvin (1):
>       x86 setup: correct booting on 486DX4
>
>  arch/x86/boot/pmjump.S |   32 +++++++++++++++++++++-----------
>  1 files changed, 21 insertions(+), 11 deletions(-)
>
> [Full diff and log follows]

Looks reasonable to me.

> commit ac3b37b78c5f0f0be0b476a35370650f7bad482f
> Author: H. Peter Anvin <hpa@zytor.com>
> Date:   Sun Nov 4 14:33:41 2007 -0800
>
>     x86 setup: correct booting on 486DX4
>     
>     Apparently, the 486DX4 does not correctly serialize a mov to %cr0, so
>     we really do need the far jump immediately afterwards.  This means
>     losing the nice separation between 16- and 32-bit code, but c'est la
>     vie.
>     
>     Also pass %ebx = %edi = %ebp = 0 to support future extension of the
>     32-bit boot protocol.
>     
>     Signed-off-by: H. Peter Anvin <hpa@zytor.com>
>
> diff --git a/arch/x86/boot/pmjump.S b/arch/x86/boot/pmjump.S
> index 2e55923..17e6dec 100644
> --- a/arch/x86/boot/pmjump.S
> +++ b/arch/x86/boot/pmjump.S
> @@ -28,27 +28,37 @@
>   * void protected_mode_jump(u32 entrypoint, u32 bootparams);
>   */
>  protected_mode_jump:
> -	xorl	%ebx, %ebx		# Flag to indicate this is a boot
>  	movl	%edx, %esi		# Pointer to boot_params table
> -	movl	%eax, 2f		# Patch ljmpl instruction
> +
> +	xorl	%edx, %edx
> +	movw	%cs, %dx
> +	shll	$4, %edx		# Patch ljmpl instruction
> +	addl	%edx, 2f
>  	jmp	1f			# Short jump to flush instruction q.
>  
>  1:
>  	movw	$__BOOT_DS, %cx
> +	xorl	%ebx, %ebx		# Per protocol
> +	xorl	%ebp, %ebp		# Per protocol
> +	xorl	%edi, %edi		# Per protocol
>  
>  	movl	%cr0, %edx
>  	orb	$1, %dl			# Protected mode (PE) bit
>  	movl	%edx, %cr0
> +	
> +	.byte	0x66, 0xea		# ljmpl opcode
> +2:	.long	3f			# Offset
> +	.word	__BOOT_CS		# Segment
>  
> -	movw	%cx, %ds
> -	movw	%cx, %es
> -	movw	%cx, %fs
> -	movw	%cx, %gs
> -	movw	%cx, %ss
> +	.code32
> +3:
> +	movl	%ecx, %ds
> +	movl	%ecx, %es
> +	movl	%ecx, %fs
> +	movl	%ecx, %gs
> +	movl	%ecx, %ss
>  
>  	# Jump to the 32-bit entrypoint
> -	.byte	0x66, 0xea		# ljmpl opcode
> -2:	.long	0			# offset
> -	.word	__BOOT_CS		# segment
> -
> +	jmpl	*%eax
> +	
>  	.size	protected_mode_jump, .-protected_mode_jump

  reply	other threads:[~2007-11-05  0:15 UTC|newest]

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

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=m1bqa9blam.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@it.uu.se \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@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.