qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC v4 03/14] cpus: extract out TCG-specific code to accel/tcg


From: Philippe Mathieu-Daudé
Subject: Re: [RFC v4 03/14] cpus: extract out TCG-specific code to accel/tcg
Date: Wed, 12 Aug 2020 18:06:44 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 8/11/20 11:03 PM, Claudio Fontana wrote:
> TCG is the first accelerator to register a "CpusAccel" interface
> on initialization, providing functions for starting a vcpu,
> kicking a vcpu, sychronizing state and getting virtual clock
> and ticks.
> 
> Signed-off-by: Claudio Fontana <cfontana@suse.de>
> ---
>  accel/tcg/Makefile.objs |   1 +
>  accel/tcg/tcg-all.c     |  12 +-
>  accel/tcg/tcg-cpus.c    | 541 
> ++++++++++++++++++++++++++++++++++++++++++++++++
>  accel/tcg/tcg-cpus.h    |  17 ++
>  softmmu/cpus.c          | 498 +-------------------------------------------
>  5 files changed, 568 insertions(+), 501 deletions(-)
>  create mode 100644 accel/tcg/tcg-cpus.c
>  create mode 100644 accel/tcg/tcg-cpus.h
[...]
>  /***********************************************************/
>  void hw_error(const char *fmt, ...)
>  {
> @@ -328,9 +247,7 @@ int64_t cpus_get_virtual_clock(void)
>      if (cpus_accel && cpus_accel->get_virtual_clock) {
>          return cpus_accel->get_virtual_clock();
>      }
> -    if (icount_enabled()) {
> -        return icount_get();
> -    } else if (qtest_enabled()) { /* for qtest_clock_warp */
> +    if (qtest_enabled()) { /* for qtest_clock_warp */
>          return qtest_get_virtual_clock();
>      }
>      return cpu_get_clock();
> @@ -338,7 +255,7 @@ int64_t cpus_get_virtual_clock(void)
>  
>  /*
>   * return the time elapsed in VM between vm_start and vm_stop.  Unless
> - * icount is active, cpu_get_ticks() uses units of the host CPU cycle
> + * icount is active, cpus_get_elapsed_ticks() uses units of the host CPU 
> cycle

This change belongs to the previous patch, otherwise:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>   * counter.
>   */
>  int64_t cpus_get_elapsed_ticks(void)
> @@ -346,9 +263,6 @@ int64_t cpus_get_elapsed_ticks(void)
>      if (cpus_accel && cpus_accel->get_elapsed_ticks) {
>          return cpus_accel->get_elapsed_ticks();
>      }
> -    if (icount_enabled()) {
> -        return icount_get();
> -    }
>      return cpu_get_ticks();
>  }
>  
> @@ -482,10 +396,6 @@ static void qemu_kvm_destroy_vcpu(CPUState *cpu)
>      }
>  }
>  
> -static void qemu_tcg_destroy_vcpu(CPUState *cpu)
> -{
> -}
> -
>  static void qemu_cpu_stop(CPUState *cpu, bool exit)
>  {
>      g_assert(qemu_cpu_is_self(cpu));
> @@ -506,22 +416,6 @@ void qemu_wait_io_event_common(CPUState *cpu)
>      process_queued_cpu_work(cpu);
>  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]