1. 23 Nov, 2014 1 commit
  2. 20 Nov, 2014 1 commit
    • Alexander Graf's avatar
      kvm: Fix memory slot page alignment logic · f2a64032
      Alexander Graf authored
      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: default avatarAlexander Graf <agraf@suse.de>
      f2a64032
  3. 10 Oct, 2014 1 commit
  4. 09 Oct, 2014 2 commits
  5. 04 Oct, 2014 2 commits
    • Eduardo Habkost's avatar
      accel: Rename 'init' method to 'init_machine' · 0d15da8e
      Eduardo Habkost authored
      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: default avatarEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0d15da8e
    • Eduardo Habkost's avatar
      accel: Move KVM accel registration to kvm-all.c · 782c3f29
      Eduardo Habkost authored
      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: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      782c3f29
  6. 26 Sep, 2014 1 commit
  7. 16 Sep, 2014 1 commit
  8. 09 Sep, 2014 1 commit
  9. 08 Sep, 2014 1 commit
  10. 20 Aug, 2014 1 commit
  11. 22 Jul, 2014 1 commit
  12. 19 Jun, 2014 2 commits
  13. 18 Jun, 2014 2 commits
    • James Hogan's avatar
      kvm: Allow arch to set sigmask length · aed6efb9
      James Hogan authored
      MIPS/Linux is unusual in having 128 signals rather than just 64 like
      most other architectures. This means its sigmask is 16 bytes instead of
      8, so allow arches to override the sigmask->len value passed to the
      KVM_SET_SIGNAL_MASK ioctl in kvm_set_signal_mask() by calling
      kvm_set_sigmask_len() from kvm_arch_init(). Otherwise default to 8
      bytes.
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Cc: Gleb Natapov <gleb@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      aed6efb9
    • Alexander Graf's avatar
      KVM: Fix GSI number space limit · 00008418
      Alexander Graf authored
      KVM tells us the number of GSIs it can handle inside the kernel. That value is
      basically KVM_MAX_IRQ_ROUTES. However when we try to set the GSI mapping table,
      it checks for
      
          r = -EINVAL;
          if (routing.nr >= KVM_MAX_IRQ_ROUTES)
              goto out;
      
      erroring out even when we're only using all of the GSIs. To make sure we never
      hit that limit, let's reduce the number of GSIs we get from KVM by one.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      00008418
  14. 30 May, 2014 1 commit
  15. 20 May, 2014 1 commit
  16. 13 May, 2014 2 commits
  17. 05 May, 2014 1 commit
  18. 14 Apr, 2014 1 commit
    • Michael Tokarev's avatar
      Revert "fix return check for KVM_GET_DIRTY_LOG ioctl" · 50212d63
      Michael Tokarev authored
      This reverts commit b533f658.
      
      The original code was wrong, because effectively it ignored errors
      from kernel, because kernel does not return -1 on error case but
      returns -errno, and does not return -EPERM for this particular ioctl.
      But in some cases kernel actually returned unsuccessful result,
      namely, when the dirty bitmap in requested slot does not exist
      it returns -ENOENT.  With new code this condition becomes an
      error when it shouldn't be.
      
      Revert that patch instead of fixing it properly this late in the
      release process.  I disagree with this approach, but let's make
      things move _somewhere_, instead of arguing endlessly whch of
      the 2 proposed fixes is better.
      Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      Message-id: 1397477644-902-1-git-send-email-mjt@msgid.tls.msk.ru
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      50212d63
  19. 27 Mar, 2014 1 commit
  20. 04 Mar, 2014 1 commit
  21. 27 Feb, 2014 1 commit
  22. 26 Feb, 2014 2 commits
  23. 21 Feb, 2014 1 commit
  24. 03 Feb, 2014 1 commit
  25. 17 Jan, 2014 1 commit
  26. 15 Jan, 2014 2 commits
  27. 13 Jan, 2014 3 commits
  28. 25 Nov, 2013 1 commit
  29. 20 Sep, 2013 2 commits
    • Alexey Kardashevskiy's avatar
      kvm irqfd: support direct msimessage to irq translation · 76fe21de
      Alexey Kardashevskiy authored
      On PPC64 systems MSI Messages are translated to system IRQ in a PCI
      host bridge. This is already supported for emulated MSI/MSIX but
      not for irqfd where the current QEMU allocates IRQ numbers from
      irqchip and maps MSIMessages to IRQ in the host kernel.
      
      This adds a new direct mapping flag which tells
      the kvm_irqchip_add_msi_route() function that a new VIRQ
      should not be allocated, instead the value from MSIMessage::data
      should be used. It is up to the platform code to make sure that
      this contains a valid IRQ number as sPAPR does in spapr_pci.c.
      Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      76fe21de
    • Andrew Jones's avatar
      kvm: warn if num cpus is greater than num recommended · 670436ce
      Andrew Jones authored
      The comment in kvm_max_vcpus() states that it's using the recommended
      procedure from the kernel API documentation to get the max number
      of vcpus that kvm supports. It is, but by always returning the
      maximum number supported. The maximum number should only be used
      for development purposes. qemu should check KVM_CAP_NR_VCPUS for
      the recommended number of vcpus. This patch adds a warning if a user
      specifies a number of cpus between the recommended and max.
      Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
      Acked-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
      670436ce
  30. 12 Sep, 2013 1 commit