Skip to content
Snippets Groups Projects
  1. Jul 28, 2022
  2. Jul 22, 2022
    • Peter Maydell's avatar
      accel/kvm: Avoid Coverity warning in query_stats() · d12dd9c7
      Peter Maydell authored
      
      Coverity complains that there is a codepath in the query_stats()
      function where it can leak the memory pointed to by stats_list.  This
      can only happen if the caller passes something other than
      STATS_TARGET_VM or STATS_TARGET_VCPU as the 'target', which no
      callsite does.  Enforce this assumption using g_assert_not_reached(),
      so that if we have a future bug we hit the assert rather than
      silently leaking memory.
      
      Resolves: Coverity CID 1490140
      Fixes: cc01a3f4 ("kvm: Support for querying fd-based stats")
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-Id: <20220719134853.327059-1-peter.maydell@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      d12dd9c7
  3. Jul 20, 2022
  4. Jul 18, 2022
  5. Jul 12, 2022
    • Ilya Leoshkevich's avatar
      accel/tcg: Fix unaligned stores to s390x low-address-protected lowcore · b0f650f0
      Ilya Leoshkevich authored
      
      If low-address-protection is active, unaligned stores to non-protected
      parts of lowcore lead to protection exceptions. The reason is that in
      such cases tlb_fill() call in store_helper_unaligned() covers
      [0, addr + size) range, which contains the protected portion of
      lowcore. This range is too large.
      
      The most straightforward fix would be to make sure we stay within the
      original [addr, addr + size) range. However, if an unaligned access
      affects a single page, we don't need to call tlb_fill() in
      store_helper_unaligned() at all, since it would be identical to
      the previous tlb_fill() call in store_helper(), and therefore a no-op.
      If an unaligned access covers multiple pages, this situation does not
      occur.
      
      Therefore simply skip TLB handling in store_helper_unaligned() if we
      are dealing with a single page.
      
      Fixes: 2bcf0183 ("s390x/tcg: low-address protection support")
      Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
      Message-Id: <20220711185640.3558813-2-iii@linux.ibm.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      b0f650f0
  6. Jul 08, 2022
  7. Jun 27, 2022
  8. Jun 20, 2022
  9. Jun 14, 2022
    • Paolo Bonzini's avatar
      qmp: add filtering of statistics by name · cf7405bc
      Paolo Bonzini authored
      
      Allow retrieving only a subset of statistics.  This can be useful
      for example in order to plot a subset of the statistics many times
      a second: KVM publishes ~40 statistics for each vCPU on x86; retrieving
      and serializing all of them would be useless.
      
      Another use will be in HMP in the following patch; implementing the
      filter in the backend is easy enough that it was deemed okay to make
      this a public interface.
      
      Example:
      
      { "execute": "query-stats",
        "arguments": {
          "target": "vcpu",
          "vcpus": [ "/machine/unattached/device[2]",
                     "/machine/unattached/device[4]" ],
          "providers": [
            { "provider": "kvm",
              "names": [ "l1d_flush", "exits" ] } } }
      
      { "return": {
          "vcpus": [
            { "path": "/machine/unattached/device[2]"
              "providers": [
                { "provider": "kvm",
                  "stats": [ { "name": "l1d_flush", "value": 41213 },
                             { "name": "exits", "value": 74291 } ] } ] },
            { "path": "/machine/unattached/device[4]"
              "providers": [
                { "provider": "kvm",
                  "stats": [ { "name": "l1d_flush", "value": 16132 },
                             { "name": "exits", "value": 57922 } ] } ] } ] } }
      
      Extracted from a patch by Mark Kanda.
      
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      cf7405bc
    • Paolo Bonzini's avatar
      qmp: add filtering of statistics by provider · 068cc51d
      Paolo Bonzini authored
      
      Allow retrieving the statistics from a specific provider only.
      This can be used in the future by HMP commands such as "info
      sync-profile" or "info profile".  The next patch also adds
      filter-by-provider capabilities to the HMP equivalent of
      query-stats, "info stats".
      
      Example:
      
      { "execute": "query-stats",
        "arguments": {
          "target": "vm",
          "providers": [
            { "provider": "kvm" } ] } }
      
      The QAPI is a bit more verbose than just a list of StatsProvider,
      so that it can be subsequently extended with filtering of statistics
      by name.
      
      If a provider is specified more than once in the filter, each request
      will be included separately in the output.
      
      Extracted from a patch by Mark Kanda.
      
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      068cc51d
    • Paolo Bonzini's avatar
      qmp: add filtering of statistics by target vCPU · 467ef823
      Paolo Bonzini authored
      
      Introduce a simple filtering of statistics, that allows to retrieve
      statistics for a subset of the guest vCPUs.  This will be used for
      example by the HMP monitor, in order to retrieve the statistics
      for the currently selected CPU.
      
      Example:
      { "execute": "query-stats",
        "arguments": {
          "target": "vcpu",
          "vcpus": [ "/machine/unattached/device[2]",
                     "/machine/unattached/device[4]" ] } }
      
      Extracted from a patch by Mark Kanda.
      
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      467ef823
    • Mark Kanda's avatar
      kvm: Support for querying fd-based stats · cc01a3f4
      Mark Kanda authored
      
      Add support for querying fd-based KVM stats - as introduced by Linux kernel
      commit:
      
      cb082bfab59a ("KVM: stats: Add fd-based API to read binary stats data")
      
      This allows the user to analyze the behavior of the VM without access
      to debugfs.
      
      Signed-off-by: default avatarMark Kanda <mark.kanda@oracle.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      cc01a3f4
  10. Jun 11, 2022
  11. Jun 08, 2022
    • Peter Maydell's avatar
      Fix 'writeable' typos · 9323e79f
      Peter Maydell authored
      
      We have about 30 instances of the typo/variant spelling 'writeable',
      and over 500 of the more common 'writable'.  Standardize on the
      latter.
      
      Change produced with:
      
        sed -i -e 's/\([Ww][Rr][Ii][Tt]\)[Ee]\([Aa][Bb][Ll][Ee]\)/\1\2/g' $(git grep -il writeable)
      
      and then hand-undoing the instance in linux-headers/linux/kvm.h.
      
      Most of these changes are in comments or documentation; the
      exceptions are:
       * a local variable in accel/hvf/hvf-accel-ops.c
       * a local variable in accel/kvm/kvm-all.c
       * the PMCR_WRITABLE_MASK macro in target/arm/internals.h
       * the EPT_VIOLATION_GPA_WRITABLE macro in target/i386/hvf/vmcs.h
         (which is never used anywhere)
       * the AR_TYPE_WRITABLE_MASK macro in target/i386/hvf/vmx.h
         (which is never used anywhere)
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarStefan Weil <sw@weilnetz.de>
      Message-id: 20220505095015.2714666-1-peter.maydell@linaro.org
      9323e79f
  12. Jun 06, 2022
  13. May 11, 2022
  14. Apr 27, 2022
  15. Apr 21, 2022
  16. Apr 20, 2022
  17. Apr 06, 2022
  18. Mar 21, 2022
  19. Mar 16, 2022
  20. Mar 15, 2022
Loading