lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 04 Nov 2007 17:14:41 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Linus Torvalds <torvalds@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Mikael Petterson <mikpe@...uu.se>
Subject: Re: [GIT PULL] x86 setup: correct booting on 486DX4

"H. Peter Anvin" <hpa@...or.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@...or.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@...or.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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