Skip to content

pvclock vsyscall support + KVM hypervisor support (v4)

Marcelo Tosatti kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest18 patches 9 repliesIn review

v4 from the cover letter

- remove aligned_pvti structure, align directly (Glauber)
- add comments to migration notifier (Glauber)
- mark migration notifier condition as unlikely (Glauber)
- add comment about rdtsc barrier dependency on sse2 (Gleb)
- add idea to improve vdso gettime call (Gleb)
- remove new msr interface, reuse kernel copy of pvclock data (Glauber)
- move copying of timekeeping data from generic timekeeping code to kvm code (John)

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18KVM: x86: retain pvclock guest stopped bit in guest memoryarch/x86/kvm/x86.c+13 -70 replies
1/18KVM: x86: retain pvclock guest stopped bit in guest memoryarch/x86/kvm/x86.c+13 -70 replies
2/18x86: kvmclock: allocate pvclock shared memory areaarch/x86/kernel/kvmclock.c+42 -101 reply
2/18x86: kvmclock: allocate pvclock shared memory area (v2)arch/x86/kernel/kvmclock.c+47 -111 reply
2/18x86: kvmclock: allocate pvclock shared memory areaarch/x86/kernel/kvmclock.c+47 -110 replies
3/18x86: pvclock: make sure rdtsc doesnt speculate out of regionarch/x86/kernel/pvclock.c+2 -20 replies
3/18x86: pvclock: make sure rdtsc doesnt speculate out of regionarch/x86/kernel/pvclock.c+2 -20 replies
4/18x86: pvclock: remove pvclock_shadow_timearch/x86/kernel/pvclock.c+11 -460 replies
4/18x86: pvclock: remove pvclock_shadow_timearch/x86/kernel/pvclock.c+11 -460 replies
5/18x86: pvclock: create helper for pvclock data retrievalarch/x86/include/asm/pvclock.h arch/x86/kernel/pvclock.c+30 -141 reply
5/18x86: pvclock: create helper for pvclock data retrievalarch/x86/include/asm/pvclock.h arch/x86/kernel/pvclock.c+30 -140 replies
6/18x86: pvclock: introduce helper to read flagsarch/x86/include/asm/pvclock.h arch/x86/kernel/pvclock.c+14 -01 reply
6/18x86: pvclock: introduce helper to read flagsarch/x86/include/asm/pvclock.h arch/x86/kernel/pvclock.c+14 -00 replies
7/18x86: pvclock: add note about rdtsc barriersarch/x86/include/asm/pvclock.h+3 -01 reply
7/18x86: pvclock: add note about rdtsc barriers (v2)arch/x86/include/asm/pvclock.h+6 -00 replies
7/18x86: pvclock: add note about rdtsc barriersarch/x86/include/asm/pvclock.h+6 -00 replies
8/18sched: add notifier for cross-cpu migrationsinclude/linux/sched.h kernel/sched/core.c+23 -01 reply
8/18sched: add notifier for cross-cpu migrationsinclude/linux/sched.h kernel/sched/core.c+23 -00 replies
9/18x86: pvclock: generic pvclock vsyscall initializationarch/x86/include/asm/clocksource.h arch/x86/include/asm/fixmap.h arch/x86/include/asm/pvclock.h +1 more+87 -00 replies
9/18x86: pvclock: generic pvclock vsyscall initializationarch/x86/include/asm/clocksource.h arch/x86/include/asm/fixmap.h arch/x86/include/asm/pvclock.h +1 more+87 -00 replies
10/18x86: kvm guest: pvclock vsyscall supportarch/x86/include/asm/kvm_guest.h arch/x86/kernel/kvm.c arch/x86/kernel/kvmclock.c+59 -110 replies
11/18x86: vdso: pvclock gettime supportarch/x86/include/asm/vsyscall.h arch/x86/vdso/vclock_gettime.c arch/x86/vdso/vgetcpu.c+96 -110 replies
11/18x86: vdso: pvclock gettime supportarch/x86/include/asm/vsyscall.h arch/x86/vdso/vclock_gettime.c arch/x86/vdso/vgetcpu.c+96 -110 replies
12/18KVM: x86: pass host_tsc to read_l1_tscarch/x86/include/asm/kvm_host.h arch/x86/kvm/lapic.c arch/x86/kvm/svm.c +2 more+9 -90 replies
12/18KVM: x86: pass host_tsc to read_l1_tscarch/x86/include/asm/kvm_host.h arch/x86/kvm/lapic.c arch/x86/kvm/svm.c +2 more+9 -90 replies
13/18time: export time information for KVM pvclockinclude/linux/pvclock_gtod.h kernel/time/timekeeping.c+59 -01 reply
13/18time: export time information for KVM pvclockinclude/linux/pvclock_gtod.h kernel/time/timekeeping.c+59 -00 replies
14/18KVM: x86: notifier for clocksource changesarch/x86/kvm/x86.c+85 -10 replies
14/18KVM: x86: notifier for clocksource changesarch/x86/kvm/x86.c+85 -10 replies
15/18KVM: x86: implement PVCLOCK_TSC_STABLE_BIT pvclock flagarch/x86/include/asm/kvm_host.h arch/x86/kvm/trace.h arch/x86/kvm/x86.c +2 more+260 -80 replies
15/18KVM: x86: implement PVCLOCK_TSC_STABLE_BIT pvclock flagarch/x86/include/asm/kvm_host.h arch/x86/kvm/trace.h arch/x86/kvm/x86.c +2 more+260 -80 replies
16/18KVM: x86: add kvm_arch_vcpu_postcreate callback, move TSC initializationarch/ia64/kvm/kvm-ia64.c arch/powerpc/kvm/powerpc.c arch/s390/kvm/kvm-s390.c +5 more+30 -30 replies
16/18KVM: x86: add kvm_arch_vcpu_postcreate callback, move TSC initializationarch/ia64/kvm/kvm-ia64.c arch/powerpc/kvm/powerpc.c arch/s390/kvm/kvm-s390.c +5 more+30 -30 replies
17/18KVM: x86: require matched TSC offsets for master clockarch/x86/include/asm/kvm_host.h arch/x86/kvm/trace.h arch/x86/kvm/x86.c+87 -80 replies
17/18KVM: x86: require matched TSC offsets for master clockarch/x86/include/asm/kvm_host.h arch/x86/kvm/trace.h arch/x86/kvm/x86.c+87 -80 replies
18/18KVM: x86: update pvclock area conditionally, on cpu migrationarch/x86/kvm/x86.c+6 -11 reply
18/18KVM: x86: update pvclock area conditionally, on cpu migrationarch/x86/kvm/x86.c+6 -11 reply

