Skip to content
Snippets Groups Projects
  1. May 17, 2022
  2. May 14, 2022
    • Paolo Bonzini's avatar
      introduce -audio as a replacement for -soundhw · 039a6837
      Paolo Bonzini authored
      
      -audio is used like "-audio pa,model=sb16".  It is almost as simple as
      -soundhw, but it reuses the -audiodev parsing machinery and attaches an
      audiodev to the newly-created device.  The main 'feature' is that
      it knows about adding the codec device for model=intel-hda, and adding
      the audiodev to the codec device.
      
      In the future, it could be extended to support default models or
      builtin devices, just like -nic, or even a default backend.  For now,
      keep it simple.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      039a6837
  3. May 13, 2022
    • Jonathan Cameron's avatar
      hw/cxl/host: Add support for CXL Fixed Memory Windows. · aadfe320
      Jonathan Cameron authored
      
      The concept of these is introduced in [1] in terms of the
      description the CEDT ACPI table. The principal is more general.
      Unlike once traffic hits the CXL root bridges, the host system
      memory address routing is implementation defined and effectively
      static once observable by standard / generic system software.
      Each CXL Fixed Memory Windows (CFMW) is a region of PA space
      which has fixed system dependent routing configured so that
      accesses can be routed to the CXL devices below a set of target
      root bridges. The accesses may be interleaved across multiple
      root bridges.
      
      For QEMU we could have fully specified these regions in terms
      of a base PA + size, but as the absolute address does not matter
      it is simpler to let individual platforms place the memory regions.
      
      ExampleS:
      -cxl-fixed-memory-window targets.0=cxl.0,size=128G
      -cxl-fixed-memory-window targets.0=cxl.1,size=128G
      -cxl-fixed-memory-window targets.0=cxl0,targets.1=cxl.1,size=256G,interleave-granularity=2k
      
      Specifies
      * 2x 128G regions not interleaved across root bridges, one for each of
        the root bridges with ids cxl.0 and cxl.1
      * 256G region interleaved across root bridges with ids cxl.0 and cxl.1
      with a 2k interleave granularity.
      
      When system software enumerates the devices below a given root bridge
      it can then decide which CFMW to use. If non interleave is desired
      (or possible) it can use the appropriate CFMW for the root bridge in
      question.  If there are suitable devices to interleave across the
      two root bridges then it may use the 3rd CFMS.
      
      A number of other designs were considered but the following constraints
      made it hard to adapt existing QEMU approaches to this particular problem.
      1) The size must be known before a specific architecture / board brings
         up it's PA memory map.  We need to set up an appropriate region.
      2) Using links to the host bridges provides a clean command line interface
         but these links cannot be established until command line devices have
         been added.
      
      Hence the two step process used here of first establishing the size,
      interleave-ways and granularity + caching the ids of the host bridges
      and then, once available finding the actual host bridges so they can
      be used later to support interleave decoding.
      
      [1] CXL 2.0 ECN: CEDT CFMWS & QTG DSM (computeexpresslink.org / specifications)
      
      Signed-off-by: default avatarJonathan Cameron <jonathan.cameron@huawei.com>
      Acked-by: Markus Armbruster <armbru@redhat.com> # QAPI Schema
      Message-Id: <20220429144110.25167-28-Jonathan.Cameron@huawei.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      aadfe320
  4. May 09, 2022
  5. Apr 28, 2022
  6. Apr 26, 2022
  7. Mar 22, 2022
  8. Mar 15, 2022
  9. Mar 06, 2022
  10. Feb 22, 2022
  11. Jan 20, 2022
    • Yanan Wang's avatar
      hw/arm/virt: Support CPU cluster on ARM virt machine · d55c316f
      Yanan Wang authored
      
      ARM64 machines like Kunpeng Family Server Chips have a level
      of hardware topology in which a group of CPU cores share L3
      cache tag or L2 cache. For example, Kunpeng 920 typically
      has 6 or 8 clusters in each NUMA node (also represent range
      of CPU die), and each cluster has 4 CPU cores. All clusters
      share L3 cache data, but CPU cores in each cluster share a
      local L3 tag.
      
      Running a guest kernel with Cluster-Aware Scheduling on the
      Hosts which have physical clusters, if we can design a vCPU
      topology with cluster level for guest kernel and then have
      a dedicated vCPU pinning, the guest will gain scheduling
      performance improvement from cache affinity of CPU cluster.
      
      So let's enable the support for this new parameter on ARM
      virt machines. After this patch, we can define a 4-level
      CPU hierarchy like: cpus=*,maxcpus=*,sockets=*,clusters=*,
      cores=*,threads=*.
      
      Signed-off-by: default avatarYanan Wang <wangyanan55@huawei.com>
      Reviewed-by: default avatarAndrew Jones <drjones@redhat.com>
      Message-id: 20220107083232.16256-2-wangyanan55@huawei.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      d55c316f
  12. Jan 05, 2022
  13. Dec 31, 2021
    • Yanan Wang's avatar
      hw/core/machine: Introduce CPU cluster topology support · 864c3b5c
      Yanan Wang authored
      
      The new Cluster-Aware Scheduling support has landed in Linux 5.16,
      which has been proved to benefit the scheduling performance (e.g.
      load balance and wake_affine strategy) on both x86_64 and AArch64.
      
      So now in Linux 5.16 we have four-level arch-neutral CPU topology
      definition like below and a new scheduler level for clusters.
      struct cpu_topology {
          int thread_id;
          int core_id;
          int cluster_id;
          int package_id;
          int llc_id;
          cpumask_t thread_sibling;
          cpumask_t core_sibling;
          cpumask_t cluster_sibling;
          cpumask_t llc_sibling;
      }
      
      A cluster generally means a group of CPU cores which share L2 cache
      or other mid-level resources, and it is the shared resources that
      is used to improve scheduler's behavior. From the point of view of
      the size range, it's between CPU die and CPU core. For example, on
      some ARM64 Kunpeng servers, we have 6 clusters in each NUMA node,
      and 4 CPU cores in each cluster. The 4 CPU cores share a separate
      L2 cache and a L3 cache tag, which brings cache affinity advantage.
      
      In virtualization, on the Hosts which have pClusters (physical
      clusters), if we can design a vCPU topology with cluster level for
      guest kernel and have a dedicated vCPU pinning. A Cluster-Aware
      Guest kernel can also make use of the cache affinity of CPU clusters
      to gain similar scheduling performance.
      
      This patch adds infrastructure for CPU cluster level topology
      configuration and parsing, so that the user can specify cluster
      parameter if their machines support it.
      
      Signed-off-by: default avatarYanan Wang <wangyanan55@huawei.com>
      Message-Id: <20211228092221.21068-3-wangyanan55@huawei.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      [PMD: Added '(since 7.0)' to @clusters in qapi/machine.json]
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      864c3b5c
    • Yanan Wang's avatar
      qemu-options: Improve readability of SMP related Docs · 0d871785
      Yanan Wang authored
      
      We have a description in qemu-options.hx for each CPU topology
      parameter to explain what it exactly means, and also an extra
      declaration for the target-specific one, e.g. "for PC only"
      when describing "dies", and "for PC, it's on one die" when
      describing "cores".
      
      Now we are going to introduce one more non-generic parameter
      "clusters", it will make the Doc less readable and  if we still
      continue to use the legacy way to describe it.
      
      So let's at first make two tweaks of the Docs to improve the
      readability and also scalability:
      1) In the -help text: Delete the extra specific declaration and
         describe each topology parameter level by level. Then add a
         note to declare that different machines may support different
         subsets and the actual meaning of the supported parameters
         will vary accordingly.
      2) In the rST text: List all the sub-hierarchies currently
         supported in QEMU, and correspondingly give an example of
         -smp configuration for each of them.
      
      Signed-off-by: default avatarYanan Wang <wangyanan55@huawei.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20211228092221.21068-2-wangyanan55@huawei.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      0d871785
  14. Dec 21, 2021
    • Marc-André Lureau's avatar
      audio: add "dbus" audio backend · 739362d4
      Marc-André Lureau authored
      
      Add a new -audio backend that accepts D-Bus clients/listeners to handle
      playback & recording, to be exported via the -display dbus.
      
      Example usage:
      -audiodev dbus,in.mixing-engine=off,out.mixing-engine=off,id=dbus
      -display dbus,audiodev=dbus
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      739362d4
    • Marc-André Lureau's avatar
      ui/dbus: add p2p=on/off option · 99997823
      Marc-André Lureau authored
      
      Add an option to use direct connections instead of via the bus. Clients
      are accepted with QMP add_client.
      
      This allows to provide the D-Bus display without a bus. It also
      simplifies the testing setup (some CI have issues to setup a D-Bus bus
      in a container).
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      99997823
    • Marc-André Lureau's avatar
      ui: add a D-Bus display backend · 142ca628
      Marc-André Lureau authored
      
      The "dbus" display backend exports the QEMU consoles and other
      UI-related interfaces over D-Bus.
      
      By default, the connection is established on the session bus, but you
      can specify a different bus with the "addr" option.
      
      The backend takes the "org.qemu" service name, while still allowing
      further instances to queue on the same name (so you can lookup all the
      available instances too). It accepts any number of clients at this
      point, although this is expected to evolve with options to restrict
      clients, or only accept p2p via fd passing.
      
      The interface is intentionally very close to the internal QEMU API,
      and can be introspected or interacted with busctl/dfeet etc:
      
      $ ./qemu-system-x86_64 -name MyVM -display dbus
      $ busctl --user introspect org.qemu /org/qemu/Display1/Console_0
      
      org.qemu.Display1.Console           interface -         -               -
      .RegisterListener                   method    h         -               -
      .SetUIInfo                          method    qqiiuu    -               -
      .DeviceAddress                      property  s         "pci/0000/01.0" emits-change
      .Head                               property  u         0               emits-change
      .Height                             property  u         480             emits-change
      .Label                              property  s         "VGA"           emits-change
      .Type                               property  s         "Graphic"       emits-change
      .Width                              property  u         640             emits-change
      [...]
      
      See the interfaces XML source file and Sphinx docs for the generated API
      documentations.
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      142ca628
  15. Dec 10, 2021
    • Yang Zhong's avatar
      numa: Enable numa for SGX EPC sections · 11058123
      Yang Zhong authored
      
      The basic SGX did not enable numa for SGX EPC sections, which
      result in all EPC sections located in numa node 0. This patch
      enable SGX numa function in the guest and the EPC section can
      work with RAM as one numa node.
      
      The Guest kernel related log:
      [    0.009981] ACPI: SRAT: Node 0 PXM 0 [mem 0x180000000-0x183ffffff]
      [    0.009982] ACPI: SRAT: Node 1 PXM 1 [mem 0x184000000-0x185bfffff]
      The SRAT table can normally show SGX EPC sections menory info in different
      numa nodes.
      
      The SGX EPC numa related command:
       ......
       -m 4G,maxmem=20G \
       -smp sockets=2,cores=2 \
       -cpu host,+sgx-provisionkey \
       -object memory-backend-ram,size=2G,host-nodes=0,policy=bind,id=node0 \
       -object memory-backend-epc,id=mem0,size=64M,prealloc=on,host-nodes=0,policy=bind \
       -numa node,nodeid=0,cpus=0-1,memdev=node0 \
       -object memory-backend-ram,size=2G,host-nodes=1,policy=bind,id=node1 \
       -object memory-backend-epc,id=mem1,size=28M,prealloc=on,host-nodes=1,policy=bind \
       -numa node,nodeid=1,cpus=2-3,memdev=node1 \
       -M sgx-epc.0.memdev=mem0,sgx-epc.0.node=0,sgx-epc.1.memdev=mem1,sgx-epc.1.node=1 \
       ......
      
      Signed-off-by: default avatarYang Zhong <yang.zhong@intel.com>
      Message-Id: <20211101162009.62161-2-yang.zhong@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      11058123
  16. Nov 18, 2021
  17. Nov 08, 2021
    • John Snow's avatar
      docs: remove non-reference uses of single backticks · 450e0f28
      John Snow authored
      
      The single backtick markup in ReST is the "default role". Currently,
      Sphinx's default role is called "content". Sphinx suggests you can use
      the "Any" role instead to turn any single-backtick enclosed item into a
      cross-reference.
      
      This is useful for things like autodoc for Python docstrings, where it's
      often nicer to reference other types with `foo` instead of the more
      laborious :py:meth:`foo`. It's also useful in multi-domain cases to
      easily reference definitions from other Sphinx domains, such as
      referencing C code definitions from outside of kerneldoc comments.
      
      Before we do that, though, we'll need to turn all existing usages of the
      "content" role to inline verbatim markup wherever it does not correctly
      resolve into a cross-refernece by using double backticks instead.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: default avatarAlexander Bulekov <alxndr@bu.edu>
      Message-Id: <20211004215238.1523082-2-jsnow@redhat.com>
      450e0f28
  18. Oct 29, 2021
    • Markus Armbruster's avatar
      qapi: Extend -compat to set policy for unstable interfaces · 57df0dff
      Markus Armbruster authored
      
      New option parameters unstable-input and unstable-output set policy
      for unstable interfaces just like deprecated-input and
      deprecated-output set policy for deprecated interfaces (see commit
      6dd75472 "qemu-options: New -compat to set policy for deprecated
      interfaces").  This is intended for testing users of the management
      interfaces.  It is experimental.
      
      For now, this covers only syntactic aspects of QMP, i.e. stuff tagged
      with feature 'unstable'.  We may want to extend it to cover semantic
      aspects, or the command line.
      
      Note that there is no good way for management application to detect
      presence of these new option parameters: they are not visible output
      of query-qmp-schema or query-command-line-options.  Tolerable, because
      it's meant for testing.  If running with -compat fails, skip the test.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20211028102520.747396-10-armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      [Doc comments fixed up]
      57df0dff
  19. Oct 04, 2021
  20. Oct 01, 2021
  21. Sep 30, 2021
    • Sean Christopherson's avatar
      vl: Add sgx compound properties to expose SGX EPC sections to guest · dfce81f1
      Sean Christopherson authored
      
      Because SGX EPC is enumerated through CPUID, EPC "devices" need to be
      realized prior to realizing the vCPUs themselves, i.e. long before
      generic devices are parsed and realized.  From a virtualization
      perspective, the CPUID aspect also means that EPC sections cannot be
      hotplugged without paravirtualizing the guest kernel (hardware does
      not support hotplugging as EPC sections must be locked down during
      pre-boot to provide EPC's security properties).
      
      So even though EPC sections could be realized through the generic
      -devices command, they need to be created much earlier for them to
      actually be usable by the guest.  Place all EPC sections in a
      contiguous block, somewhat arbitrarily starting after RAM above 4g.
      Ensuring EPC is in a contiguous region simplifies calculations, e.g.
      device memory base, PCI hole, etc..., allows dynamic calculation of the
      total EPC size, e.g. exposing EPC to guests does not require -maxmem,
      and last but not least allows all of EPC to be enumerated in a single
      ACPI entry, which is expected by some kernels, e.g. Windows 7 and 8.
      
      The new compound properties command for sgx like below:
       ......
       -object memory-backend-epc,id=mem1,size=28M,prealloc=on \
       -object memory-backend-epc,id=mem2,size=10M \
       -M sgx-epc.0.memdev=mem1,sgx-epc.1.memdev=mem2
      
      Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarYang Zhong <yang.zhong@intel.com>
      Message-Id: <20210719112136.57018-6-yang.zhong@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      dfce81f1
  22. Sep 06, 2021
    • Thomas Huth's avatar
      softmmu/vl: Deprecate the old grab options · d46156fd
      Thomas Huth authored
      
      The alt_grab and ctrl_grab parameter of the -display sdl option prevent
      the QAPIfication of the "sdl" part of the -display option, so we should
      eventually remove them. And since this feature is also rather niche anyway,
      we should not clutter the top-level option list with these, so let's
      also deprecate the "-alt-grab" and the "-ctrl-grab" options while we're
      at it.
      
      Once the deprecation period of "alt_grab" and "ctrl_grab" is over, we
      then can finally switch the -display sdl option to use QAPI internally,
      too.
      
      Message-Id: <20210825092023.81396-3-thuth@redhat.com>
      Reviewed-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Acked-by: default avatarPeter Krempa <pkrempa@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      d46156fd
    • Thomas Huth's avatar
      softmmu/vl: Add a "grab-mod" parameter to the -display sdl option · 8e8e844b
      Thomas Huth authored
      
      The -display sdl option is not using QAPI internally yet, and uses hand-
      crafted parsing instead (see parse_display() in vl.c), which is quite
      ugly, since most of the other code is using the QAPIfied DisplayOption
      already. Unfortunately, the "alt_grab" and "ctrl_grab" use underscores in
      their names which has recently been forbidden in new QAPI code, so
      a straight conversion is not possible. While we could add some exceptions
      to the QAPI schema parser for this, the way these parameters have been
      designed was maybe a bad idea anyway: First, it's not possible to enable
      both parameters at the same time, thus instead of two boolean parameters
      it would be better to have only one multi-choice parameter instead.
      Second, the naming is also somewhat unfortunate since the "alt_grab"
      parameter is not about the ALT key, but rather about the left SHIFT key
      that has to be used additionally when the parameter is enabled.
      
      So instead of trying to QAPIfy "alt_grab" and "ctrl_grab", let's rather
      introduce an alternative to these parameters instead, a new parameter
      called "grab-mod" which can either be set to "lshift-lctrl-lalt" or to
      "rctrl". In case we ever want to support additional modes later, we can
      then also simply extend the list of supported strings here.
      
      Message-Id: <20210825092023.81396-2-thuth@redhat.com>
      Reviewed-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      8e8e844b
  23. Sep 02, 2021
  24. Jul 27, 2021
    • Peter Maydell's avatar
      qemu-options.hx: Fix formatting of -machine memory-backend option · 95355829
      Peter Maydell authored
      
      The documentation of the -machine memory-backend has some minor
      formatting errors:
       * Misindentation of the initial line meant that the whole option
         section is incorrectly indented in the HTML output compared to
         the other -machine options
       * The examples weren't indented, which meant that they were formatted
         as plain run-on text including outputting the "::" as text.
       * The a) b) list has no rst-format markup so it is rendered as
         a single run-on paragraph
      
      Fix the formatting.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarIgor Mammedov <imammedo@redhat.com>
      Message-id: 20210719105257.3599-1-peter.maydell@linaro.org
      95355829
  25. Jul 21, 2021
    • Stefano Garzarella's avatar
      iothread: add aio-max-batch parameter · 1793ad02
      Stefano Garzarella authored
      
      The `aio-max-batch` parameter will be propagated to AIO engines
      and it will be used to control the maximum number of queued requests.
      
      When there are in queue a number of requests equal to `aio-max-batch`,
      the engine invokes the system call to forward the requests to the kernel.
      
      This parameter allows us to control the maximum batch size to reduce
      the latency that requests might accumulate while queued in the AIO
      engine queue.
      
      If `aio-max-batch` is equal to 0 (default value), the AIO engine will
      use its default maximum batch size value.
      
      Signed-off-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Message-id: 20210721094211.69853-3-sgarzare@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      1793ad02
  26. Jul 16, 2021
  27. Jul 14, 2021
Loading