All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/7] kvm pvtimer
@ 2017-12-08  8:39 Quan Xu
  2017-12-08  8:39 ` [PATCH RFC 1/7] kvm: x86: emulate MSR_KVM_PV_TIMER_EN MSR Quan Xu
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Quan Xu @ 2017-12-08  8:39 UTC (permalink / raw)
  To: pbonzini, rkrcmar; +Cc: yang.zhang.wz, kvm, linux-kernel, Ben Luo

From: Ben Luo <bn0418@gmail.com>

This patchset introduces a new paravirtualized mechanism to reduce VM-exit
caused by guest timer accessing.

In general, KVM guest programs tsc-deadline timestamp to MSR_IA32_TSC_DEADLINE
MSR. This will cause a VM-exit, and then KVM handles this timer for guest.

Also kvm always registers timer on the CPU which vCPU was running on. Even
though vCPU thread is rescheduled to another CPU, the timer will be migrated
to the target CPU as well. When timer expired, timer interrupt could make
guest-mode vCPU VM-exit on this CPU.

When pvtimer is enabled:

   - The tsc-deadline timestamp is mostly recorded in share page with less
     VM-exit. We Introduce a periodically working kthread to scan share page
     and synchronize timer setting for guest on a dedicated CPU.

   - Since the working kthread scans periodically, some of the timer events
     may be lost or delayed. We have to program these tsc-deadline timestamps
     to MSR_IA32_TSC_DEADLINE as normal, which will cause VM-exit and KVM will
     signal the working thread through IPI to program timer, instread of
     registering on current CPU.

   - Timer interrupt will be delivered by posted interrupt mechanism to vCPUs
     with less VM-exit.

Ben Luo (7):
  kvm: x86: emulate MSR_KVM_PV_TIMER_EN MSR
  kvm: x86: add a function to exchange value
  KVM: timer: synchronize tsc-deadline timestamp for guest
  KVM: timer: program timer to a dedicated CPU
  KVM: timer: ignore timer migration if pvtimer is enabled
  Doc/KVM: introduce a new cpuid bit for kvm pvtimer
  kvm: guest: reprogram guest timer

 Documentation/virtual/kvm/cpuid.txt  |    4 +
 arch/x86/include/asm/kvm_host.h      |    5 +
 arch/x86/include/asm/kvm_para.h      |    9 ++
 arch/x86/include/uapi/asm/kvm_para.h |    7 ++
 arch/x86/kernel/apic/apic.c          |    9 +-
 arch/x86/kernel/kvm.c                |   38 ++++++++
 arch/x86/kvm/cpuid.c                 |    1 +
 arch/x86/kvm/lapic.c                 |  170 +++++++++++++++++++++++++++++++++-
 arch/x86/kvm/lapic.h                 |   11 ++
 arch/x86/kvm/x86.c                   |   15 +++-
 include/linux/kvm_host.h             |    3 +
 virt/kvm/kvm_main.c                  |   42 +++++++++
 12 files changed, 308 insertions(+), 6 deletions(-)

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-12-14 13:01 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08  8:39 [PATCH RFC 0/7] kvm pvtimer Quan Xu
2017-12-08  8:39 ` [PATCH RFC 1/7] kvm: x86: emulate MSR_KVM_PV_TIMER_EN MSR Quan Xu
2017-12-08  8:39 ` [PATCH RFC 2/7] kvm: x86: add a function to exchange value Quan Xu
2017-12-08  8:39 ` [PATCH RFC 3/7] KVM: timer: synchronize tsc-deadline timestamp for guest Quan Xu
2017-12-08 15:06   ` Konrad Rzeszutek Wilk
2017-12-14  1:54     ` Quan Xu
2017-12-08  8:39 ` [PATCH RFC 4/7] KVM: timer: program timer to a dedicated CPU Quan Xu
2017-12-08  8:39 ` [PATCH RFC 5/7] KVM: timer: ignore timer migration if pvtimer is enabled Quan Xu
2017-12-08  8:39 ` [PATCH RFC 6/7] Doc/KVM: introduce a new cpuid bit for kvm pvtimer Quan Xu
2017-12-08  8:39 ` [PATCH RFC 7/7] kvm: guest: reprogram guest timer Quan Xu
2017-12-08 15:10 ` [PATCH RFC 0/7] kvm pvtimer Konrad Rzeszutek Wilk
     [not found]   ` <CAFv8KnF1Re7Zn2LVvqh=Sr8MmaWJJwZBB1i5ws03GvPVKXRjzA@mail.gmail.com>
2017-12-13 16:28     ` Konrad Rzeszutek Wilk
2017-12-14  2:32       ` Quan Xu
2017-12-14 11:56       ` Paolo Bonzini
2017-12-14 12:06         ` Quan Xu
2017-12-14 13:00           ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.