lkml.org 
[lkml]   [2009]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Xen-devel] Re: [PATCH 3/5] x86/pvclock: add vsyscall implementation
On 10/07/09 14:37, Avi Kivity wrote:
> If the guest does a RMW on the version, but the host does not (copying
> it from somewhere else), then the guest RMW can be lost.
>
> Looking at the code, that's what kvm does:
>
> vcpu->hv_clock.version += 2;
>
> shared_kaddr = kmap_atomic(vcpu->time_page, KM_USER0);
>
> memcpy(shared_kaddr + vcpu->time_offset, &vcpu->hv_clock,
> sizeof(vcpu->hv_clock));
>
> so a guest-side ++version can be lost.

I see, yes. The Xen code explicitly reads back the guest version and
increments that (I realize now that's what you meant by guest-private
version). If you were to have a second version number it would have to
be separated as well to avoid being overwritten by the hypervisor.

J


\
 
 \ /
  Last update: 2009-10-08 00:01    [W:0.070 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site