qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Simplify cpu_exec_all to tcg_exec_all
@ 2011-09-26  7:40 Jan Kiszka
  2011-11-01 10:00 ` Jun Koi
  2011-11-01 16:21 ` Anthony Liguori
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Kiszka @ 2011-09-26  7:40 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel

After the removal of the non-threaded mode cpu_exec_all is now only used
by TCG. Refactor it accordingly, also dropping its unused return value.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 cpus.c |   14 +++++---------
 cpus.h |    1 -
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/cpus.c b/cpus.c
index 8978779..f983033 100644
--- a/cpus.c
+++ b/cpus.c
@@ -664,6 +664,8 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
     return NULL;
 }
 
+static void tcg_exec_all(void);
+
 static void *qemu_tcg_cpu_thread_fn(void *arg)
 {
     CPUState *env = arg;
@@ -685,7 +687,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
     }
 
     while (1) {
-        cpu_exec_all();
+        tcg_exec_all();
         if (use_icount && qemu_next_icount_deadline() <= 0) {
             qemu_notify_event();
         }
@@ -925,7 +927,7 @@ static int tcg_cpu_exec(CPUState *env)
     return ret;
 }
 
-bool cpu_exec_all(void)
+static void tcg_exec_all(void)
 {
     int r;
 
@@ -942,12 +944,7 @@ bool cpu_exec_all(void)
                           (env->singlestep_enabled & SSTEP_NOTIMER) == 0);
 
         if (cpu_can_run(env)) {
-            if (kvm_enabled()) {
-                r = kvm_cpu_exec(env);
-                qemu_kvm_eat_signals(env);
-            } else {
-                r = tcg_cpu_exec(env);
-            }
+            r = tcg_cpu_exec(env);
             if (r == EXCP_DEBUG) {
                 cpu_handle_guest_debug(env);
                 break;
@@ -957,7 +954,6 @@ bool cpu_exec_all(void)
         }
     }
     exit_request = 0;
-    return !all_cpu_threads_idle();
 }
 
 void set_numa_modes(void)
diff --git a/cpus.h b/cpus.h
index 5885885..bb91684 100644
--- a/cpus.h
+++ b/cpus.h
@@ -15,7 +15,6 @@ void cpu_synchronize_all_post_init(void);
 /* vl.c */
 extern int smp_cores;
 extern int smp_threads;
-bool cpu_exec_all(void);
 void set_numa_modes(void);
 void set_cpu_log(const char *optarg);
 void set_cpu_log_filename(const char *optarg);
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] Simplify cpu_exec_all to tcg_exec_all
  2011-09-26  7:40 [Qemu-devel] [PATCH] Simplify cpu_exec_all to tcg_exec_all Jan Kiszka
@ 2011-11-01 10:00 ` Jun Koi
  2011-11-01 13:42   ` Jan Kiszka
  2011-11-01 16:21 ` Anthony Liguori
  1 sibling, 1 reply; 4+ messages in thread
From: Jun Koi @ 2011-11-01 10:00 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Anthony Liguori, qemu-devel

i have sent a patch, which duplicated the function of this patch.

this one was not approved yet??

thanks,
Jun

On Mon, Sep 26, 2011 at 3:40 PM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> After the removal of the non-threaded mode cpu_exec_all is now only used
> by TCG. Refactor it accordingly, also dropping its unused return value.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  cpus.c |   14 +++++---------
>  cpus.h |    1 -
>  2 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/cpus.c b/cpus.c
> index 8978779..f983033 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -664,6 +664,8 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
>     return NULL;
>  }
>
> +static void tcg_exec_all(void);
> +
>  static void *qemu_tcg_cpu_thread_fn(void *arg)
>  {
>     CPUState *env = arg;
> @@ -685,7 +687,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
>     }
>
>     while (1) {
> -        cpu_exec_all();
> +        tcg_exec_all();
>         if (use_icount && qemu_next_icount_deadline() <= 0) {
>             qemu_notify_event();
>         }
> @@ -925,7 +927,7 @@ static int tcg_cpu_exec(CPUState *env)
>     return ret;
>  }
>
> -bool cpu_exec_all(void)
> +static void tcg_exec_all(void)
>  {
>     int r;
>
> @@ -942,12 +944,7 @@ bool cpu_exec_all(void)
>                           (env->singlestep_enabled & SSTEP_NOTIMER) == 0);
>
>         if (cpu_can_run(env)) {
> -            if (kvm_enabled()) {
> -                r = kvm_cpu_exec(env);
> -                qemu_kvm_eat_signals(env);
> -            } else {
> -                r = tcg_cpu_exec(env);
> -            }
> +            r = tcg_cpu_exec(env);
>             if (r == EXCP_DEBUG) {
>                 cpu_handle_guest_debug(env);
>                 break;
> @@ -957,7 +954,6 @@ bool cpu_exec_all(void)
>         }
>     }
>     exit_request = 0;
> -    return !all_cpu_threads_idle();
>  }
>
>  void set_numa_modes(void)
> diff --git a/cpus.h b/cpus.h
> index 5885885..bb91684 100644
> --- a/cpus.h
> +++ b/cpus.h
> @@ -15,7 +15,6 @@ void cpu_synchronize_all_post_init(void);
>  /* vl.c */
>  extern int smp_cores;
>  extern int smp_threads;
> -bool cpu_exec_all(void);
>  void set_numa_modes(void);
>  void set_cpu_log(const char *optarg);
>  void set_cpu_log_filename(const char *optarg);
> --
> 1.7.3.4
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] Simplify cpu_exec_all to tcg_exec_all
  2011-11-01 10:00 ` Jun Koi
