Re: [Qemu-devel] [PATCH v4 07/35] HACK: Always enable parallel_cpus

2016-10-05 Thread Richard Henderson

On 10/04/2016 06:29 AM, Alex Bennée wrote:

Can we replace with:

linux-user: enable parallel code generation on clone

The variable parallel_cpus controls the generation of thread aware
atomic code. We only need to set it once we have cloned our first
thread. At this point any existing translations need to be thrown away.

Signed-off-by: Alex Bennée 


The hack was simply for testing and has outlasted its usefulness anyway.

Applied.


r~



Re: [Qemu-devel] [PATCH v4 07/35] HACK: Always enable parallel_cpus

2016-10-04 Thread Alex Bennée

Richard Henderson  writes:

> This is really just a placeholder for an actual
> command-line switch for mttcg.
> ---
>  translate-all.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/translate-all.c b/translate-all.c
> index 70f3959..c860cfc 100644
> --- a/translate-all.c
> +++ b/translate-all.c
> @@ -119,7 +119,7 @@ static void *l1_map[V_L1_SIZE];
>
>  /* code generation context */
>  TCGContext tcg_ctx;
> -bool parallel_cpus;
> +bool parallel_cpus = 1;
>
>  /* translation block context */
>  #ifdef CONFIG_USER_ONLY

Can we replace with:

linux-user: enable parallel code generation on clone

The variable parallel_cpus controls the generation of thread aware
atomic code. We only need to set it once we have cloned our first
thread. At this point any existing translations need to be thrown away.

Signed-off-by: Alex Bennée 

2 files changed, 10 insertions(+), 1 deletion(-)
linux-user/syscall.c | 9 +
translate-all.c  | 2 +-

modified   linux-user/syscall.c
@@ -6144,6 +6144,15 @@ static int do_fork(CPUArchState *env, unsigned int 
flags, abi_ulong newsp,
 sigfillset();
 sigprocmask(SIG_BLOCK, , );

+/* If this is our first additional thread we need to ensure we
+ * generate code for parallel execution and flush the old
+ * translations.
+ */
+if (!parallel_cpus) {
+parallel_cpus = true;
+tb_flush(cpu);
+}
+
 ret = pthread_create(, , clone_func, );
 /* TODO: Free new CPU state if thread creation failed.  */

modified   translate-all.c
@@ -119,7 +119,7 @@ static void *l1_map[V_L1_SIZE];

 /* code generation context */
 TCGContext tcg_ctx;
-bool parallel_cpus = 1;
+bool parallel_cpus;

 /* translation block context */
 #ifdef CONFIG_USER_ONLY



[Qemu-devel] [PATCH v4 07/35] HACK: Always enable parallel_cpus

2016-09-16 Thread Richard Henderson
This is really just a placeholder for an actual
command-line switch for mttcg.
---
 translate-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/translate-all.c b/translate-all.c
index 70f3959..c860cfc 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -119,7 +119,7 @@ static void *l1_map[V_L1_SIZE];
 
 /* code generation context */
 TCGContext tcg_ctx;
-bool parallel_cpus;
+bool parallel_cpus = 1;
 
 /* translation block context */
 #ifdef CONFIG_USER_ONLY
-- 
2.5.5