[GIT PULL] x86 setup: correct booting on 486 (revised)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>, H. Peter Anvin <hpa@...>, Thomas Gleixner <tglx@...>, Ingo Molnar <mingo@...>, Mikael Petterson <mikpe@...>, Eric Biederman <ebiederm@...>, Jeremy Fitzhardinge <jeremy@...>
Date: Sunday, November 4, 2007 - 11:58 pm

Just for the record, I realized this patch could be done slightly
cleaner and cleaned it up accordingly.

  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 |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

commit 9f259cc59ba45b8db401d60be9700e275676fb15
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 26baeab..fa6bed1 100644
--- a/arch/x86/boot/pmjump.S
+++ b/arch/x86/boot/pmjump.S
@@ -28,11 +28,13 @@
  * 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
 
 	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 7ed192906a2144ebc8ca2925a85d27b9c5355668
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..26baeab 100644
--- a/arch/x86/boot/pmjump.S
+++ b/arch/x86/boot/pmjump.S
@@ -31,14 +31,14 @@ 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
-	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	1f			# Short jump to serialize on 386/486
+1:
 
 	movw	%cx, %ds
 	movw	%cx, %es
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PULL] x86 setup: correct booting on 486 (revised), H. Peter Anvin, (Sun Nov 4, 10:16 pm)
[GIT PULL] x86 setup: correct booting on 486 (revised), H. Peter Anvin, (Sun Nov 4, 11:58 pm)
Re: [GIT PULL] x86 setup: correct booting on 486 (revised), Eric W. Biederman, (Mon Nov 5, 4:21 pm)
Re: [GIT PULL] x86 setup: correct booting on 486 (revised), Eric W. Biederman, (Mon Nov 5, 5:14 pm)
Re: [GIT PULL] x86 setup: correct booting on 486 (revised), Eric W. Biederman, (Mon Nov 5, 5:58 pm)
Re: [GIT PULL] x86 setup: correct booting on 486 (revised), Jeremy Fitzhardinge, (Mon Nov 5, 4:51 pm)
Re: [GIT PULL] x86 setup: correct booting on 486 (revised), Jeremy Fitzhardinge, (Mon Nov 5, 8:59 pm)
Re: [GIT PULL] x86 setup: correct booting on 486 (revised), Jeremy Fitzhardinge, (Mon Nov 5, 9:18 pm)
Re: [GIT PULL] x86 setup: correct booting on 486 (revised), Jeremy Fitzhardinge, (Tue Nov 6, 12:17 pm)
Re: [GIT PULL] x86 setup: correct booting on 486 (revised), H. Peter Anvin, (Tue Nov 6, 12:27 pm)
Re: [GIT PULL] x86 setup: correct booting on 486 (revised), Eric W. Biederman, (Tue Nov 6, 1:04 pm)
Re: [GIT PULL] x86 setup: correct booting on 486 (revised), Jeremy Fitzhardinge, (Tue Nov 6, 12:55 pm)
Re: [GIT PULL] x86 setup: correct booting on 486 (revised), Eric W. Biederman, (Tue Nov 6, 1:09 pm)
Re: [GIT PULL] x86 setup: correct booting on 486 (revised), Eric W. Biederman, (Tue Nov 6, 2:27 pm)