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:	Sun, 13 Apr 2008 20:58:21 -0700
From:	Arjan van de Ven <arjan@...radead.org>
To:	Erik Bosman <ejbosman@...vu.nl>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrea Arcangeli <andrea@...share.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3-REVISED] x86: Implement prctl PR_GET_TSC and
 PR_SET_TSC

On Mon, 14 Apr 2008 00:24:18 +0200 (CEST)
Erik Bosman <ejbosman@...vu.nl> wrote:

> 
> (I have made it non-configurable and it does not touch
> kernel/seccomp.c anymore. I only changed ifdef/endifs)
> 
>     This patch implements the PR_GET_TSC and PR_SET_TSC prctl()
>     commands on the x86 platform (both 32 and 64 bit.) These
>     commands control the ability to read the timestamp counter
>     from userspace (the RDTSC instruction.)
> 
>     While the RDTSC instuction is a useful profiling tool,
>     it is also the source of some non-determinism in ring-3.
>     For deterministic replay applications it is useful to be
>     able to trap and emulate (and record the outcome of) this
>     instruction.
> 
>     This patch uses code earlier used to disable the timestamp
>     counter for the SECCOMP framework. A side-effect of this
>     patch is that the SECCOMP environment will now also disable
>     the timestamp counter on x86_64 due to the addition of the
>     TIF_NOTSC define on this platform.
> 
>     The code which enables/disables the RDTSC instruction during
>     context switches is in the __switch_to_xtra function, which
>     already handles other unusual conditions, so normal
>     performance should not have to suffer from this change.
> 
>     Signed-off-by: Erik Bosman <ejbosman@...vu.nl>


I like this a whole lot more than the previous version; in fact
I like how it gets rid of various ifdefs. It's a bit unfortunate that
it duplicates for 32/64 bit but this code isn't unified yet, and at least
your 2 functions are identical, making it not hard to deal with in the unification.
(so .. not your fault you did all the right things)


Acked-by: Arjan van de Ven  <arjan@...ux.intel.com>



Btw one other reason I like this general approach is that we can now start to get
apps to ask for the tsc to be enabled when they use it, and then we can just say
"no" on systems without reliable tsc...
(obviously we can't do that right away but we should try to migrate to that approach)


-- 
If you want to reach me at my work email, use arjan@...ux.intel.com
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org
--
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