mbox series

[0/3] KVM: VMX: handle preemption timer value of zero

Message ID 20180827222112.6640-1-sean.j.christopherson@intel.com (mailing list archive)
Headers show
Series KVM: VMX: handle preemption timer value of zero | expand

Message

Sean Christopherson Aug. 27, 2018, 10:21 p.m. UTC
A VMX preemption timer value of '0' at the time of VMEnter is
architecturally guaranteed to cause a VMExit prior to the CPU
executing any instructions in the guest.  KVM serendipitously
emulates this behavior when running as L0, but doesn't ensure
correct emulation when running at L1 or higher.  Explicitly
emulate the architectural behavior of a timer value of '0'.

Sean Christopherson (3):
  KVM: VMX: immediately mark preemption timer expired only for zero
    value
  KVM: VMX: modify preemption timer bit only when arming timer
  KVM: VMX: use preemption timer to force immediate VMExit

 arch/x86/include/asm/kvm_host.h |  1 +
 arch/x86/kvm/vmx.c              | 77 ++++++++++++++++++++-------------
 arch/x86/kvm/x86.c              |  5 ++-
 3 files changed, 51 insertions(+), 32 deletions(-)