1. 01 7月, 2015 3 次提交
    • 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
  2. 05 6月, 2015 5 次提交
  3. 02 6月, 2015 1 次提交
  4. 30 4月, 2015 4 次提交
  5. 28 4月, 2015 1 次提交
  6. 26 4月, 2015 1 次提交
  7. 02 4月, 2015 1 次提交
  8. 18 3月, 2015 1 次提交
  9. 16 3月, 2015 1 次提交
  10. 12 3月, 2015 2 次提交
  11. 10 3月, 2015 1 次提交
    • R
      fix GCC 5.0.0 logical-not-parentheses warnings · 8c1ac475
      Radim Krčmář 提交于
      man gcc:
        Warn about logical not used on the left hand side operand of a
        comparison.  This option does not warn if the RHS operand is of a
        boolean type.
      
      By preferring bool over int where sensible, but without modifying any
      depending code, make GCC happy in cases like this,
        qemu-img.c: In function ‘compare_sectors’:
        qemu-img.c:992:39: error: logical not is only applied to the left hand
        side of comparison [-Werror=logical-not-parentheses]
                 if (!!memcmp(buf1, buf2, 512) != res) {
      
      hw/ide/core.c:1836 doesn't throw an error,
        assert(!!s->error == !!(s->status & ERR_STAT));
      even thought the second operand is int (and first hunk of this patch has
      a very similar case), maybe GCC developers still have a little faith in
      C programmers.
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      8c1ac475
  12. 10 2月, 2015 1 次提交
  13. 12 1月, 2015 1 次提交
  14. 15 12月, 2014 3 次提交
  15. 23 11月, 2014 1 次提交
  16. 20 11月, 2014 1 次提交
    • A
      kvm: Fix memory slot page alignment logic · f2a64032
      Alexander Graf 提交于
      Memory slots have to be page aligned to get entered into KVM. There
      is existing logic that tries to ensure that we pad memory slots that
      are not page aligned to the biggest region that would still fit in the
      alignment requirements.
      
      Unfortunately, that logic is broken. It tries to calculate the start
      offset based on the region size.
      
      Fix up the logic to do the thing it was intended to do and document it
      properly in the comment above it.
      
      With this patch applied, I can successfully run an e500 guest with more
      than 3GB RAM (at which point RAM starts overlapping subpage memory regions).
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      f2a64032
  17. 10 10月, 2014 1 次提交
  18. 09 10月, 2014 2 次提交
  19. 04 10月, 2014 2 次提交
    • E
      accel: Rename 'init' method to 'init_machine' · 0d15da8e
      Eduardo Habkost 提交于
      Today, all accelerator init functions affect some global state:
      * tcg_init() calls tcg_exec_init() and affects globals such as tcg_tcx,
        page size globals, and possibly others;
      * kvm_init() changes the kvm_state global, cpu_interrupt_handler, and possibly
        others;
      * xen_init() changes the xen_xc global, and registers a change state handler.
      
      With the new accelerator QOM classes, initialization may now be split in two
      steps:
      * instance_init() will do basic initialization that doesn't affect any global
        state and don't need MachineState or MachineClass data. This will allow
        probing code to safely create multiple accelerator objects on the fly just
        for reporting host/accelerator capabilities, for example.
      * accel_init_machine()/init_machine() will save the accelerator object in
        MachineState, and do initialization steps which still affect global state,
        machine state, or that need data from MachineClass or MachineState.
      
      To clarify the difference between those two steps, rename init() to
      init_machine().
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0d15da8e
    • E
      accel: Move KVM accel registration to kvm-all.c · 782c3f29
      Eduardo Habkost 提交于
      Note that this has an user-visible side-effect: instead of reporting
      "KVM is not supported for this target", QEMU binaries not supporting KVM
      will report "kvm accelerator does not exist".
      
      As kvm_availble() always return 1 when CONFIG_KVM is enabled, we don't
      need to set AccelClass.available anymore. kvm_enabled() is not being
      completely removed yet only because qmp_query_kvm() still uses it.
      
      This also allows us to make kvm_init() static.
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      782c3f29
  20. 26 9月, 2014 1 次提交
  21. 16 9月, 2014 1 次提交
  22. 09 9月, 2014 1 次提交
  23. 08 9月, 2014 1 次提交
  24. 20 8月, 2014 1 次提交
  25. 22 7月, 2014 1 次提交
  26. 20 6月, 2014 1 次提交