From patchwork Sun Oct 2 18:44:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 117359 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BE8471007D8 for ; Mon, 3 Oct 2011 05:45:09 +1100 (EST) Received: from localhost ([::1]:60193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAR27-0005DP-4Y for incoming@patchwork.ozlabs.org; Sun, 02 Oct 2011 14:45:03 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAR20-0005BH-E7 for qemu-devel@nongnu.org; Sun, 02 Oct 2011 14:44:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAR1y-0002UP-WD for qemu-devel@nongnu.org; Sun, 02 Oct 2011 14:44:56 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:63755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAR1y-0002UL-Ss for qemu-devel@nongnu.org; Sun, 02 Oct 2011 14:44:54 -0400 Received: by qadb10 with SMTP id b10so1640477qad.4 for ; Sun, 02 Oct 2011 11:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=dIjpD+6urcXkNsXyMJzWoSuuEQTQtBVWL7lAmPLOaUQ=; b=wXTmdcWEtTYDzbLCjoEkq/eh2pqXblhLcFX3WATM6Y2kfUMo3LZ9bde3UZ2zDuIKk5 kCA01Y/eXSexXQhpViG6Z59zd0rGbH3hgbZcKkX2c8TREN89Jv1ZCow5rT8/fPXKq5+x wYvIYfhMROVArnLV7lxafn1kMlMarLShwQMLY= Received: by 10.224.217.72 with SMTP id hl8mr11200035qab.359.1317581094119; Sun, 02 Oct 2011 11:44:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.6.129 with HTTP; Sun, 2 Oct 2011 11:44:34 -0700 (PDT) In-Reply-To: <4E88732C.3080101@redhat.com> References: <4E88732C.3080101@redhat.com> From: Blue Swirl Date: Sun, 2 Oct 2011 18:44:34 +0000 Message-ID: To: Avi Kivity X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.216.45 Cc: qemu-devel Subject: Re: [Qemu-devel] segfault on current HEAD, qemu-system-arm 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 On Sun, Oct 2, 2011 at 2:20 PM, Avi Kivity wrote: > 3917149 gives me this: > > [root@westmere-ep arm-test]# gdb --args qemu-system-arm -kernel > zImage.integrator -initrd arm_root.img > GNU gdb (GDB) Fedora (7.3-41.fc15) > Copyright (C) 2011 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law.  Type "show copying" > and "show warranty" for details. > This GDB was configured as "x86_64-redhat-linux-gnu". > For bug reporting instructions, please see: > ... > Reading symbols from /usr/local/bin/qemu-system-arm...done. > (gdb) r > Starting program: /usr/local/bin/qemu-system-arm -kernel zImage.integrator > -initrd arm_root.img > [Thread debugging using libthread_db enabled] > [New Thread 0x7ffff4a5d700 (LWP 12467)] > > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 0x7ffff4a5d700 (LWP 12467)] > 0x00000000005bcee6 in get_phys_addr (env=0x0, address=0, access_type=2, > is_user=0, phys_ptr=0x7ffff4a5c994, prot=0x7ffff4a5c99c, page_size= >    0x7ffff4a5c998) at /home/tlv/akivity/qemu/target-arm/helper.c:1275 > 1275            address += env->cp15.c13_fcse; > Missing separate debuginfos, use: debuginfo-install > SDL-1.2.14-11.fc15.x86_64 bzip2-libs-1.0.6-3.fc15.x86_64 > celt051-0.5.1.3-3.fc15.x86_64 cyrus-sasl-lib-2.1.23-18.fc15.x86_64 > glib2-2.28.8-1.fc15.x86_64 glibc-2.14-5.x86_64 > keyutils-libs-1.2-7.fc15.x86_64 krb5-libs-1.9.1-5.fc15.x86_64 > libX11-1.4.3-1.fc15.x86_64 libXau-1.0.6-2.fc15.x86_64 > libXcursor-1.1.11-3.fc15.x86_64 libXext-1.2.0-2.fc15.x86_64 > libXfixes-5.0-1.fc15.x86_64 libXrandr-1.3.1-2.fc15.x86_64 > libXrender-0.9.6-2.fc15.x86_64 libcom_err-1.41.14-2.fc15.x86_64 > libcurl-7.21.3-9.fc15.x86_64 libgcc-4.6.0-10.fc15.x86_64 > libidn-1.19-2.fc15.x86_64 libjpeg-turbo-1.1.1-1.fc15.x86_64 > libpng-1.2.46-1.fc15.x86_64 libselinux-2.0.99-4.fc15.x86_64 > libssh2-1.2.7-1.fc15.x86_64 libxcb-1.7-2.fc15.x86_64 > ncurses-libs-5.8-2.20110319.fc15.x86_64 nspr-4.8.8-1.fc15.x86_64 > nss-3.12.10-5.fc15.x86_64 nss-softokn-freebl-3.12.10-2.fc15.x86_64 > nss-util-3.12.10-1.fc15.x86_64 openldap-2.4.24-3.fc15.x86_64 > openssl-1.0.0d-1.fc15.x86_64 pixman-0.20.2-2.fc15.x86_64 > spice-server-0.8.1-1.fc15.x86_64 xen-libs-4.1.1-3.fc15.x86_64 > xz-libs-5.0.3-1.fc15.x86_64 zlib-1.2.5-3.fc15.x86_64 > (gdb) bt > #0  0x00000000005bcee6 in get_phys_addr (env=0x0, address=0, access_type=2, > is_user=0, phys_ptr=0x7ffff4a5c994, prot=0x7ffff4a5c99c, page_size= >    0x7ffff4a5c998) at /home/tlv/akivity/qemu/target-arm/helper.c:1275 > #1  0x00000000005bd036 in cpu_arm_handle_mmu_fault (env=0x0, address=0, > access_type=2, mmu_idx=0) >    at /home/tlv/akivity/qemu/target-arm/helper.c:1305 Bah, bug in bccd9ec5f098668576342c83d90d6d6833d61d33, target-arm/op_helper.c missed this change unlike all other targets: if (retaddr) { > #2  0x000000000061ceba in tlb_fill (env1=0x1293c40, addr=0, is_write=2, > mmu_idx=0, retaddr=0x0) >    at /home/tlv/akivity/qemu/target-arm/op_helper.c:87 > #3  0x00000000005a0a99 in __ldb_cmmu (addr=0, mmu_idx=0) at > /home/tlv/akivity/qemu/softmmu_template.h:139 > #4  0x00000000005934c9 in ldub_code (ptr=0) at > /home/tlv/akivity/qemu/softmmu_header.h:96 > #5  0x00000000005935ad in get_page_addr_code (env1=0x1293c40, addr=0) at > /home/tlv/akivity/qemu/exec-all.h:333 > #6  0x0000000000593889 in tb_find_slow (env=0x1293c40, pc=0, cs_base=0, > flags=64) at /home/tlv/akivity/qemu/cpu-exec.c:95 > #7  0x0000000000593ae4 in tb_find_fast (env=0x1293c40) at > /home/tlv/akivity/qemu/cpu-exec.c:151 > #8  0x0000000000593f0a in cpu_arm_exec (env=0x1293c40) at > /home/tlv/akivity/qemu/cpu-exec.c:533 > #9  0x0000000000596007 in tcg_cpu_exec (env=0x1293c40) at > /home/tlv/akivity/qemu/cpus.c:913 > #10 0x0000000000596113 in cpu_exec_all () at > /home/tlv/akivity/qemu/cpus.c:949 > #11 0x00000000005957ec in qemu_tcg_cpu_thread_fn (arg=0x1293c40) at > /home/tlv/akivity/qemu/cpus.c:688 > #12 0x000000341d407b31 in start_thread () from /lib64/libpthread.so.0 > #13 0x000000341d0dfd2d in clone () from /lib64/libc.so.6 > > -- > error compiling committee.c: too many arguments to function > > > Reviewed-by: Peter Maydell diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c index ab9c923..1892b35 100644 --- a/target-arm/op_helper.c +++ b/target-arm/op_helper.c @@ -84,6 +84,7 @@ void tlb_fill(CPUState *env1, target_ulong addr, int is_write, int mmu_idx, int ret; saved_env = env; + env = env1; ret = cpu_arm_handle_mmu_fault(env, addr, is_write, mmu_idx); if (unlikely(ret)) {