Skip to content

x86/kvm/hyperv: stable clocksource for L2 guests when running nested KVM on Hyper-V

Vitaly Kuznetsov kvm lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 5 repliesIn review
  2. v37 patches 11 repliesSuperseded
  3. v27 patches 9 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches9 repliesSuperseded

Changes in v4 from the cover letter

- PATCH3:
- drop 'include <linux/interrupt.h>' (and __visible/_irq_entry from hyperv_reenlightenment_intr declaration -- but not from implementation) from mshyperv.h [kbuild robot] I'm retaining Thomas' Reviewed-by tag as the change is small, hope that's OK.
- PATCH7:
- add static to kvm_hyperv_tsc_notifier() [kbuild robot]. I'm also keeping Paolo's Acked-by as the change is trivial.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7x86/hyper-v: check for required priviliges in hyperv_init()arch/x86/hyperv/hv_init.c+8 -10 replies
2/7x86/hyper-v: add a function to read both TSC and TSC page value simulateneouslyarch/x86/hyperv/hv_init.c arch/x86/include/asm/mshyperv.h+20 -40 replies
3/7x86/hyper-v: reenlightenment notifications supportarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/hyperv/hv_init.c +4 more+143 -10 replies
4/7x86/hyper-v: redirect reenlightment notifications on CPU offliningarch/x86/hyperv/hv_init.c+21 -10 replies
5/7x86/irq: Count Hyper-V reenlightenment interruptsarch/x86/hyperv/hv_init.c arch/x86/include/asm/hardirq.h arch/x86/kernel/irq.c+14 -05 replies
6/7x86/kvm: pass stable clocksource to guests when running nested on Hyper-Varch/x86/kvm/x86.c+68 -250 replies
7/7x86/kvm: support Hyper-V reenlightenmentarch/x86/kvm/x86.c+45 -00 replies

Reviews trailers per patch

6 of 7 patches have a Reviewed-by or Acked-by.

PatchThomas GleixnerPaolo Bonzini
1/7R-b
2/7
3/7R-b
4/7R-b
5/7R-b
6/7A-b
7/7A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/7] x86/kvm/hyperv: stable clocksource for L2 guests when running nested KVM on Hyper-V

Changes since v3:
- PATCH3:
- drop 'include <linux/interrupt.h>' (and __visible/_irq_entry from hyperv_reenlightenment_intr declaration -- but not from implementation) from mshyperv.h [kbuild robot] I'm retaining Thomas' Reviewed-by tag as the change is small, hope that's OK.
- PATCH7:
- add static to kvm_hyperv_tsc_notifier() [kbuild robot]. I'm also keeping Paolo's Acked-by as the change is trivial.

So currently only PATCH2 of the series doesn't have a Reviewed-by/ Acked-by tag.

Original description:

Currently, KVM passes PVCLOCK_TSC_STABLE_BIT to its guests when running in so called 'masterclock' mode and this is only possible when the clocksource on the host is TSC. When running nested on Hyper-V we're using a different clocksource in L1 (Hyper-V TSC Page) which can actually be used for masterclock. This series brings the required support.

Making KVM work with TSC page clocksource is relatively easy, it is done in PATCH 6 of the series. All the rest is required to support L1 migration when TSC frequency changes, we use a special feature from Hyper-V to do the job.

Vitaly Kuznetsov (7):
x86/hyper-v: check for required priviliges in hyperv_init() x86/hyper-v: add a function to read both TSC and TSC page value
simulateneously
x86/hyper-v: reenlightenment notifications support x86/hyper-v: redirect reenlightment notifications on CPU offlining x86/irq: Count Hyper-V reenlightenment interrupts x86/kvm: pass stable clocksource to guests when running nested on
Hyper-V
x86/kvm: support Hyper-V reenlightenment

 arch/x86/entry/entry_32.S          |   3 +
 arch/x86/entry/entry_64.S          |   3 +
 arch/x86/hyperv/hv_init.c          | 123 ++++++++++++++++++++++++++++++++-
 arch/x86/include/asm/hardirq.h     |   3 +
 arch/x86/include/asm/irq_vectors.h |   7 +-
 arch/x86/include/asm/mshyperv.h    |  32 +++++++--
 arch/x86/include/uapi/asm/hyperv.h |  27 ++++++++
 arch/x86/kernel/cpu/mshyperv.c     |   6 ++
 arch/x86/kernel/irq.c              |   9 +++
 arch/x86/kvm/x86.c                 | 138 ++++++++++++++++++++++++++++++-------
 10 files changed, 319 insertions(+), 32 deletions(-)
Signature · 1 line
2.14.3