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]
Date:	Wed, 12 Dec 2007 00:23:04 -0500
From:	Kyle McMartin <kyle@...artin.ca>
To:	Rene Herman <rene.herman@...il.com>
Cc:	Linux Kernel <linux-kernel@...r.kernel.org>, dpreed@...d.com,
	Alan Cox <alan@...rguk.ukuu.org.uk>, pavel@....cz,
	andi@...stfloor.org, rol@...917.net,
	Krzysztof Halasa <khc@...waw.pl>, david@...idnewall.com,
	hpa@...or.com, john@...ffel.org, linux-os@...logic.com
Subject: Re: [RFT] Port 0x80 I/O speed

On Wed, Dec 12, 2007 at 12:31:18AM +0100, Rene Herman wrote:
> 	asm volatile ("rdtsc": "=A" (tsc));

rdtsc returns a 64-bit value in two 32-bit regs, you need to do

inline unsigned long long rdtsc(void)
{
	unsigned int lo, hi;
	asm volatile ("rdtsc": "=a" (lo), "=d" (hi));
	return (unsigned long long)hi << 32 | lo;
}

as in msr.h, otherwise you'll only be looking at the value in %rax.

cheers,
	Kyle
--
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