@ 2011-11-01 13:42   ` Jan Kiszka
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2011-11-01 13:42 UTC (permalink / raw)
  To: Jun Koi; +Cc: Anthony Liguori, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 234 bytes --]

On 2011-11-01 11:00, Jun Koi wrote:
> i have sent a patch, which duplicated the function of this patch.
> 
> this one was not approved yet??

I assume my patch is in some queue, just waiting to be reviewed and applied.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] Simplify cpu_exec_all to tcg_exec_all
  2011-09-26  7:40 [Qemu-devel] [PATCH] Simplify cpu_exec_all to tcg_exec_all Jan Kiszka
  2011-11-01 10:00 ` Jun Koi
@ 2011-11-01 16:21 ` Anthony Liguori
  1 sibling, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2011-11-01 16:21 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel

On 09/26/2011 02:40 AM, Jan Kiszka wrote:
> After the removal of the non-threaded mode cpu_exec_all is now only used
> by TCG. Refactor it accordingly, also dropping its unused return value.
>
> Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   cpus.c |   14 +++++---------
>   cpus.h |    1 -
>   2 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/cpus.c b/cpus.c
> index 8978779..f983033 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -664,6 +664,8 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
>       return NULL;
>   }
>
> +static void tcg_exec_all(void);
> +
>   static void *qemu_tcg_cpu_thread_fn(void *arg)
>   {
>       CPUState *env = arg;
> @@ -685,7 +687,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
>       }
>
>       while (1) {
> -        cpu_exec_all();
> +        tcg_exec_all();
>           if (use_icount&&  qemu_next_icount_deadline()<= 0) {
>               qemu_notify_event();
>           }
> @@ -925,7 +927,7 @@ static int tcg_cpu_exec(CPUState *env)
>       return ret;
>   }
>
> -bool cpu_exec_all(void)
> +static void tcg_exec_all(void)
>   {
>       int r;
>
> @@ -942,12 +944,7 @@ bool cpu_exec_all(void)
>                             (env->singlestep_enabled&  SSTEP_NOTIMER) == 0);
>
>           if (cpu_can_run(env)) {
> -            if (kvm_enabled()) {
> -                r = kvm_cpu_exec(env);
> -                qemu_kvm_eat_signals(env);
> -            } else {
> -                r = tcg_cpu_exec(env);
> -            }
> +            r = tcg_cpu_exec(env);
>               if (r == EXCP_DEBUG) {
>                   cpu_handle_guest_debug(env);
>                   break;
> @@ -957,7 +954,6 @@ bool cpu_exec_all(void)
>           }
>       }
>       exit_request = 0;
> -    return !all_cpu_threads_idle();
>   }
>
>   void set_numa_modes(void)
> diff --git a/cpus.h b/cpus.h
> index 5885885..bb91684 100644
> --- a/cpus.h
> +++ b/cpus.h
> @@ -15,7 +15,6 @@ void cpu_synchronize_all_post_init(void);
>   /* vl.c */
>   extern int smp_cores;
>   extern int smp_threads;
> -bool cpu_exec_all(void);
>   void set_numa_modes(void);
>   void set_cpu_log(const char *optarg);
>   void set_cpu_log_filename(const char *optarg);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-01 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-26  7:40 [Qemu-devel] [PATCH] Simplify cpu_exec_all to tcg_exec_all Jan Kiszka
2011-11-01 10:00 ` Jun Koi
2011-11-01 13:42   ` Jan Kiszka
2011-11-01 16:21 ` Anthony Liguori

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).