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:	Sat, 10 Oct 2009 06:14:42 +0200
From:	Andi Kleen <andi@...stfloor.org>
To:	Jeremy Fitzhardinge <jeremy@...p.org>
Cc:	Andi Kleen <andi@...stfloor.org>, Ingo Molnar <mingo@...hat.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	the arch/x86 maintainers <x86@...nel.org>
Subject: Re: Duplication of vdso and vsyscall code?

On Fri, Oct 09, 2009 at 02:15:58PM -0700, Jeremy Fitzhardinge wrote:
> arch/x86/kernel/vsyscall_64.c implements vgettimeofday and vgetcpu. 
> (And vtime)
> 
> arch/x86/vdso/vclock_gettime.c implements __vdso_gettimeofday (and
> __vdso_clock_gettime), and vgetcpu.c has __vdso_getcpu.
> 
> These appear to be functionally identical duplicate definitions.   I
> don't understand the history here to know how we came to get two sets of
> these functions, but surely we can share the same code for both of these?

One is at a fixed position in the user address space, and the other at a
randomized position. The fixed one came first. Fixed doesn't know
where randomized is. Randomized is also compiled and linked completely
differently. In theory the randomized one could call the fixed one, but
originally there were some thoughts about turning off fixed for some
applications that don't need it and also the path was considered very
performance critical, so unneeded jumps were avoided.
In theory you could probably #include the code from a common file, but it 
wouldn't buy you too much. I think there were originally some 
differences in the vgettimeofday() implementations too, although
that might have changed with all the timer reorganizations.

-Andi
-- 
ak@...ux.intel.com -- Speaking for myself only.
--
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