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:	Tue, 06 Feb 2007 14:47:06 -0800
From:	Zachary Amsden <zach@...are.com>
To:	Andi Kleen <ak@....de>
CC:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...l.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	Chris Wright <chrisw@...s-sol.org>
Subject: Re: [PATCH 2/11] Sched clock paravirt op

Andi Kleen wrote:
>>  	.write_msr = native_write_msr,
>>  	.read_tsc = native_read_tsc,
>>  	.read_pmc = native_read_pmc,
>> +	.get_scheduled_cycles = native_read_tsc,
>> +	.get_cpu_khz = native_calculate_cpu_khz,
>>  	.load_tr_desc = native_load_tr_desc,
>>     
> Description missing? 
>   

I missed a title / signed-off on this guy.


Internally, sched_clock runs in units of nanoseconds, not CPU cycles.  
This was wrong in my previous patch.  Fix it so everyone can use the 
same cycles_2_ns code in tsc.c.

Signed-off-by: Zachary Amsden <zach@...are.com>

> Please write at least two paragraphs or more on each new hook
> you want to add.
>   

Not a new hook; I just changed the name.

> My feeling is that rdtsc should work fine here. If not please explain.
>   

It depends.  Scheduled clock must be in units of available time - stolen 
time is not always evenly distributed.  If you make rdtsc just be 
scheduled clock, that almost works.  But most places that use rdtsc 
expect it to be in cycles of approximate real time, and to leap forward 
if something like SMM comes along and steals time.

Not that this is pretty.  Arguably, the TSC should just run at a fixed 
rate, not progress during stolen time.  This idealized TSC assumption is 
not however how Linux is making use of the TSC today.  TSC is more like 
real time, only in a VM, it can't quite keep up with real time, so it 
gets simulated.

Scheduled (or available) time and real time are good notions.  Stolen 
time is debatable.  But TSC is basically just always wrong.  That's why 
I don't want to overload the rdtsc operation.

Zach
-
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