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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061118002710.GF9188@elf.ucw.cz>
Date:	Sat, 18 Nov 2006 01:27:10 +0100
From:	Pavel Machek <pavel@....cz>
To:	Vivek Goyal <vgoyal@...ibm.com>
Cc:	linux kernel mailing list <linux-kernel@...r.kernel.org>,
	Reloc Kernel List <fastboot@...ts.osdl.org>,
	ebiederm@...ssion.com, akpm@...l.org, ak@...e.de, hpa@...or.com,
	magnus.damm@...il.com, lwang@...hat.com, dzickus@...hat.com,
	rjw@...k.pl
Subject: Re: [PATCH 9/20] x86_64: 64bit PIC SMP trampoline

Hi!

> that long mode is supported.  Asking if long mode is implemented is
> down right silly but we have traditionally had some of these checks,
> and they can't hurt anything.  So when the totally ludicrous happens
> we just might handle it correctly.

Well, it is silly, and it is 50 lines of dense assembly. can we get
rid of it or get it shared with bootup version?

The REQUIRED_MASK1/2 look like something that could get out of sync,
for example.

The rest of patch looks okay.

(The traditional checks were unneeded, so it is okay to drop them...)

								Pavel

> +	.code16
> +verify_cpu:
> +	pushl	$0			# Kill any dangerous flags
> +	popfl
> +
> +	/* minimum CPUID flags for x86-64 */
> +	/* see http://www.x86-64.org/lists/discuss/msg02971.html */
> +#define REQUIRED_MASK1 ((1<<0)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<8)|\
> +			   (1<<13)|(1<<15)|(1<<24)|(1<<25)|(1<<26))
> +#define REQUIRED_MASK2 (1<<29)
> +
> +	pushfl				# check for cpuid
> +	popl	%eax
> +	movl	%eax, %ebx
> +	xorl	$0x200000,%eax
> +	pushl	%eax
> +	popfl
> +	pushfl
> +	popl	%eax
> +	pushl	%ebx
> +	popfl
> +	cmpl	%eax, %ebx
> +	jz	no_longmode
> +
> +	xorl	%eax, %eax		# See if cpuid 1 is implemented
> +	cpuid
> +	cmpl	$0x1, %eax
> +	jb	no_longmode
> +
> +	movl	$0x01, %eax		# Does the cpu have what it takes?
> +	cpuid
> +	andl	$REQUIRED_MASK1, %edx
> +	xorl	$REQUIRED_MASK1, %edx
> +	jnz	no_longmode
> +
> +	movl	$0x80000000, %eax	# See if extended cpuid is implemented
> +	cpuid
> +	cmpl	$0x80000001, %eax
> +	jb	no_longmode
> +
> +	movl	$0x80000001, %eax	# Does the cpu have what it takes?
> +	cpuid
> +	andl	$REQUIRED_MASK2, %edx
> +	xorl	$REQUIRED_MASK2, %edx
> +	jnz	no_longmode
> +
> +	ret				# The cpu supports long mode
> +
> +no_longmode:
> +	hlt
> +	jmp no_longmode
> +

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
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