[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 03/38] cpu-exec: set current_cpu at cpu_exec()
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC 03/38] cpu-exec: set current_cpu at cpu_exec() |
Date: |
Sun, 23 Aug 2015 18:03:15 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 23/08/2015 17:23, Emilio G. Cota wrote:
> So that it applies to usermode as well.
>
> Signed-off-by: Emilio G. Cota <address@hidden>
> ---
> cpu-exec.c | 2 ++
> cpus.c | 1 -
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/cpu-exec.c b/cpu-exec.c
> index b8a11e1..2b9a447 100644
> --- a/cpu-exec.c
> +++ b/cpu-exec.c
> @@ -386,6 +386,8 @@ int cpu_exec(CPUState *cpu)
> uintptr_t next_tb;
> SyncClocks sc;
>
> + current_cpu = cpu;
> +
> #ifndef CONFIG_USER_ONLY
> /* FIXME: user-mode emulation probably needs a similar mechanism as well,
> * for example for tb_flush.
> diff --git a/cpus.c b/cpus.c
> index 5484ce6..0fe6576 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -1079,7 +1079,6 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
> cpu->thread_id = qemu_get_thread_id();
> cpu->created = true;
> cpu->can_do_io = 1;
> - current_cpu = cpu;
>
> qemu_cond_signal(&qemu_cpu_cond);
Please set it somewhere in linux-user/ and bsd-user/ instead, I would
like to keep the TCG code more similar to KVM/Xen/qtest. Probably the whole
qemu_thread_get_self(cpu->thread);
cpu->thread_id = qemu_get_thread_id();
cpu->created = true;
cpu->can_do_io = 1;
current_cpu = cpu;
should be moved into a new function (rcu_register_thread too?).
Paolo
[Qemu-devel] [RFC 04/38] translate-all: remove volatile from have_tb_lock, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 06/38] seqlock: add missing 'inline' to seqlock_read_retry, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 02/38] hw/i386/kvmvapic: add missing include of tcg.h, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 01/38] cpu-exec: add missing mmap_lock in tb_find_slow, Emilio G. Cota, 2015/08/23