qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Elisha Hollander <just4now666666@gmail.com>
Cc: qemu-devel@nongnu.org,
	 Richard Henderson <richard.henderson@linaro.org>,
	 Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 1/1] allow using a higher icount
Date: Tue, 03 Sep 2024 11:21:58 +0100	[thread overview]
Message-ID: <87jzftdol5.fsf@draig.linaro.org> (raw)
In-Reply-To: <CACkyd_YpxVdGC04cEEPr4O44P+FQ9P51T32AtBxCmOVV1b9f-g@mail.gmail.com> (Elisha Hollander's message of "Tue, 3 Sep 2024 10:06:03 +0300")

Elisha Hollander <just4now666666@gmail.com> writes:

> Sure!
>
> `build/qemu-system-i386 -plugin build/contrib/plugins/libips.so,ips=1 -display curses -bios bios.raw`
>
> Also, I just tested with 9.1.0-rc4 and it resulted with
> `tcg.c:3167:remove_label_use: code should not be reached`

I can replicate but it seems to be an edge case with ips=1, try a higher
number, even ips=10 doesn't trigger the crash (but 10 instructions a
second is very slow to do anything).

  ./qemu-system-i386  -plugin contrib/plugins/libips.so,ips=1 -display none -serial mon:stdio
  **
  ERROR:../../tcg/tcg.c:3167:remove_label_use: code should not be reached
  Bail out! ERROR:../../tcg/tcg.c:3167:remove_label_use: code should not be reached
  fish: Job 1, './qemu-system-i386  -plugin con…' terminated by signal SIGABRT (Abort)


