From patchwork Fri Dec 19 11:53:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 422864 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5DF9D1400A0 for ; Fri, 19 Dec 2014 22:54:21 +1100 (AEDT) Received: from localhost ([::1]:57990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1w8R-0004vt-D9 for incoming@patchwork.ozlabs.org; Fri, 19 Dec 2014 06:54:19 -0500 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 Received: from playground.com (ovpn-112-26.ams2.redhat.com [10.36.112.26]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBJBrGPV004994; Fri, 19 Dec 2014 06:53:20 -0500 From: Paolo Bonzini To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: imammedo@redhat.com, ehabkost@redhat.com, dgilbert@redhat.com Subject: [Qemu-devel] [PATCH 1/2] cpu: initialize cpu->exception_index on reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Tested-by: Eduardo Habkost --- 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 *)); }