|  |  | 
  
    |  |  | 
 
  |   |  | 
  
    |  |  | 
  
    |  |  | 
  
    |   xen-devel
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen  (and	KVM?) 
| On 09/02/09 14:50, Keir Fraser wrote:
>> Yes.  Perhaps the very simplest way would be to make the kernel update
>> the pvclock version counter on context switch, the same way Xen does;
>> that would allow the usermode vsyscall code to use exactly the same
>> algorithm as the kernel code.  Would Xen cope with that?
>>     
> Yes, that's basically how I would envision it working. The main missing
> detail afaics is how to manage and access the required per-thread data.
>   
I was imagining:
   1. Add a hypercall to set the desired location of the clock
      correction info rather than putting it in the shared-info area
      (akin to vcpu placement).  KVM already has this; they write the
      address to a magic MSR.
   2. Pack all the clock structures into a single page, indexed by vcpu
      number
   3. Map that RO into userspace via fixmap, like the vsyscall page itself
   4. Use the lsl trick to get the current vcpu to index into the array,
      then compute a time value using tsc with corrections; iterate if
      version stamp changes under our feet.
   5. On context switch, the kernel would increment the version of the
      *old* vcpu clock structure, so that when the usermode code
      re-checks the version at the end of its time calculation, it can
      tell that it has a stale vcpu and it needs to iterate with a new
      vcpu+clock structure
    J
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
 | 
 
| <Prev in Thread] | Current Thread | [Next in Thread> |  | 
RE: [Xen-devel] RE: rdtsc: correctness vs performance on Xen (and	KVM?), (continued)
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen  (and	KVM?), Keir Fraser
RE: [Xen-devel] RE: rdtsc: correctness vs performance on Xen  (and	KVM?), Dan Magenheimer
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen  (and	KVM?), Jeremy Fitzhardinge
RE: [Xen-devel] RE: rdtsc: correctness vs performance on Xen  (and	KVM?), Dan Magenheimer
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen  (and	KVM?), Jeremy Fitzhardinge
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen  (and	KVM?), Keir Fraser
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen  (and	KVM?), Jeremy Fitzhardinge
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen  (and	KVM?), Keir Fraser
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen  (and	KVM?),
Jeremy Fitzhardinge <=
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen 	(and KVM?), Jan Beulich
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen 	 (and	KVM?), Jeremy Fitzhardinge
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen	(and KVM?), Jan Beulich
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen	 (and	KVM?), Jeremy Fitzhardinge
RE: [Xen-devel] RE: rdtsc: correctness vs performance on Xen  (and	KVM?), Dan Magenheimer
RE: [Xen-devel] RE: rdtsc: correctness vs performance on Xen 	(and KVM?), Jan Beulich
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen 	(and KVM?), Jan Beulich
Re: [Xen-devel] RE: rdtsc: correctness vs performance on Xen (and	KVM?), Keir Fraser
RE: [Xen-devel] RE: rdtsc: correctness vs performance on Xen (and	KVM?), Dan Magenheimer
[Xen-devel] Re: rdtsc: correctness vs performance on Xen (and KVM?), Keir Fraser
 |  |  | 
  
    |  |  |