>
> On Mon, Sep 2, 2024, 16:08 Alex Bennée <alex.bennee@linaro.org> wrote:
>
>  Elisha Hollander <just4now666666@gmail.com> writes:
>
>  > But for qemu_plugin_update_ns
>  >
>  > On Mon, Sep 2, 2024, 15:38 Elisha Hollander <just4now666666@gmail.com> wrote:
>  >
>  >  Just checked with 9.0.2 it it still gives the error...
>  >
>  >  On Wed, Aug 28, 2024, 14:05 Alex Bennée <alex.bennee@linaro.org> wrote:
>  >
>  >  Elisha Hollander <just4now666666@gmail.com> writes:
>  >
>  >  > Although it gives `undefined symbol: qemu_plugin_scoreboard_free`. But
>  >  > probably I messed something up...
>  >
>  >  Are you using an older QEMU? We should trigger an API warning if they
>  >  are mismatched but maybe thats not working.
>  >
>  >  >
>  >  > On Tue, Aug 27, 2024, 14:59 Elisha Hollander <just4now666666@gmail.com> wrote:
>  >  >
>  >  >  Oh nice, I didn't know that
>  >  >
>  >  >  On Tue, Aug 27, 2024, 12:39 Alex Bennée <alex.bennee@linaro.org> wrote:
>  >  >
>  >  >  Elisha Hollander <just4now666666@gmail.com> writes:
>  >  >
>  >  >  > Signed-off-by: Elisha Hollander <just4now666666@gmail.com>
>  >  >
>  >  >  What is the use-case for this patch?
>  >  >
>  >  >  If you are simply looking to slow the emulated system down please have a
>  >  >  look at:
>  >  >
>  >  >    https://qemu.readthedocs.io/en/master/about/emulation.html#limit-instructions-per-second
>  >  >
>  >  >  which uses the plugin system to limit the run rate and sleep if its
>  >  >  running too fast. The longer term goal is to deprecate the icount clock
>  >  >  alignment feature from the core code and leave icount to just provide
>  >  >  the deterministic execution needed for record/replay and reverse
>  >  >  debugging.
>  >  >
>  >  >  > ---
>  >  >  >  accel/tcg/cpu-exec.c      | 4 +---
>  >  >  >  accel/tcg/icount-common.c | 4 ++--
>  >  >  >  2 files changed, 3 insertions(+), 5 deletions(-)
>  >  >  >
>  >  >  > diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
>  >  >  > index 8163295f34..4c2baf8ed4 100644
>  >  >  > --- a/accel/tcg/cpu-exec.c
>  >  >  > +++ b/accel/tcg/cpu-exec.c
>  >  >  > @@ -95,11 +95,10 @@ static void align_clocks(SyncClocks *sc, CPUState *cpu)
>  >  >  >  static void print_delay(const SyncClocks *sc)
>  >  >  >  {
>  >  >  >      static float threshold_delay;
>  >  >  > -    static int64_t last_realtime_clock;
>  >  >  >      static int nb_prints;
>  >  >  >  
>  >  >  >      if (icount_align_option &&
>  >  >  > -        sc->realtime_clock - last_realtime_clock >= MAX_DELAY_PRINT_RATE &&
>  >  >  > +        sc->diff_clk >= MAX_DELAY_PRINT_RATE &&
>  >  >  >          nb_prints < MAX_NB_PRINTS) {
>  >  >  >          if ((-sc->diff_clk / (float)1000000000LL > threshold_delay) ||
>  >  >  >              (-sc->diff_clk / (float)1000000000LL <
>  >  >  > @@ -109,7 +108,6 @@ static void print_delay(const SyncClocks *sc)
>  >  >  >                          threshold_delay - 1,
>  >  >  >                          threshold_delay);
>  >  >  >              nb_prints++;
>  >  >  > -            last_realtime_clock = sc->realtime_clock;
>  >  >  >          }
>  >  >  >      }
>  >  >  >  }
>  >  >  > diff --git a/accel/tcg/icount-common.c b/accel/tcg/icount-common.c
>  >  >  > index 8d3d3a7e9d..f07f8baf4d 100644
>  >  >  > --- a/accel/tcg/icount-common.c
>  >  >  > +++ b/accel/tcg/icount-common.c
>  >  >  > @@ -46,8 +46,8 @@
>  >  >  >   * is TCG-specific, and does not need to be built for other accels.
>  >  >  >   */
>  >  >  >  static bool icount_sleep = true;
>  >  >  > -/* Arbitrarily pick 1MIPS as the minimum allowable speed.  */
>  >  >  > -#define MAX_ICOUNT_SHIFT 10
>  >  >  > +/* Arbitrarily pick the minimum allowable speed.  */
>  >  >  > +#define MAX_ICOUNT_SHIFT 30
>  >  >  >  
>  >  >  >  /* Do not count executed instructions */
>  >  >  >  ICountMode use_icount = ICOUNT_DISABLED;
>  >  >
>  >  >  -- 
>  >  >  Alex Bennée
>  >  >  Virtualisation Tech Lead @ Linaro
>  >
>  >  -- 
>  >  Alex Bennée
>  >  Virtualisation Tech Lead @ Linaro
>
>  Can you give me your command line please?
>
>  -- 
>  Alex Bennée
>  Virtualisation Tech Lead @ Linaro

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2024-09-03 12:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-16 16:20 [PATCH 1/1] allow using a higher icount Elisha Hollander
2024-08-24 19:46 ` Elisha Hollander
2024-08-27  9:38 ` Alex Bennée
2024-08-27 11:59   ` Elisha Hollander
2024-08-28 10:36     ` Elisha Hollander
2024-08-28 11:05       ` Alex Bennée
2024-09-02 12:38         ` Elisha Hollander
2024-09-02 12:38           ` Elisha Hollander
2024-09-02 13:08             ` Alex Bennée
2024-09-03  7:06               ` Elisha Hollander
2024-09-03 10:21                 ` Alex Bennée [this message]
2024-09-03 11:13                   ` Alex Bennée
2024-09-03 15:28                     ` Elisha Hollander
2024-09-13 10:06                       ` Alex Bennée
2024-09-18 15:15                         ` Elisha Hollander
2024-09-18 15:15                         ` Elisha Hollander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzftdol5.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=just4now666666@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).