Dexuan Cui
2017-Feb-13 07:49 UTC
[PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method
> From: Thomas Gleixner [mailto:tglx at linutronix.de] > Sent: Saturday, February 11, 2017 02:02 > ... > That's important if the stuff happens cross CPU. If the update happens on > the same CPU then this is a different story and as there are VMexits > involved they might provide the required ordering already. But I can't tell > as I have no idea how that host side thing is done. > > tglxIMO Hyper-V TSC page clocksource here seems pretty similar to KVM's pvclock, So I would guess "the structure is only updated just before reentering the guest after some VM event" (https://rwmj.wordpress.com/2010/10/15/kvm-pvclock/), that is, the update should happen on the same CPU, I guess. Thanks, -- Dexuan
Thomas Gleixner
2017-Feb-13 09:27 UTC
[PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method
On Mon, 13 Feb 2017, Dexuan Cui wrote:> > From: Thomas Gleixner [mailto:tglx at linutronix.de] > > Sent: Saturday, February 11, 2017 02:02 > > ... > > That's important if the stuff happens cross CPU. If the update happens on > > the same CPU then this is a different story and as there are VMexits > > involved they might provide the required ordering already. But I can't tell > > as I have no idea how that host side thing is done. > > > > IMO Hyper-V TSC page clocksource here seems pretty similar to KVM's pvclock, > So I would guess "the structure is only updated just before reentering the guest > after some VM event" (https://rwmj.wordpress.com/2010/10/15/kvm-pvclock/), > that is, the update should happen on the same CPU, I guess.Guessing does not help much. There are a gazillion ways to implement such a thing. I'm sure that there exists proper documentation of the mechanism inside your company. Thanks, tglx
Andy Lutomirski
2017-Feb-13 19:06 UTC
[PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method
On Sun, Feb 12, 2017 at 11:49 PM, Dexuan Cui <decui at microsoft.com> wrote:>> From: Thomas Gleixner [mailto:tglx at linutronix.de] >> Sent: Saturday, February 11, 2017 02:02 >> ... >> That's important if the stuff happens cross CPU. If the update happens on >> the same CPU then this is a different story and as there are VMexits >> involved they might provide the required ordering already. But I can't tell >> as I have no idea how that host side thing is done. >> >> tglx > > IMO Hyper-V TSC page clocksource here seems pretty similar to KVM's pvclock, > So I would guess "the structure is only updated just before reentering the guest > after some VM event" (https://rwmj.wordpress.com/2010/10/15/kvm-pvclock/), > that is, the update should happen on the same CPU, I guess.If the patch is correct, there is one of these shared by all vCPUs, so this is not a sufficient explanation.
Thomas Gleixner
2017-Feb-13 19:28 UTC
[PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method
On Mon, 13 Feb 2017, Andy Lutomirski wrote:> On Sun, Feb 12, 2017 at 11:49 PM, Dexuan Cui <decui at microsoft.com> wrote: > >> From: Thomas Gleixner [mailto:tglx at linutronix.de] > >> Sent: Saturday, February 11, 2017 02:02 > >> ... > >> That's important if the stuff happens cross CPU. If the update happens on > >> the same CPU then this is a different story and as there are VMexits > >> involved they might provide the required ordering already. But I can't tell > >> as I have no idea how that host side thing is done. > >> > >> tglx > > > > IMO Hyper-V TSC page clocksource here seems pretty similar to KVM's pvclock, > > So I would guess "the structure is only updated just before reentering the guest > > after some VM event" (https://rwmj.wordpress.com/2010/10/15/kvm-pvclock/), > > that is, the update should happen on the same CPU, I guess. > > If the patch is correct, there is one of these shared by all vCPUs, so > this is not a sufficient explanation.Right, because that's ony ONE TSC page for the whole guest and then the seq stuff really lacks barriers. Thanks, tglx
Seemingly Similar Threads
- [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method
- [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method
- [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method
- [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method
- [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method