Skip to content

Pin the hrtimer used for VMX-preemption timer emulation

Jim Mattson kvm 1 version Applied

Status from this message: Queued all, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 5 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3KVM: nVMX: Really make emulated nested preemption timer pinnedarch/x86/kvm/vmx/nested.c+1 -11 reply
2/3KVM: nVMX: Change emulated VMX-preemption timer hrtimer to absolutearch/x86/kvm/vmx/nested.c+3 -20 replies
3/3KVM: nVMX: Migrate the VMX-preemption timerarch/x86/include/asm/kvm_host.h arch/x86/kvm/irq.c arch/x86/kvm/vmx/vmx.c+15 -01 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchPeter ShierOliver Upton
1/3R-b R-b
2/3R-b R-b
3/3R-b R-b

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

Read the v1 thread

Cover letter [PATCH 0/3] Pin the hrtimer used for VMX-preemption timer emulation

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(-)
Signature · 1 line
2.26.2.645.ge9eca65c58-goog