Skip to content
Snippets Groups Projects
  1. Mar 14, 2017
  2. Mar 03, 2017
    • Paolo Bonzini's avatar
      KVM: use KVM_CAP_IMMEDIATE_EXIT · cf0f7cf9
      Paolo Bonzini authored
      
      The purpose of the KVM_SET_SIGNAL_MASK API is to let userspace "kick"
      a VCPU out of KVM_RUN through a POSIX signal.  A signal is attached
      to a dummy signal handler; by blocking the signal outside KVM_RUN and
      unblocking it inside, this possible race is closed:
      
                VCPU thread                     service thread
         --------------------------------------------------------------
              check flag
                                                set flag
                                                raise signal
              (signal handler does nothing)
              KVM_RUN
      
      However, one issue with KVM_SET_SIGNAL_MASK is that it has to take
      tsk->sighand->siglock on every KVM_RUN.  This lock is often on a
      remote NUMA node, because it is on the node of a thread's creator.
      Taking this lock can be very expensive if there are many userspace
      exits (as is the case for SMP Windows VMs without Hyper-V reference
      time counter).
      
      KVM_CAP_IMMEDIATE_EXIT provides an alternative, where the flag is
      placed directly in kvm_run so that KVM can see it:
      
                VCPU thread                     service thread
         --------------------------------------------------------------
                                                raise signal
              signal handler
                set run->immediate_exit
              KVM_RUN
                check run->immediate_exit
      
      The previous patches changed QEMU so that the only blocked signal is
      SIG_IPI, so we can now stop using KVM_SET_SIGNAL_MASK and sigtimedwait
      if KVM_CAP_IMMEDIATE_EXIT is available.
      
      On a 14-VCPU guest, an "inl" operation goes down from 30k to 6k on
      an unlocked (no BQL) MemoryRegion, or from 30k to 15k if the BQL
      is involved.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      cf0f7cf9
    • Paolo Bonzini's avatar
    • Paolo Bonzini's avatar
      KVM: move SIG_IPI handling to kvm-all.c · 18268b60
      Paolo Bonzini authored
      
      This lets us remove a bunch of CONFIG_LINUX defines.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      18268b60
    • Paolo Bonzini's avatar
      KVM: do not use sigtimedwait to catch SIGBUS · 2ae41db2
      Paolo Bonzini authored
      
      Call kvm_on_sigbus_vcpu asynchronously from the VCPU thread.
      Information for the SIGBUS can be stored in thread-local variables
      and processed later in kvm_cpu_exec.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2ae41db2
    • Paolo Bonzini's avatar
      KVM: remove kvm_arch_on_sigbus · 4d39892c
      Paolo Bonzini authored
      
      Build it on kvm_arch_on_sigbus_vcpu instead.  They do the same
      for "action optional" SIGBUSes, and the main thread should never get
      "action required" SIGBUSes because it blocks the signal.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      4d39892c
  3. Feb 16, 2017
  4. Jan 31, 2017
  5. Oct 31, 2016
  6. Oct 23, 2016
  7. Oct 04, 2016
  8. Sep 27, 2016
    • Alex Bennée's avatar
      cpus: pass CPUState to run_on_cpu helpers · e0eeb4a2
      Alex Bennée authored
      
      CPUState is a fairly common pointer to pass to these helpers. This means
      if you need other arguments for the async_run_on_cpu case you end up
      having to do a g_malloc to stuff additional data into the routine. For
      the current users this isn't a massive deal but for MTTCG this gets
      cumbersome when the only other parameter is often an address.
      
      This adds the typedef run_on_cpu_func for helper functions which has an
      explicit CPUState * passed as the first parameter. All the users of
      run_on_cpu and async_run_on_cpu have had their helpers updated to use
      CPUState where available.
      
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      [Sergey Fedorov:
       - eliminate more CPUState in user data;
       - remove unnecessary user data passing;
       - fix target-s390x/kvm.c and target-s390x/misc_helper.c]
      Signed-off-by: default avatarSergey Fedorov <sergey.fedorov@linaro.org>
      Acked-by: David Gibson <david@gibson.dropbear.id.au> (ppc parts)
      Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> (s390 parts)
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Message-Id: <1470158864-17651-3-git-send-email-alex.bennee@linaro.org>
      Reviewed-by: default avatarRichard Henderson <rth@twiddle.net>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      e0eeb4a2
  9. Sep 13, 2016
  10. Aug 08, 2016
  11. Aug 03, 2016
  12. Jul 21, 2016
  13. Jun 16, 2016
  14. Jun 07, 2016
  15. May 30, 2016
  16. May 26, 2016
    • Greg Kurz's avatar
      PPC/KVM: early validation of vcpu id · 41264b38
      Greg Kurz authored
      
      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: default avatarGreg Kurz <gkurz@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      41264b38
  17. May 18, 2016
  18. Mar 30, 2016
  19. Mar 07, 2016
  20. Feb 09, 2016
  21. Feb 04, 2016
    • Peter Maydell's avatar
      all: Clean up includes · d38ea87a
      Peter Maydell authored
      
      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: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-16-git-send-email-peter.maydell@linaro.org
      d38ea87a
  22. Jan 13, 2016
  23. Dec 17, 2015
  24. Nov 12, 2015
  25. Nov 10, 2015
  26. Nov 05, 2015
Loading