Skip to content
Snippets Groups Projects
  1. May 26, 2022
  2. May 17, 2022
  3. May 16, 2022
  4. 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
  5. May 12, 2022
    • Eric Blake's avatar
      nbd/server: Allow MULTI_CONN for shared writable exports · 58a6fdcc
      Eric Blake authored
      
      According to the NBD spec, a server that advertises
      NBD_FLAG_CAN_MULTI_CONN promises that multiple client connections will
      not see any cache inconsistencies: when properly separated by a single
      flush, actions performed by one client will be visible to another
      client, regardless of which client did the flush.
      
      We always satisfy these conditions in qemu - even when we support
      multiple clients, ALL clients go through a single point of reference
      into the block layer, with no local caching.  The effect of one client
      is instantly visible to the next client.  Even if our backend were a
      network device, we argue that any multi-path caching effects that
      would cause inconsistencies in back-to-back actions not seeing the
      effect of previous actions would be a bug in that backend, and not the
      fault of caching in qemu.  As such, it is safe to unconditionally
      advertise CAN_MULTI_CONN for any qemu NBD server situation that
      supports parallel clients.
      
      Note, however, that we don't want to advertise CAN_MULTI_CONN when we
      know that a second client cannot connect (for historical reasons,
      qemu-nbd defaults to a single connection while nbd-server-add and QMP
      commands default to unlimited connections; but we already have
      existing means to let either style of NBD server creation alter those
      defaults).  This is visible by no longer advertising MULTI_CONN for
      'qemu-nbd -r' without -e, as in the iotest nbd-qemu-allocation.
      
      The harder part of this patch is setting up an iotest to demonstrate
      behavior of multiple NBD clients to a single server.  It might be
      possible with parallel qemu-io processes, but I found it easier to do
      in python with the help of libnbd, and help from Nir and Vladimir in
      writing the test.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Suggested-by: default avatarNir Soffer <nsoffer@redhat.com>
      Suggested-by: default avatarVladimir Sementsov-Ogievskiy <v.sementsov-og@mail.ru>
      Message-Id: <20220512004924.417153-3-eblake@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      58a6fdcc
    • Paolo Bonzini's avatar
      machine: add mem compound property · ce9d03fb
      Paolo Bonzini authored
      
      Make -m syntactic sugar for a compound property "-machine
      mem.{size,max-size,slots}".  The new property does not have
      the magic conversion to megabytes of unsuffixed arguments,
      and also does not understand that "0" means the default size
      (you have to leave it out to get the default).  This means
      that we need to convert the QemuOpts by hand to a QDict.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20220414165300.555321-4-pbonzini@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ce9d03fb
    • Paolo Bonzini's avatar
      machine: use QAPI struct for boot configuration · 97ec4d21
      Paolo Bonzini authored
      
      As part of converting -boot to a property with a QAPI type, define
      the struct and use it throughout QEMU to access boot configuration.
      machine_boot_parse takes care of doing the QemuOpts->QAPI conversion by
      hand, for now.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20220414165300.555321-2-pbonzini@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      97ec4d21
  6. May 09, 2022
    • Gavin Shan's avatar
      qapi/machine.json: Add cluster-id · 1dcf7001
      Gavin Shan authored
      
      This adds cluster-id in CPU instance properties, which will be used
      by arm/virt machine. Besides, the cluster-id is also verified or
      dumped in various spots:
      
        * hw/core/machine.c::machine_set_cpu_numa_node() to associate
          CPU with its NUMA node.
      
        * hw/core/machine.c::machine_numa_finish_cpu_init() to record
          CPU slots with no NUMA mapping set.
      
        * hw/core/machine-hmp-cmds.c::hmp_hotpluggable_cpus() to dump
          cluster-id.
      
      Signed-off-by: default avatarGavin Shan <gshan@redhat.com>
      Reviewed-by: default avatarYanan Wang <wangyanan55@huawei.com>
      Acked-by: default avatarIgor Mammedov <imammedo@redhat.com>
      Message-id: 20220503140304.855514-2-gshan@redhat.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      1dcf7001
    • Nicolas Saenz Julienne's avatar
      util/event-loop-base: Introduce options to set the thread pool size · 71ad4713
      Nicolas Saenz Julienne authored
      
      The thread pool regulates itself: when idle, it kills threads until
      empty, when in demand, it creates new threads until full. This behaviour
      doesn't play well with latency sensitive workloads where the price of
      creating a new thread is too high. For example, when paired with qemu's
      '-mlock', or using safety features like SafeStack, creating a new thread
      has been measured take multiple milliseconds.
      
      In order to mitigate this let's introduce a new 'EventLoopBase'
      property to set the thread pool size. The threads will be created during
      the pool's initialization or upon updating the property's value, remain
      available during its lifetime regardless of demand, and destroyed upon
      freeing it. A properly characterized workload will then be able to
      configure the pool to avoid any latency spikes.
      
      Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzju@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 20220425075723.20019-4-nsaenzju@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      71ad4713
    • Nicolas Saenz Julienne's avatar
      util/main-loop: Introduce the main loop into QOM · 70ac26b9
      Nicolas Saenz Julienne authored
      
      'event-loop-base' provides basic property handling for all 'AioContext'
      based event loops. So let's define a new 'MainLoopClass' that inherits
      from it. This will permit tweaking the main loop's properties through
      qapi as well as through the command line using the '-object' keyword[1].
      Only one instance of 'MainLoopClass' might be created at any time.
      
      'EventLoopBaseClass' learns a new callback, 'can_be_deleted()' so as to
      mark 'MainLoop' as non-deletable.
      
      [1] For example:
            -object main-loop,id=main-loop,aio-max-batch=<value>
      
      Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzju@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 20220425075723.20019-3-nsaenzju@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      70ac26b9
    • Nicolas Saenz Julienne's avatar
      Introduce event-loop-base abstract class · 7d5983e3
      Nicolas Saenz Julienne authored
      
      Introduce the 'event-loop-base' abstract class, it'll hold the
      properties common to all event loops and provide the necessary hooks for
      their creation and maintenance. Then have iothread inherit from it.
      
      EventLoopBaseClass is defined as user creatable and provides a hook for
      its children to attach themselves to the user creatable class 'complete'
      function. It also provides an update_params() callback to propagate
      property changes onto its children.
      
      The new 'event-loop-base' class will live in the root directory. It is
      built on its own using the 'link_whole' option (there are no direct
      function dependencies between the class and its children, it all happens
      trough 'constructor' magic). And also imposes new compilation
      dependencies:
      
          qom <- event-loop-base <- blockdev (iothread.c)
      
      And in subsequent patches:
      
          qom <- event-loop-base <- qemuutil (util/main-loop.c)
      
      All this forced some amount of reordering in meson.build:
      
       - Moved qom build definition before qemuutil. Doing it the other way
         around (i.e. moving qemuutil after qom) isn't possible as a lot of
         core libraries that live in between the two depend on it.
      
       - Process the 'hw' subdir earlier, as it introduces files into the
         'qom' source set.
      
      No functional changes intended.
      
      Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzju@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 20220425075723.20019-2-nsaenzju@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      7d5983e3
  7. Apr 27, 2022
  8. Apr 26, 2022
  9. Apr 25, 2022
  10. Apr 21, 2022
  11. Apr 06, 2022
  12. Apr 05, 2022
Loading