From patchwork Thu Oct 3 14:09:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juergen Lock X-Patchwork-Id: 280375 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EE4892C00CE for ; Fri, 4 Oct 2013 01:52:49 +1000 (EST) Received: from localhost ([::1]:43910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRlCp-0007pK-E0 for incoming@patchwork.ozlabs.org; Thu, 03 Oct 2013 11:52:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRjiX-0002fs-2f for qemu-devel@nongnu.org; Thu, 03 Oct 2013 10:17:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRjiS-0002EL-7X for qemu-devel@nongnu.org; Thu, 03 Oct 2013 10:17:25 -0400 Received: from gelbbaer.kn-bremen.de ([78.46.108.116]:45460 helo=smtp.kn-bremen.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRjiS-0002Dp-1C for qemu-devel@nongnu.org; Thu, 03 Oct 2013 10:17:20 -0400 Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 341911E007BB; Thu, 3 Oct 2013 16:17:18 +0200 (CEST) Received: from enceladus10.kn-bremen.de (noident@localhost [127.0.0.1]) by enceladus10.kn-bremen.de (8.14.5/8.14.5) with ESMTP id r93E9c0a059767; Thu, 3 Oct 2013 16:09:39 +0200 (CEST) (envelope-from qemu-l@enceladus10.kn-bremen.de) Received: (from qemu-l@localhost) by enceladus10.kn-bremen.de (8.14.5/8.14.5/Submit) id r93E9cno059766; Thu, 3 Oct 2013 16:09:38 +0200 (CEST) (envelope-from qemu-l) From: Juergen Lock Date: Thu, 3 Oct 2013 16:09:37 +0200 To: qemu-devel@nongnu.org Message-ID: <20131003140937.GA59761@enceladus10.kn-bremen.de> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 78.46.108.116 X-Mailman-Approved-At: Thu, 03 Oct 2013 11:52:23 -0400 Cc: Jan Kiszka , Dimitry Andric , Andreas Faerber Subject: [Qemu-devel] [PATCH] cpu-exec(): also reload CPUClass *cc after longjmp return 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 Local variable CPUClass *cc needs to be reloaded after return from longjmp too. (This fixes the mips-softmmu crash observed on FreeBSD when qemu is built with clang.) Signed-off-by: Juergen Lock Found-by: Dimitry Andric --- a/cpu-exec.c +++ b/cpu-exec.c @@ -681,6 +681,10 @@ int cpu_exec(CPUArchState *env) * local variables as longjmp is marked 'noreturn'. */ cpu = current_cpu; env = cpu->env_ptr; +#if !(defined(CONFIG_USER_ONLY) && \ + (defined(TARGET_M68K) || defined(TARGET_PPC) || defined(TARGET_S390X))) + cc = CPU_GET_CLASS(cpu); +#endif } } /* for(;;) */