Skip to content
Snippets Groups Projects
  1. Jun 20, 2023
  2. May 28, 2023
  3. May 11, 2023
    • Jamie Iles's avatar
      accel/tcg/tcg-accel-ops-rr: ensure fairness with icount · 83ecdb18
      Jamie Iles authored
      
      The round-robin scheduler will iterate over the CPU list with an
      assigned budget until the next timer expiry and may exit early because
      of a TB exit.  This is fine under normal operation but with icount
      enabled and SMP it is possible for a CPU to be starved of run time and
      the system live-locks.
      
      For example, booting a riscv64 platform with '-icount
      shift=0,align=off,sleep=on -smp 2' we observe a livelock once the kernel
      has timers enabled and starts performing TLB shootdowns.  In this case
      we have CPU 0 in M-mode with interrupts disabled sending an IPI to CPU
      1.  As we enter the TCG loop, we assign the icount budget to next timer
      interrupt to CPU 0 and begin executing where the guest is sat in a busy
      loop exhausting all of the budget before we try to execute CPU 1 which
      is the target of the IPI but CPU 1 is left with no budget with which to
      execute and the process repeats.
      
      We try here to add some fairness by splitting the budget across all of
      the CPUs on the thread fairly before entering each one.  The CPU count
      is cached on CPU list generation ID to avoid iterating the list on each
      loop iteration.  With this change it is possible to boot an SMP rv64
      guest with icount enabled and no hangs.
      
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Tested-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarJamie Iles <quic_jiles@quicinc.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20230427020925.51003-3-quic_jiles@quicinc.com>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      83ecdb18
  4. Feb 23, 2023
    • Markus Armbruster's avatar
      replay: Simplify setting replay blockers · 0ec8384f
      Markus Armbruster authored
      
      replay_add_blocker() takes an Error *.  All callers pass one created
      like this:
      
          error_setg(&blocker, QERR_REPLAY_NOT_SUPPORTED, "some feature");
      
      Folding this into replay_add_blocker() simplifies the callers, losing
      a bit of generality we haven't needed in more than six years.
      
      Since there are no other uses of macro QERR_REPLAY_NOT_SUPPORTED,
      replace the remaining one by its expansion, and drop the macro.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20230207075115.1525-10-armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      0ec8384f
  5. Dec 14, 2022
    • Markus Armbruster's avatar
      qapi replay: Elide redundant has_FOO in generated C · d01c0046
      Markus Armbruster authored
      
      The has_FOO for pointer-valued FOO are redundant, except for arrays.
      They are also a nuisance to work with.  Recent commit "qapi: Start to
      elide redundant has_FOO in generated C" provided the means to elide
      them step by step.  This is the step for qapi/replay.json.
      
      Said commit explains the transformation in more detail.  The invariant
      violations mentioned there do not occur here.
      
      Cc: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Message-Id: <20221104160712.3005652-22-armbru@redhat.com>
      d01c0046
    • Markus Armbruster's avatar
      cleanup: Tweak and re-run return_directly.cocci · 66997c42
      Markus Armbruster authored
      
      Tweak the semantic patch to drop redundant parenthesis around the
      return expression.
      
      Coccinelle drops a comment in hw/rdma/vmw/pvrdma_cmd.c; restored
      manually.
      
      Coccinelle messes up vmdk_co_create(), not sure why.  Change dropped,
      will be done manually in the next commit.
      
      Line breaks in target/avr/cpu.h and hw/rdma/vmw/pvrdma_cmd.c tidied up
      manually.
      
      Whitespace in tools/virtiofsd/fuse_lowlevel.c tidied up manually.
      
      checkpatch.pl complains "return of an errno should typically be -ve"
      two times for hw/9pfs/9p-synth.c.  Preexisting, the patch merely makes
      it visible to checkpatch.pl.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20221122134917.1217307-2-armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Acked-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      66997c42
  6. Nov 29, 2022
  7. Oct 03, 2022
  8. Sep 29, 2022
  9. Jun 06, 2022
  10. Mar 21, 2022
  11. Apr 01, 2021
    • Pavel Dovgalyuk's avatar
      replay: notify CPU on event · 46967b1a
      Pavel Dovgalyuk authored
      
      This patch enables vCPU notification to wake it up
      when new async event comes in replay mode.
      
      The motivation of this patch is the following.
      Consider recorded block async event. It is saved into the log
      with one of the checkpoints. This checkpoint may be passed in
      vCPU loop. In replay mode when this async event is read from
      the log, and block thread task is not finished yet, vCPU thread
      goes to sleep. That is why this patch adds waking up the vCPU
      to process this finished event.
      
      Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
      Message-Id: <161726519158.1476949.7614181684462079836.stgit@pasha-ThinkPad-X280>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      46967b1a
    • Pavel Dovgalyuk's avatar
      replay: fix recursive checkpoints · 7cebff0d
      Pavel Dovgalyuk authored
      
      Record/replay uses checkpoints to synchronize the execution
      of the threads and timers. Hardware events such as BH are
      processed at the checkpoints too.
      Event processing can cause refreshing the virtual timers
      and calling the icount-related functions, that also use checkpoints.
      This patch prevents recursive processing of such checkpoints,
      because they have their own records in the log and should be
      processed later.
      
      Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
      Message-Id: <161700476500.1140362.10108444973730452257.stgit@pasha-ThinkPad-X280>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7cebff0d
  12. Feb 16, 2021
    • Pavel Dovgalyuk's avatar
      replay: fix icount request when replaying clock access · 366a85e4
      Pavel Dovgalyuk authored
      
      Record/replay provides REPLAY_CLOCK_LOCKED macro to access
      the clock when vm_clock_seqlock is locked. This macro is
      needed because replay internals operate icount. In locked case
      replay use icount_get_raw_locked for icount request, which prevents
      excess locking which leads to deadlock. But previously only
      record code used *_locked function and replay did not.
      Therefore sometimes clock access lead to deadlocks.
      This patch fixes clock access for replay too and uses *_locked
      icount access function.
      
      Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
      Message-Id: <161347990483.1313189.8371838968343494161.stgit@pasha-ThinkPad-X280>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      366a85e4
  13. Feb 08, 2021
  14. Jan 08, 2021
  15. Nov 09, 2020
  16. Oct 22, 2020
    • Claudio Fontana's avatar
      replay: do not build if TCG is not available · 9b1c9116
      Claudio Fontana authored
      
      this fixes non-TCG builds broken recently by replay reverse debugging.
      
      Stub the needed functions in stub/, splitting roughly between functions
      needed only by system emulation, by system emulation and tools,
      and by everyone.  This includes duplicating some code in replay/, and
      puts the logic for non-replay related events in the replay/ module (+
      the stubs), so this should be revisited in the future.
      
      Surprisingly, only _one_ qtest was affected by this, ide-test.c, which
      resulted in a buzz as the bh events were never delivered, and the bh
      never executed.
      
      Many other subsystems _should_ have been affected.
      
      This fixes the immediate issue, however a better way to group replay
      functionality to TCG-only code could be developed in the long term.
      
      Signed-off-by: default avatarClaudio Fontana <cfontana@suse.de>
      Message-Id: <20201013192123.22632-4-cfontana@suse.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9b1c9116
  17. Oct 06, 2020
  18. Oct 05, 2020
  19. Aug 21, 2020
  20. Jun 26, 2020
  21. Jun 12, 2020
    • Pavel Dovgaluk's avatar
      replay: fix replay shutdown for console mode · ed5d7ff3
      Pavel Dovgaluk authored
      
      When QEMU is used without any graphical window,
      QEMU execution is terminated with the signal (e.g., Ctrl-C).
      Signal processing in QEMU does not include
      qemu_system_shutdown_request call. That is why shutdown
      event is not recorded by record/replay in this case.
      This patch adds shutdown event to the end of the record log.
      Now every replay will shutdown the machine at the end.
      
      Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
      Message-Id: <159012995470.27967.18129611453659045726.stgit@pasha-ThinkPad-X280>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ed5d7ff3
Loading