[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 26/47] cpu-exec: reset exception_index correctly
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PULL 26/47] cpu-exec: reset exception_index correctly |
Date: |
Fri, 19 Dec 2014 00:19:16 -0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Mon, Dec 15, 2014 at 05:38:10PM +0100, Paolo Bonzini wrote:
> From: Pavel Dovgalyuk <address@hidden>
>
> Exception index is reset at every entry at every entry into cpu_exec()
> function. This may cause missing the exceptions while replaying them.
> This patch moves exception_index reset to the locations where they are
> processed.
>
> Signed-off-by: Pavel Dovgalyuk <address@hidden>
> Signed-off-by: Paolo Bonzini <address@hidden>
x86_64-linux-user is broken after applying this patch:
[qemu/(e511b4d...)|BISECTING]$ ./install/bin/qemu-x86_64 /bin/true
qemu: uncaught target signal 8 (Floating point exception) - core dumped
Floating point exception (core dumped)
> ---
> cpu-exec.c | 3 ++-
> cpus.c | 3 +++
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/cpu-exec.c b/cpu-exec.c
> index 8830255..4df9856 100644
> --- a/cpu-exec.c
> +++ b/cpu-exec.c
> @@ -358,7 +358,6 @@ int cpu_exec(CPUArchState *env)
> }
>
> cc->cpu_exec_enter(cpu);
> - cpu->exception_index = -1;
>
> /* Calculate difference between guest clock and host clock.
> * This delay includes the delay of the last cycle, so
> @@ -378,6 +377,7 @@ int cpu_exec(CPUArchState *env)
> if (ret == EXCP_DEBUG) {
> cpu_handle_debug_exception(env);
> }
> + cpu->exception_index = -1;
> break;
> } else {
> #if defined(CONFIG_USER_ONLY)
> @@ -388,6 +388,7 @@ int cpu_exec(CPUArchState *env)
> cc->do_interrupt(cpu);
> #endif
> ret = cpu->exception_index;
> + cpu->exception_index = -1;
> break;
> #else
> cc->do_interrupt(cpu);
> diff --git a/cpus.c b/cpus.c
> index 0c33458..91119bb 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -934,6 +934,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
> qemu_mutex_lock(&qemu_global_mutex);
> qemu_thread_get_self(cpu->thread);
> cpu->thread_id = qemu_get_thread_id();
> + cpu->exception_index = -1;
> current_cpu = cpu;
>
> r = kvm_init_vcpu(cpu);
> @@ -974,6 +975,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
> qemu_mutex_lock_iothread();
> qemu_thread_get_self(cpu->thread);
> cpu->thread_id = qemu_get_thread_id();
> + cpu->exception_index = -1;
>
> sigemptyset(&waitset);
> sigaddset(&waitset, SIG_IPI);
> @@ -1016,6 +1018,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
> CPU_FOREACH(cpu) {
> cpu->thread_id = qemu_get_thread_id();
> cpu->created = true;
> + cpu->exception_index = -1;
> }
> qemu_cond_signal(&qemu_cpu_cond);
>
> --
> 1.8.3.1
>
>
>
--
Eduardo
- [Qemu-devel] [PULL 15/47] target-mips: kvm: do not use get_clock(), (continued)
- [Qemu-devel] [PULL 15/47] target-mips: kvm: do not use get_clock(), Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 18/47] x86: Fuse g_malloc(); memset() into g_malloc0(), Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 17/47] x86: Drop superfluous conditionals around g_free(), Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 19/47] x86: Use g_new() & friends where that makes obvious sense, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 20/47] x86: Drop some superfluous casts from void *, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 21/47] scsi: Drop superfluous conditionals around g_free(), Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 22/47] scsi: Fuse g_malloc(); memset() into g_malloc0(), Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 23/47] scsi: Use g_new() & friends where that makes obvious sense, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 24/47] scsi-disk: provide maximum transfer length, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 26/47] cpu-exec: reset exception_index correctly, Paolo Bonzini, 2014/12/15
- Re: [Qemu-devel] [PULL 26/47] cpu-exec: reset exception_index correctly,
Eduardo Habkost <=
- [Qemu-devel] [PULL 27/47] icount: set can_do_io outside TB execution, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 25/47] cpu-exec: fix cpu_exec_nocache, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 28/47] icount: introduce cpu_get_icount_raw, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 29/47] cpu-exec: invalidate nocache translation if they are interrupted, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 30/47] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 31/47] cpus: make icount warp behave well with respect to stop/cont, Paolo Bonzini, 2014/12/15