public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] x86 setup: correct booting on 486DX4
@ 2007-11-04 22:57 H. Peter Anvin
  2007-11-05  0:14 ` Eric W. Biederman
  0 siblings, 1 reply; 12+ messages in thread
From: H. Peter Anvin @ 2007-11-04 22:57 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Linux Kernel Mailing List, H. Peter Anvin, Thomas Gleixner,
	Ingo Molnar, Mikael Petterson, Eric Biederman

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]

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-11-05  1:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox