qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>,
	qemu-block@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Subject: Re: [PATCH 3/3] sysemu/replay: Restrict icount to system emulation
Date: Thu, 7 Dec 2023 14:46:25 +0100	[thread overview]
Message-ID: <41f23b62-15ae-4e1e-98ee-a3cbcf0f7789@linaro.org> (raw)
In-Reply-To: <20231207102632.33634-4-philmd@linaro.org>

On 7/12/23 11:26, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/sysemu/cpu-timers.h |  2 +-
>   include/sysemu/replay.h     |  9 ++++++---
>   stubs/icount.c              | 19 -------------------
>   3 files changed, 7 insertions(+), 23 deletions(-)
> 
> diff --git a/include/sysemu/cpu-timers.h b/include/sysemu/cpu-timers.h
> index 2e786fe7fb..188f67ee90 100644
> --- a/include/sysemu/cpu-timers.h
> +++ b/include/sysemu/cpu-timers.h
> @@ -24,7 +24,7 @@ void cpu_timers_init(void);
>    * 1 = Enabled - Fixed conversion of insn to ns via "shift" option
>    * 2 = Enabled - Runtime adaptive algorithm to compute shift
>    */
> -#ifdef CONFIG_TCG
> +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
>   extern int use_icount;
>   #define icount_enabled() (use_icount)
>   #else
> diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
> index 02fa75c783..8102fa54f0 100644
> --- a/include/sysemu/replay.h
> +++ b/include/sysemu/replay.h
> @@ -1,6 +1,3 @@
> -#ifndef SYSEMU_REPLAY_H
> -#define SYSEMU_REPLAY_H
> -
>   /*
>    * QEMU replay (system interface)
>    *
> @@ -11,6 +8,12 @@
>    * See the COPYING file in the top-level directory.
>    *
>    */
> +#ifndef SYSEMU_REPLAY_H
> +#define SYSEMU_REPLAY_H
> +
> +#ifdef CONFIG_USER_ONLY
> +#error Cannot include this header from user emulation
> +#endif
>   
>   #include "exec/replay-core.h"
>   #include "qapi/qapi-types-misc.h"
> diff --git a/stubs/icount.c b/stubs/icount.c
> index c39a65da92..ec8d150069 100644
> --- a/stubs/icount.c
> +++ b/stubs/icount.c
> @@ -5,30 +5,11 @@
>   
>   int use_icount;
>   
> -void icount_update(CPUState *cpu)
> -{
> -    abort();
> -}
>   int64_t icount_get_raw(void)
>   {
>       abort();
>       return 0;
>   }
> -int64_t icount_get(void)
> -{
> -    abort();
> -    return 0;
> -}
> -int64_t icount_to_ns(int64_t icount)
> -{
> -    abort();
> -    return 0;
> -}

Build failure on HVF due to:

   pmu_init()
    -> pm_events[]
     -> INST_RETIRED
      -> instructions_ns_per()
       -> icount_to_ns()

So we need to keep the icount_to_ns() stub until we restrict
ARM PMU code to TCG.




  reply	other threads:[~2023-12-07 13:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 10:26 [PATCH 0/3] sysemu/replay: Restrict icount to TCG system emulation Philippe Mathieu-Daudé
2023-12-07 10:26 ` [PATCH 1/3] util/async: Only call icount_notify_exit() if icount is enabled Philippe Mathieu-Daudé
2023-12-07 10:26 ` [PATCH 2/3] sysemu/replay: Restrict icount to TCG emulation Philippe Mathieu-Daudé
2023-12-07 10:26 ` [PATCH 3/3] sysemu/replay: Restrict icount to system emulation Philippe Mathieu-Daudé
2023-12-07 13:46   ` Philippe Mathieu-Daudé [this message]
2023-12-07 13:51     ` Philippe Mathieu-Daudé

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=41f23b62-15ae-4e1e-98ee-a3cbcf0f7789@linaro.org \
    --to=philmd@linaro.org \
    --cc=fam@euphon.net \
    --cc=pavel.dovgaluk@ispras.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).