1. 01 10月, 2015 8 次提交
    • F
      KVM: Define a new interface kvm_intr_is_single_vcpu() · 8feb4a04
      Feng Wu 提交于
      This patch defines a new interface kvm_intr_is_single_vcpu(),
      which can returns whether the interrupt is for single-CPU or not.
      
      It is used by VT-d PI, since now we only support single-CPU
      interrupts, For lowest-priority interrupts, if user configures
      it via /proc/irq or uses irqbalance to make it single-CPU, we
      can use PI to deliver the interrupts to it. Full functionality
      of lowest-priority support will be added later.
      Signed-off-by: NFeng Wu <feng.wu@intel.com>
      Reviewed-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8feb4a04
    • A
      kvm/x86: Hyper-V HV_X64_MSR_VP_RUNTIME support · 9eec50b8
      Andrey Smetanin 提交于
      HV_X64_MSR_VP_RUNTIME msr used by guest to get
      "the time the virtual processor consumes running guest code,
      and the time the associated logical processor spends running
      hypervisor code on behalf of that guest."
      
      Calculation of this time is performed by task_cputime_adjusted()
      for vcpu task.
      
      Necessary to support loading of winhv.sys in guest, which in turn is
      required to support Windows VMBus.
      Signed-off-by: NAndrey Smetanin <asmetanin@virtuozzo.com>
      Reviewed-by: NRoman Kagan <rkagan@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Gleb Natapov <gleb@kernel.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9eec50b8
    • S
      KVM: x86: Add support for local interrupt requests from userspace · 1c1a9ce9
      Steve Rutherford 提交于
      In order to enable userspace PIC support, the userspace PIC needs to
      be able to inject local interrupts even when the APICs are in the
      kernel.
      
      KVM_INTERRUPT now supports sending local interrupts to an APIC when
      APICs are in the kernel.
      
      The ready_for_interrupt_request flag is now only set when the CPU/APIC
      will immediately accept and inject an interrupt (i.e. APIC has not
      masked the PIC).
      
      When the PIC wishes to initiate an INTA cycle with, say, CPU0, it
      kicks CPU0 out of the guest, and renedezvous with CPU0 once it arrives
      in userspace.
      
      When the CPU/APIC unmasks the PIC, a KVM_EXIT_IRQ_WINDOW_OPEN is
      triggered, so that userspace has a chance to inject a PIC interrupt
      if it had been pending.
      
      Overall, this design can lead to a small number of spurious userspace
      renedezvous. In particular, whenever the PIC transistions from low to
      high while it is masked and whenever the PIC becomes unmasked while
      it is low.
      
      Note: this does not buffer more than one local interrupt in the
      kernel, so the VMM needs to enter the guest in order to complete
      interrupt injection before injecting an additional interrupt.
      
      Compiles for x86.
      
      Can pass the KVM Unit Tests.
      Signed-off-by: NSteve Rutherford <srutherford@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      1c1a9ce9
    • S
      KVM: x86: Add EOI exit bitmap inference · b053b2ae
      Steve Rutherford 提交于
      In order to support a userspace IOAPIC interacting with an in kernel
      APIC, the EOI exit bitmaps need to be configurable.
      
      If the IOAPIC is in userspace (i.e. the irqchip has been split), the
      EOI exit bitmaps will be set whenever the GSI Routes are configured.
      In particular, for the low MSI routes are reservable for userspace
      IOAPICs. For these MSI routes, the EOI Exit bit corresponding to the
      destination vector of the route will be set for the destination VCPU.
      
      The intention is for the userspace IOAPICs to use the reservable MSI
      routes to inject interrupts into the guest.
      
      This is a slight abuse of the notion of an MSI Route, given that MSIs
      classically bypass the IOAPIC. It might be worthwhile to add an
      additional route type to improve clarity.
      
      Compile tested for Intel x86.
      Signed-off-by: NSteve Rutherford <srutherford@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b053b2ae
    • S
      KVM: x86: Add KVM exit for IOAPIC EOIs · 7543a635
      Steve Rutherford 提交于
      Adds KVM_EXIT_IOAPIC_EOI which allows the kernel to EOI
      level-triggered IOAPIC interrupts.
      
      Uses a per VCPU exit bitmap to decide whether or not the IOAPIC needs
      to be informed (which is identical to the EOI_EXIT_BITMAP field used
      by modern x86 processors, but can also be used to elide kvm IOAPIC EOI
      exits on older processors).
      
      [Note: A prototype using ResampleFDs found that decoupling the EOI
      from the VCPU's thread made it possible for the VCPU to not see a
      recent EOI after reentering the guest. This does not match real
      hardware.]
      
      Compile tested for Intel x86.
      Signed-off-by: NSteve Rutherford <srutherford@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7543a635
    • S
      KVM: x86: Split the APIC from the rest of IRQCHIP. · 49df6397
      Steve Rutherford 提交于
      First patch in a series which enables the relocation of the
      PIC/IOAPIC to userspace.
      
      Adds capability KVM_CAP_SPLIT_IRQCHIP;
      
      KVM_CAP_SPLIT_IRQCHIP enables the construction of LAPICs without the
      rest of the irqchip.
      
      Compile tested for x86.
      Signed-off-by: NSteve Rutherford <srutherford@google.com>
      Suggested-by: NAndrew Honig <ahonig@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      49df6397
    • P
      KVM: x86: replace vm_has_apicv hook with cpu_uses_apicv · d50ab6c1
      Paolo Bonzini 提交于
      This will avoid an unnecessary trip to ->kvm and from there to the VPIC.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d50ab6c1
    • P
      KVM: x86: store IOAPIC-handled vectors in each VCPU · 3bb345f3
      Paolo Bonzini 提交于
      We can reuse the algorithm that computes the EOI exit bitmap to figure
      out which vectors are handled by the IOAPIC.  The only difference
      between the two is for edge-triggered interrupts other than IRQ8
      that have no notifiers active; however, the IOAPIC does not have to
      do anything special for these interrupts anyway.
      
      This again limits the interactions between the IOAPIC and the LAPIC,
      making it easier to move the former to userspace.
      
      Inspired by a patch from Steve Rutherford.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3bb345f3
  2. 25 9月, 2015 1 次提交
  3. 16 9月, 2015 1 次提交
    • P
      KVM: add halt_attempted_poll to VCPU stats · 62bea5bf
      Paolo Bonzini 提交于
      This new statistic can help diagnosing VCPUs that, for any reason,
      trigger bad behavior of halt_poll_ns autotuning.
      
      For example, say halt_poll_ns = 480000, and wakeups are spaced exactly
      like 479us, 481us, 479us, 481us. Then KVM always fails polling and wastes
      10+20+40+80+160+320+480 = 1110 microseconds out of every
      479+481+479+481+479+481+479 = 3359 microseconds. The VCPU then
      is consuming about 30% more CPU than it would use without
      polling.  This would show as an abnormally high number of
      attempted polling compared to the successful polls.
      
      Acked-by: Christian Borntraeger <borntraeger@de.ibm.com<
      Reviewed-by: NDavid Matlack <dmatlack@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      62bea5bf
  4. 05 8月, 2015 2 次提交
  5. 29 7月, 2015 1 次提交
  6. 23 7月, 2015 2 次提交
  7. 10 7月, 2015 1 次提交
  8. 04 7月, 2015 1 次提交
  9. 23 6月, 2015 1 次提交
  10. 19 6月, 2015 8 次提交
  11. 05 6月, 2015 4 次提交
  12. 04 6月, 2015 3 次提交
  13. 28 5月, 2015 1 次提交
  14. 20 5月, 2015 3 次提交
  15. 19 5月, 2015 1 次提交
    • I
      x86/fpu, kvm: Simplify fx_init() · 0ee6a517
      Ingo Molnar 提交于
      Now that fpstate_init() cannot fail the error return of fx_init()
      has lost its purpose. Eliminate the error return and propagate this
      change to all callers.
      Reviewed-by: NBorislav Petkov <bp@alien8.de>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      0ee6a517
  16. 11 5月, 2015 1 次提交
  17. 07 5月, 2015 1 次提交