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

Hi Linus; please pull:

  git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup.git for-linus

H. Peter Anvin (2):
      x86 setup: add a near jump to serialize %cr0 on 386/486
      x86 setup: set %ebx == %ebp == %edi == 0 on protected mode entry

 arch/x86/boot/pmjump.S |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

commit 142a92e61f9c405a114cb2bfaf3ce3f537a48a89
Author: H. Peter Anvin <hpa@zytor.com>
Date:   Sun Nov 4 17:54:31 2007 -0800

    x86 setup: set %ebx == %ebp == %edi == 0 on protected mode entry
    
    In accordance with the newly formalized 32-bit boot protocol, set
    %ebx == %ebp == %edi == 0 in order to support future extensions to the
    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 18732f7..0d24e96 100644
--- a/arch/x86/boot/pmjump.S
+++ b/arch/x86/boot/pmjump.S
@@ -28,13 +28,15 @@
  * 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, 3f		# Patch ljmpl instruction
 	jmp	1f			# Short jump to flush instruction q.
 1:
 
 	movw	$__BOOT_DS, %cx
+	xorl	%ebx, %ebx		# Per the 32-bit boot protocol
+	xorl	%ebp, %ebp		# Per the 32-bit boot protocol
+	xorl	%edi, %edi		# Per the 32-bit boot protocol
 
 	movl	%cr0, %edx
 	orb	$1, %dl			# Protected mode (PE) bit

commit ad676d0fdf2e59ccc28ee9f6f9593ff14a3d8a5a
Author: H. Peter Anvin <hpa@zytor.com>
Date:   Sun Nov 4 17:50:12 2007 -0800

    x86 setup: add a near jump to serialize %cr0 on 386/486
    
    The 386 and 486 needs a jump immediately after setting %cr0 in order
    to serialize the pipeline.
    
    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..18732f7 100644
--- a/arch/x86/boot/pmjump.S
+++ b/arch/x86/boot/pmjump.S
@@ -30,15 +30,17 @@
 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
+	movl	%eax, 3f		# Patch ljmpl instruction
 	jmp	1f			# Short jump to flush instruction q.
-
 1:
+
 	movw	$__BOOT_DS, %cx
 
 	movl	%cr0, %edx
 	orb	$1, %dl			# Protected mode (PE) bit
 	movl	%edx, %cr0
+	jmp	2f			# Short jump to serialize on 386/486
+2:
 
 	movw	%cx, %ds
 	movw	%cx, %es
@@ -48,7 +50,7 @@ protected_mode_jump:
 
 	# Jump to the 32-bit entrypoint
 	.byte	0x66, 0xea		# ljmpl opcode
-2:	.long	0			# offset
+3:	.long	0			# offset
 	.word	__BOOT_CS		# segment
 
 	.size	protected_mode_jump, .-protected_mode_jump

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

end of thread, other threads:[~2007-11-06 18:41 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-05  2:16 [GIT PULL] x86 setup: correct booting on 486 (revised) H. Peter Anvin
2007-11-05  3:58 ` H. Peter Anvin
2007-11-05 17:15   ` Linus Torvalds
2007-11-05 17:56     ` H. Peter Anvin
2007-11-05 18:12       ` Linus Torvalds
2007-11-05 18:32         ` H. Peter Anvin
2007-11-05 18:36           ` Linus Torvalds
2007-11-05 20:21             ` Eric W. Biederman
2007-11-05 20:31               ` H. Peter Anvin
2007-11-05 20:51                 ` Jeremy Fitzhardinge
2007-11-05 21:06                   ` H. Peter Anvin
2007-11-06  0:59                     ` Jeremy Fitzhardinge
2007-11-06  1:11                       ` H. Peter Anvin
2007-11-06  1:18                         ` Jeremy Fitzhardinge
2007-11-06  1:31                           ` H. Peter Anvin
2007-11-06 16:17                             ` Jeremy Fitzhardinge
2007-11-06 16:27                               ` H. Peter Anvin
2007-11-06 16:55                                 ` Jeremy Fitzhardinge
2007-11-06 17:00                                   ` H. Peter Anvin
2007-11-06 17:09                                     ` Eric W. Biederman
2007-11-06 17:57                                       ` H. Peter Anvin
2007-11-06 18:27                                         ` Eric W. Biederman
2007-11-06 18:41                                           ` H. Peter Anvin
2007-11-06 17:04                                 ` Eric W. Biederman
2007-11-05 21:14                 ` Eric W. Biederman
2007-11-05 21:28                   ` H. Peter Anvin
2007-11-05 21:58                     ` 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