From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1w7f-0003YQ-Dw for qemu-devel@nongnu.org; Fri, 19 Dec 2014 06:53:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1w7X-0007Wj-Bq for qemu-devel@nongnu.org; Fri, 19 Dec 2014 06:53:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1w7X-0007WV-4a for qemu-devel@nongnu.org; Fri, 19 Dec 2014 06:53:23 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBJBrMci028481 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 19 Dec 2014 06:53:22 -0500 From: Paolo Bonzini Date: Fri, 19 Dec 2014 12:53:13 +0100 Message-Id: <1418989994-17244-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1418989994-17244-1-git-send-email-pbonzini@redhat.com> References: <1418989994-17244-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] cpu: initialize cpu->exception_index on reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: imammedo@redhat.com, ehabkost@redhat.com, dgilbert@redhat.com This unbreaks linux-user (broken by e511b4d, cpu-exec: reset exception_index correctly, 2014-11-26). Reported-by: Eduardo Habkost Signed-off-by: Paolo Bonzini --- cpus.c | 3 --- qom/cpu.c | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cpus.c b/cpus.c index 1b5168a..2edb5cd 100644 --- a/cpus.c +++ b/cpus.c @@ -940,7 +940,6 @@ 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; cpu->can_do_io = 1; current_cpu = cpu; @@ -982,7 +981,6 @@ 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; cpu->can_do_io = 1; sigemptyset(&waitset); @@ -1026,7 +1024,6 @@ 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; cpu->can_do_io = 1; } qemu_cond_signal(&qemu_cpu_cond); diff --git a/qom/cpu.c b/qom/cpu.c index 79d2228..9c68fa4 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -249,6 +249,7 @@ static void cpu_common_reset(CPUState *cpu) cpu->icount_extra = 0; cpu->icount_decr.u32 = 0; cpu->can_do_io = 0; + cpu->exception_index = -1; memset(cpu->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof(void *)); } -- 1.8.3.1