1. 27 5月, 2016 1 次提交
    • G
      PPC/KVM: early validation of vcpu id · 41264b38
      Greg Kurz 提交于
      The KVM API restricts vcpu ids to be < KVM_CAP_MAX_VCPUS. On PowerPC
      targets, depending on the number of threads per core in the host and
      in the guest, some topologies do generate higher vcpu ids actually.
      When this happens, QEMU bails out with the following error:
      
      kvm_init_vcpu failed: Invalid argument
      
      The KVM_CREATE_VCPU ioctl has several EINVAL return paths, so it is
      not possible to fully disambiguate.
      
      This patch adds a check in the code that computes vcpu ids, so that
      we can detect the error earlier, and print a friendlier message instead
      of calling KVM_CREATE_VCPU with an obviously bogus vcpu id.
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      41264b38
  2. 18 5月, 2016 1 次提交
  3. 31 3月, 2016 1 次提交
  4. 07 3月, 2016 2 次提交
  5. 09 2月, 2016 1 次提交
  6. 05 2月, 2016 1 次提交
    • P
      all: Clean up includes · d38ea87a
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-16-git-send-email-peter.maydell@linaro.org
      d38ea87a
  7. 13 1月, 2016 1 次提交
  8. 18 12月, 2015 1 次提交
    • P
      kvm: x86: add support for KVM_CAP_SPLIT_IRQCHIP · 15eafc2e
      Paolo Bonzini 提交于
      This patch adds support for split IRQ chip mode. When
      KVM_CAP_SPLIT_IRQCHIP is enabled:
      
          1.) The PIC, PIT, and IOAPIC are implemented in userspace while
          the LAPIC is implemented by KVM.
      
          2.) The software IOAPIC delivers interrupts to the KVM LAPIC via
          kvm_set_irq. Interrupt delivery is configured via the MSI routing
          table, for which routes are reserved in target-i386/kvm.c then
          configured in hw/intc/ioapic.c
      
          3.) KVM delivers IOAPIC EOIs via a new exit KVM_EXIT_IOAPIC_EOI,
          which is handled in target-i386/kvm.c and relayed to the software
          IOAPIC via ioapic_eoi_broadcast.
      Signed-off-by: NMatt Gingell <gingell@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      15eafc2e
  9. 17 12月, 2015 3 次提交
  10. 12 11月, 2015 1 次提交
  11. 10 11月, 2015 1 次提交
  12. 05 11月, 2015 1 次提交
  13. 19 10月, 2015 3 次提交
  14. 13 10月, 2015 1 次提交
  15. 24 9月, 2015 1 次提交
    • P
      intc/gic: Extract some reusable vGIC code · 4b3cfe72
      Pavel Fedin 提交于
      Some functions previously used only by vGICv2 are useful also for vGICv3
      implementation. Untie them from GICState and make accessible from within
      other modules:
      - kvm_arm_gic_set_irq()
      - kvm_gic_supports_attr() - moved to common code and renamed to
        kvm_device_check_attr()
      - kvm_gic_access() - turned into GIC-independent kvm_device_access().
        Data pointer changed to void * because some GICv3 registers are
        64-bit wide
      
      Some of these changes are not used right now, but they will be helpful for
      implementing live migration.
      
      Actually kvm_dist_get() and kvm_dist_put() could also be made reusable, but
      they would require two extra parameters (s->dev_fd and s->num_cpu) as well as
      lots of typecasts of 's' to DeviceState * and back to GICState *. This makes
      the code very ugly so i decided to stop at this point. I tried also an
      approach with making a base class for all possible GICs, but it would contain
      only three variables (dev_fd, cpu_num and irq_num), and accessing them through
      the rest of the code would be again tedious (either ugly casts or qemu-style
      separate object pointer). So i disliked it too.
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Tested-by: NAshok kumar <ashoks@broadcom.com>
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 2ef56d1dd64ffb75ed02a10dcdaf605e5b8ff4f8.1441784344.git.p.fedin@samsung.com
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      4b3cfe72
  16. 16 9月, 2015 1 次提交
  17. 07 9月, 2015 1 次提交
  18. 07 7月, 2015 2 次提交
  19. 06 7月, 2015 6 次提交
  20. 01 7月, 2015 4 次提交
    • P
      kvm: Switch to unlocked MMIO · de7ea885
      Paolo Bonzini 提交于
      Do not take the BQL before dispatching MMIO requests of KVM VCPUs.
      Instead, address_space_rw will do it if necessary. This enables completely
      BQL-free MMIO handling in KVM mode for upcoming devices with fine-grained
      locking.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1434646046-27150-10-git-send-email-pbonzini@redhat.com>
      de7ea885
    • J
      kvm: Switch to unlocked PIO · 80b7d2ef
      Jan Kiszka 提交于
      Do not take the BQL before dispatching PIO requests of KVM VCPUs.
      Instead, address_space_rw will do it if necessary. This enables
      completely BQL-free PIO handling in KVM mode for upcoming devices with
      fine-grained locking.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1434646046-27150-8-git-send-email-pbonzini@redhat.com>
      80b7d2ef
    • J
      kvm: First step to push iothread lock out of inner run loop · 4b8523ee
      Jan Kiszka 提交于
      This opens the path to get rid of the iothread lock on vmexits in KVM
      mode. On x86, the in-kernel irqchips has to be used because we otherwise
      need to synchronize APIC and other per-cpu state accesses that could be
      changed concurrently.
      
      Regarding pre/post-run callbacks, s390x and ARM should be fine without
      specific locking as the callbacks are empty. MIPS and POWER require
      locking for the pre-run callback.
      
      For the handle_exit callback, it is non-empty in x86, POWER and s390.
      Some POWER cases could do without the locking, but it is left in
      place for now.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1434646046-27150-7-git-send-email-pbonzini@redhat.com>
      4b8523ee
    • Fix irq route entries exceeding KVM_MAX_IRQ_ROUTES · bdf02631
      马文霜 提交于
      Last month, we experienced several guests crash(6cores-8cores), qemu logs
      display the following messages:
      
      qemu-system-x86_64: /build/qemu-2.1.2/kvm-all.c:976:
      kvm_irqchip_commit_routes: Assertion `ret == 0' failed.
      
      After analysis and verification, we can confirm it's irq-balance
      daemon(in guest) leads to the assertion failure. Start a 8 core guest with
      two disks, execute the following scripts will reproduce the BUG quickly:
      
      irq_affinity.sh
      ========================================================================
      
      vda_irq_num=25
      vdb_irq_num=27
      while [ 1 ]
      do
          for irq in {1,2,4,8,10,20,40,80}
              do
                  echo $irq > /proc/irq/$vda_irq_num/smp_affinity
                  echo $irq > /proc/irq/$vdb_irq_num/smp_affinity
                  dd if=/dev/vda of=/dev/zero bs=4K count=100 iflag=direct
                  dd if=/dev/vdb of=/dev/zero bs=4K count=100 iflag=direct
              done
      done
      ========================================================================
      
      QEMU setup static irq route entries in kvm_pc_setup_irq_routing(), PIC and
      IOAPIC share the first 15 GSI numbers, take up 23 GSI numbers, but take up
      38 irq route entries. When change irq smp_affinity in guest, a dynamic route
      entry may be setup, the current logic is: if allocate GSI number succeeds,
      a new route entry can be added. The available dynamic GSI numbers is
      1021(KVM_MAX_IRQ_ROUTES-23), but available irq route entries is only
      986(KVM_MAX_IRQ_ROUTES-38), GSI numbers greater than route entries.
      irq-balance's behavior will eventually leads to total irq route entries
      exceed KVM_MAX_IRQ_ROUTES, ioctl(KVM_SET_GSI_ROUTING) fail and
      kvm_irqchip_commit_routes() trigger assertion failure.
      
      This patch fix the BUG.
      Signed-off-by: NWenshuang Ma <kevinnma@tencent.com>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      bdf02631
  21. 05 6月, 2015 5 次提交
  22. 02 6月, 2015 1 次提交