Skip to content
Snippets Groups Projects
  1. Jan 05, 2022
  2. 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
  3. 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
  4. 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
  5. Nov 18, 2021
  6. 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
  7. 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
  8. Oct 04, 2021
  9. Oct 01, 2021
  10. 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
  11. 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
  12. Sep 02, 2021
  13. 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
  14. 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
  15. Jul 16, 2021
  16. Jul 14, 2021
  17. Jul 05, 2021
  18. Jun 23, 2021
  19. May 26, 2021
  20. May 14, 2021
    • Vincent Bernat's avatar
      hw/smbios: support for type 41 (onboard devices extended information) · 05dfb447
      Vincent Bernat authored
      
      Type 41 defines the attributes of devices that are onboard. The
      original intent was to imply the BIOS had some level of control over
      the enablement of the associated devices.
      
      If network devices are present in this table, by default, udev will
      name the corresponding interfaces enoX, X being the instance number.
      Without such information, udev will fallback to using the PCI ID and
      this usually gives ens3 or ens4. This can be a bit annoying as the
      name of the network card may depend on the order of options and may
      change if a new PCI device is added earlier on the commande line.
      Being able to provide SMBIOS type 41 entry ensure the name of the
      interface won't change and helps the user guess the right name without
      booting a first time.
      
      This can be invoked with:
      
          $QEMU -netdev user,id=internet
                -device virtio-net-pci,mac=50:54:00:00:00:42,netdev=internet,id=internet-dev \
                -smbios type=41,designation='Onboard LAN',instance=1,kind=ethernet,pcidev=internet-dev
      
      The PCI segment is assumed to be 0. This should hold true for most
      cases.
      
          $ dmidecode -t 41
          # dmidecode 3.3
          Getting SMBIOS data from sysfs.
          SMBIOS 2.8 present.
      
          Handle 0x2900, DMI type 41, 11 bytes
          Onboard Device
                  Reference Designation: Onboard LAN
                  Type: Ethernet
                  Status: Enabled
                  Type Instance: 1
                  Bus Address: 0000:00:09.0
      
          $ ip -brief a
          lo               UNKNOWN        127.0.0.1/8 ::1/128
          eno1             UP             10.0.2.14/24 fec0::5254:ff:fe00:42/64 fe80::5254:ff:fe00:42/64
      
      Signed-off-by: default avatarVincent Bernat <vincent@bernat.ch>
      Message-Id: <20210401171138.62970-1-vincent@bernat.ch>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      05dfb447
  21. May 12, 2021
  22. May 04, 2021
  23. May 03, 2021
  24. Mar 26, 2021
    • Thomas Huth's avatar
      usb: Remove "-usbdevice ccid" · d2aea775
      Thomas Huth authored
      
      "-usbdevice ccid" was not documented and -usbdevice itself was marked
      as deprecated before QEMU v6.0. And searching for "-usbdevice ccid"
      in the internet does not show any useful results, so likely nobody
      was using the ccid device via the -usbdevice option. Remove it now.
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <20210311092829.1479051-1-thuth@redhat.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      d2aea775
  25. Mar 19, 2021
    • Markus Armbruster's avatar
      qapi: New -compat deprecated-input=crash · dbb675c1
      Markus Armbruster authored
      
      Policy "crash" calls abort() when deprecated input is received.
      
      Bugs in integration tests may mask the error from policy "reject".
      Provide a larger hammer: crash outright.  Masking that seems unlikely.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20210318155519.1224118-12-armbru@redhat.com>
      dbb675c1
    • Markus Armbruster's avatar
      qemu-options: New -compat to set policy for deprecated interfaces · 6dd75472
      Markus Armbruster authored
      
      New option -compat lets you configure what to do when deprecated
      interfaces get used.  This is intended for testing users of the
      management interfaces.  It is experimental.
      
      -compat deprecated-input=<input-policy> configures what to do when
      deprecated input is received.  Input policy can be "accept" (accept
      silently), or "reject" (reject the request with an error).
      
      -compat deprecated-output=<out-policy> configures what to do when
      deprecated output is sent.  Output policy can be "accept" (pass on
      unchanged), or "hide" (filter out the deprecated parts).
      
      Default is "accept".  Policies other than "accept" are implemented
      later in this series.
      
      For now, -compat covers only syntactic aspects of QMP, i.e. stuff
      tagged with feature 'deprecated'.  We may want to extend it to cover
      semantic aspects, CLI, and experimental features.
      
      Note that there is no good way for management application to detect
      presence of -compat: it's 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>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20210318155519.1224118-3-armbru@redhat.com>
      6dd75472
Loading