Skip to content
Snippets Groups Projects
  1. Jun 05, 2023
  2. Jun 02, 2023
    • Eric Blake's avatar
      cutils: Adjust signature of parse_uint[_full] · bd1386cc
      Eric Blake authored
      
      It's already confusing that we have two very similar functions for
      wrapping the parse of a 64-bit unsigned value, differing mainly on
      whether they permit leading '-'.  Adjust the signature of parse_uint()
      and parse_uint_full() to be like all of qemu_strto*(): put the result
      parameter last, use the same types (uint64_t and unsigned long long
      have the same width, but are not always the same type), and mark
      endptr const (this latter change only affects the rare caller of
      parse_uint).  Adjust all callers in the tree.
      
      While at it, note that since cutils.c already includes:
      
          QEMU_BUILD_BUG_ON(sizeof(int64_t) != sizeof(long long));
      
      we are guaranteed that the result of parse_uint* cannot exceed
      UINT64_MAX (or the build would have failed), so we can drop
      pre-existing dead comparisons in opts-visitor.c that were never false.
      
      Reviewed-by: default avatarHanna Czenczek <hreitz@redhat.com>
      Message-Id: <20230522190441.64278-8-eblake@redhat.com>
      [eblake: Drop dead code spotted by Markus]
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      bd1386cc
  3. Jun 01, 2023
    • Vladimir Sementsov-Ogievskiy's avatar
      runstate: drop unused runstate_store() · e76005a0
      Vladimir Sementsov-Ogievskiy authored
      
      The function is unused since previous commit. Drop it.
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Message-Id: <20230517123752.21615-4-vsementsov@yandex-team.ru>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      e76005a0
    • Vladimir Sementsov-Ogievskiy's avatar
      migration: never fail in global_state_store() · c33f1829
      Vladimir Sementsov-Ogievskiy authored
      
      Actually global_state_store() can never fail. Let's get rid of extra
      error paths.
      
      To make things clear, use new runstate_get() and use same approach for
      global_state_store() and global_state_store_running().
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Message-Id: <20230517123752.21615-3-vsementsov@yandex-team.ru>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      c33f1829
    • Vladimir Sementsov-Ogievskiy's avatar
      runstate: add runstate_get() · 242b74eb
      Vladimir Sementsov-Ogievskiy authored
      
      It's necessary to restore the state after failed/cancelled migration in
      further commit.
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Message-Id: <20230517123752.21615-2-vsementsov@yandex-team.ru>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      242b74eb
    • Alex Bennée's avatar
      accel/tcg: include cs_base in our hash calculations · 367189ef
      Alex Bennée authored
      
      We weren't using cs_base in the hash calculations before. Since the
      arm front end moved a chunk of flags in a378206a (target/arm: Move
      mode specific TB flags to tb->cs_base) they comprise of an important
      part of the execution state.
      
      Widen the tb_hash_func to include cs_base and expand to qemu_xxhash8()
      to accommodate it.
      
      My initial benchmark shows very little difference in the
      runtime.
      
      Before:
      
      armhf
      
      ➜  hyperfine -w 2 -m 20 "./arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine type=virt,highmem=off -display none -m 2048 -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf -device scsi-hd,drive=hd -smp 4 -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' -snapshot"
      Benchmark 1: ./arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine type=virt,highmem=off -display none -m 2048 -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf -device scsi-hd,drive=hd -smp 4 -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' -snapshot
        Time (mean ± σ):     24.627 s ±  2.708 s    [User: 34.309 s, System: 1.797 s]
        Range (min … max):   22.345 s … 29.864 s    20 runs
      
      arm64
      
      ➜  hyperfine -w 2 -n 20 "./qemu-system-aarch64 -cpu max,pauth-impdef=on -machine type=virt,virtualization=on,gic-version=3 -display none -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22,hostfwd=tcp::1234-:1234 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-arm64 -device scsi-hd,drive=hd -smp 4 -kernel ~/lsrc/linux.git/builds/arm64/arch/arm64/boot/Image.gz -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark-pigz.service' -snapshot"
      Benchmark 1: 20
        Time (mean ± σ):     62.559 s ±  2.917 s    [User: 189.115 s, System: 4.089 s]
        Range (min … max):   59.997 s … 70.153 s    10 runs
      
      After:
      
      armhf
      
      Benchmark 1: ./arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine type=virt,highmem=off -display none -m 2048 -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf -device scsi-hd,drive=hd -smp 4 -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' -snapshot
        Time (mean ± σ):     24.223 s ±  2.151 s    [User: 34.284 s, System: 1.906 s]
        Range (min … max):   22.000 s … 28.476 s    20 runs
      
      arm64
      
      hyperfine -w 2 -n 20 "./qemu-system-aarch64 -cpu max,pauth-impdef=on -machine type=virt,virtualization=on,gic-version=3 -display none -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22,hostfwd=tcp::1234-:1234 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-arm64 -device scsi-hd,drive=hd -smp 4 -kernel ~/lsrc/linux.git/builds/arm64/arch/arm64/boot/Image.gz -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark-pigz.service' -snapshot"
      Benchmark 1: 20
        Time (mean ± σ):     62.769 s ±  1.978 s    [User: 188.431 s, System: 5.269 s]
        Range (min … max):   60.285 s … 66.868 s    10 runs
      
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20230526165401.574474-12-alex.bennee@linaro.org
      Message-Id: <20230524133952.3971948-11-alex.bennee@linaro.org>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      367189ef
    • Alex Bennée's avatar
      tcg: remove the final vestiges of dstate · d0aaf08b
      Alex Bennée authored
      Now we no longer have dynamic state affecting things we can remove the
      additional fields in cpu.h and simplify the TB hash calculation.
      
      For the benchmark:
      
          hyperfine -w 2 -m 20 \
            "./arm-softmmu/qemu-system-arm -cpu cortex-a15 \
              -machine type=virt,highmem=off \
              -display none -m 2048 \
              -serial mon:stdio \
              -netdev user,id=unet,hostfwd=tcp::2222-:22 \
              -device virtio-net-pci,netdev=unet \
              -device virtio-scsi-pci \
              -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf \
              -device scsi-hd,drive=hd -smp 4 \
              -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage \
              -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' \
              -snapshot"
      
      It has a marginal effect on runtime, before:
      
        Time (mean ± σ):     26.279 s ±  2.438 s    [User: 41.113 s, System: 1.843 s]
        Range (min … max):   24.420 s … 32.565 s    20 runs
      
      after:
      
        Time (mean ± σ):     24.440 s ±  2.885 s    [User: 34.474 s, System: 2.028 s]
        Range (min … max):   21.663 s … 29.937 s    20 runs
      
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1358
      
      
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Message-id: 20230526165401.574474-10-alex.bennee@linaro.org
      Message-Id: <20230524133952.3971948-9-alex.bennee@linaro.org>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      d0aaf08b
    • Alex Bennée's avatar
      *-user: remove the guest_user_syscall tracepoints · 2e2097b4
      Alex Bennée authored
      
      This is pure duplication now. Both bsd-user and linux-user have
      builtin strace support and we can also track syscalls via the plugins
      system.
      
      Reviewed-by: default avatarWarner Losh <imp@bsdimp.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Message-id: 20230526165401.574474-2-alex.bennee@linaro.org
      Message-Id: <20230524133952.3971948-2-alex.bennee@linaro.org>
      [Remove unused variable in do_freebsd_syscall() reported by Richard
      Henderson.
      --Stefan]
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      2e2097b4
    • Stefan Hajnoczi's avatar
      block: remove bdrv_co_io_plug() API · 2a0d7cb6
      Stefan Hajnoczi authored
      
      No block driver implements .bdrv_co_io_plug() anymore. Get rid of the
      function pointers.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Acked-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-id: 20230530180959.1108766-7-stefanha@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      2a0d7cb6
    • Stefan Hajnoczi's avatar
      block/linux-aio: convert to blk_io_plug_call() API · 07668288
      Stefan Hajnoczi authored
      
      Stop using the .bdrv_co_io_plug() API because it is not multi-queue
      block layer friendly. Use the new blk_io_plug_call() API to batch I/O
      submission instead.
      
      Note that a dev_max_batch check is dropped in laio_io_unplug() because
      the semantics of unplug_fn() are different from .bdrv_co_unplug():
      1. unplug_fn() is only called when the last blk_io_unplug() call occurs,
         not every time blk_io_unplug() is called.
      2. unplug_fn() is per-thread, not per-BlockDriverState, so there is no
         way to get per-BlockDriverState fields like dev_max_batch.
      
      Therefore this condition cannot be moved to laio_unplug_fn(). It is not
      obvious that this condition affects performance in practice, so I am
      removing it instead of trying to come up with a more complex mechanism
      to preserve the condition.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Acked-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Message-id: 20230530180959.1108766-6-stefanha@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      07668288
    • Stefan Hajnoczi's avatar
      block/io_uring: convert to blk_io_plug_call() API · 6a6da231
      Stefan Hajnoczi authored
      
      Stop using the .bdrv_co_io_plug() API because it is not multi-queue
      block layer friendly. Use the new blk_io_plug_call() API to batch I/O
      submission instead.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Acked-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-id: 20230530180959.1108766-5-stefanha@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      6a6da231
    • Stefan Hajnoczi's avatar
      block: add blk_io_plug_call() API · 41abca8c
      Stefan Hajnoczi authored
      
      Introduce a new API for thread-local blk_io_plug() that does not
      traverse the block graph. The goal is to make blk_io_plug() multi-queue
      friendly.
      
      Instead of having block drivers track whether or not we're in a plugged
      section, provide an API that allows them to defer a function call until
      we're unplugged: blk_io_plug_call(fn, opaque). If blk_io_plug_call() is
      called multiple times with the same fn/opaque pair, then fn() is only
      called once at the end of the function - resulting in batching.
      
      This patch introduces the API and changes blk_io_plug()/blk_io_unplug().
      blk_io_plug()/blk_io_unplug() no longer require a BlockBackend argument
      because the plug state is now thread-local.
      
      Later patches convert block drivers to blk_io_plug_call() and then we
      can finally remove .bdrv_co_io_plug() once all block drivers have been
      converted.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Acked-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-id: 20230530180959.1108766-2-stefanha@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      41abca8c
  4. May 30, 2023
  5. May 28, 2023
Loading