public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Pin the hrtimer used for VMX-preemption timer emulation
@ 2020-05-08 20:36 Jim Mattson
  2020-05-08 20:36 ` [PATCH 1/3] KVM: nVMX: Really make emulated nested preemption timer pinned Jim Mattson
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Jim Mattson @ 2020-05-08 20:36 UTC (permalink / raw)
  To: kvm, Paolo Bonzini; +Cc: Jim Mattson

I'm still not entirely convinced that the Linux hrtimer can be used to
accurately emulate the VMX-preemption timer, but it definitely doesn't
work if the hrtimer is on a different logical processor from the vCPU
thread that needs to get kicked out of VMX non-root operation.

With these changes, the kvm-unit-test (sent separately) that verifies
that a guest can't actually observe a delayed VMX-preemption timer
VM-exit passes 99.999% of the time on a 2GHz Skylake system.

It might be possible to improve that pass rate even more by increasing
the scaling factor in the virtual IA32_VMX_MISC[4:0], but you'd have
to be even more of a stickler than I to go to that extreme.

By the way, what is the point of migrating the hrtimers for the APIC
and the PIT, since they aren't even pinned to begin with?

The subject line of the first patch was crafted for you, Sean. :-D

Jim Mattson (3):
  KVM: nVMX: Really make emulated nested preemption timer pinned
  KVM: nVMX: Change emulated VMX-preemption timer hrtimer to absolute
  KVM: nVMX: Migrate the VMX-preemption timer

 arch/x86/include/asm/kvm_host.h |  2 ++
 arch/x86/kvm/irq.c              |  2 ++
 arch/x86/kvm/vmx/nested.c       |  5 +++--
 arch/x86/kvm/vmx/vmx.c          | 11 +++++++++++
 4 files changed, 18 insertions(+), 2 deletions(-)

-- 
2.26.2.645.ge9eca65c58-goog


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

end of thread, other threads:[~2020-06-19 22:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-08 20:36 [PATCH 0/3] Pin the hrtimer used for VMX-preemption timer emulation Jim Mattson
2020-05-08 20:36 ` [PATCH 1/3] KVM: nVMX: Really make emulated nested preemption timer pinned Jim Mattson
2020-05-08 22:16   ` Sean Christopherson
2020-05-08 20:36 ` [PATCH 2/3] KVM: nVMX: Change emulated VMX-preemption timer hrtimer to absolute Jim Mattson
2020-05-08 20:36 ` [PATCH 3/3] KVM: nVMX: Migrate the VMX-preemption timer Jim Mattson
2020-05-09 13:17   ` Paolo Bonzini
2020-05-09 13:14 ` [PATCH 0/3] Pin the hrtimer used for VMX-preemption timer emulation Paolo Bonzini
2020-06-19 18:49 ` Jim Mattson
2020-06-19 22:52   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox