1. 21 Jun, 2016 10 commits
  2. 20 Jun, 2016 26 commits
  3. 16 Jun, 2016 4 commits
    • Yunhong Jiang's avatar
      kvm: vmx: hook preemption timer support · 64672c95
      Yunhong Jiang authored
      Hook the VMX preemption timer to the "hv timer" functionality added
      by the previous patch.  This includes: checking if the feature is
      supported, if the feature is broken on the CPU, the hooks to
      setup/clean the VMX preemption timer, arming the timer on vmentry
      and handling the vmexit.
      
      A module parameter states if the VMX preemption timer should be
      utilized.
      Signed-off-by: default avatarYunhong Jiang <yunhong.jiang@intel.com>
      [Move hv_deadline_tsc to struct vcpu_vmx, use -1 as the "unset" value.
       Put all VMX bits here.  Enable it by default #yolo. - Paolo]
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      64672c95
    • Yunhong Jiang's avatar
      kvm: vmx: rename vmx_pre/post_block to pi_pre/post_block · bc22512b
      Yunhong Jiang authored
      Prepare to switch from preemption timer to hrtimer in the
      vmx_pre/post_block. Current functions are only for posted interrupt,
      rename them accordingly.
      Signed-off-by: default avatarYunhong Jiang <yunhong.jiang@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      bc22512b
    • Yunhong Jiang's avatar
      KVM: x86: support using the vmx preemption timer for tsc deadline timer · ce7a058a
      Yunhong Jiang authored
      The VMX preemption timer can be used to virtualize the TSC deadline timer.
      The VMX preemption timer is armed when the vCPU is running, and a VMExit
      will happen if the virtual TSC deadline timer expires.
      
      When the vCPU thread is blocked because of HLT, KVM will switch to use
      an hrtimer, and then go back to the VMX preemption timer when the vCPU
      thread is unblocked.
      
      This solution avoids the complex OS's hrtimer system, and the host
      timer interrupt handling cost, replacing them with a little math
      (for guest->host TSC and host TSC->preemption timer conversion)
      and a cheaper VMexit.  This benefits latency for isolated pCPUs.
      
      [A word about performance... Yunhong reported a 30% reduction in average
       latency from cyclictest.  I made a similar test with tscdeadline_latency
       from kvm-unit-tests, and measured
      
       - ~20 clock cycles loss (out of ~3200, so less than 1% but still
         statistically significant) in the worst case where the test halts
         just after programming the TSC deadline timer
      
       - ~800 clock cycles gain (25% reduction in latency) in the best case
         where the test busy waits.
      
       I removed the VMX bits from Yunhong's patch, to concentrate them in the
       next patch - Paolo]
      Signed-off-by: default avatarYunhong Jiang <yunhong.jiang@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ce7a058a
    • Yunhong Jiang's avatar
      kvm: lapic: separate start_sw_tscdeadline from start_apic_timer · 53f9eedf
      Yunhong Jiang authored
      The function to start the tsc deadline timer virtualization will be used
      also by the pre_block hook when we use the preemption timer; change it
      to a separate function. No logic changes.
      Signed-off-by: default avatarYunhong Jiang <yunhong.jiang@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      53f9eedf