Reviews trailers per patch

15 of 37 patches have a Reviewed-by or Acked-by.

PatchGlauber CostaGleb NatapovJohn Stultz
1/18R-b R-b R-b R-b
1/18R-b R-b R-b R-b
2/18A-b A-b A-b
2/18A-b A-b A-b
2/18A-b A-b A-b
3/18
3/18
4/18R-b R-b
4/18R-b R-b
5/18A-b A-b
5/18A-b A-b
6/18A-b A-b
6/18A-b A-b
7/18
7/18
7/18
8/18
8/18
9/18
9/18
10/18
11/18
11/18
12/18
12/18
13/18A-b A-b
13/18A-b A-b
14/18
14/18
15/18
15/18
16/18
16/18
17/18
17/18
18/18A-b A-b
18/18A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [patch 00/18] pvclock vsyscall support + KVM hypervisor support (v4)

This patchset, based on earlier work by Jeremy Fitzhardinge, implements paravirtual clock vsyscall support.

It should be possible to implement Xen support relatively easily.

It reduces clock_gettime from 500 cycles to 200 cycles on my testbox.

Please review.

v4:
- remove aligned_pvti structure, align directly (Glauber)
- add comments to migration notifier (Glauber)
- mark migration notifier condition as unlikely (Glauber)
- add comment about rdtsc barrier dependency on sse2 (Gleb)
- add idea to improve vdso gettime call (Gleb)
- remove new msr interface, reuse kernel copy of pvclock data (Glauber)
- move copying of timekeeping data from generic timekeeping code to kvm code (John)

v3:
- fix PVCLOCK_VSYSCALL_NR_PAGES definition (glommer)
- fold flags race fix into pvclock refactoring (avi)
- remove CONFIG_PARAVIRT_CLOCK_VSYSCALL (glommer)
- add reference to tsc.c from vclock_gettime.c about cycle_last rationale (glommer)
- fix whitespace damage (glommer)

v2:
- Do not allow visibility of different <system_timestamp, tsc_timestamp> tuples.
- Add option to disable vsyscall.