From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNxLG-00022A-38 for qemu-devel@nongnu.org; Tue, 08 Nov 2011 20:52:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNxLD-0003t3-ST for qemu-devel@nongnu.org; Tue, 08 Nov 2011 20:52:42 -0500 Received: from cantor2.suse.de ([195.135.220.15]:37198 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNxLD-0003so-J4 for qemu-devel@nongnu.org; Tue, 08 Nov 2011 20:52:39 -0500 Message-ID: <4EB9DCE0.3070509@suse.de> Date: Wed, 09 Nov 2011 02:52:32 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <4EB90714.4020709@suse.de> <20111109014118.GF8168@truffala.fritz.box> In-Reply-To: <20111109014118.GF8168@truffala.fritz.box> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [TestDay] ppc64 pseries segfault List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: qemu-devel Developers , Alexander Graf Am 09.11.2011 02:41, schrieb David Gibson: > On Tue, Nov 08, 2011 at 11:40:20AM +0100, Andreas F=E4rber wrote: >> Hello, >> >> On openSUSE 12.1 RC2 x86_64 host >> >> $ ppc64-softmmu/qemu-system-ppc64 -M pseries -L .../pc-bios >> >> segfaults. Backtrace: >> >> Program received signal SIGSEGV, Segmentation fault. >> 0x0000000000578a7e in spapr_create_phb (spapr=3D0x1247f80, busname=3D >> 0x77f1b2 "pci", buid=3D, mem_win_addr=3D, >> mem_win_size=3D536870912, io_win_addr=3D1101659111424) >> at /home/andreas/QEMU/qemu/hw/spapr_pci.c:306 >> 306 QLIST_INSERT_HEAD(&spapr->phbs, phb, list); >> (gdb) bt >> #0 0x0000000000578a7e in spapr_create_phb (spapr=3D0x1247f80, busname= =3D >> 0x77f1b2 "pci", buid=3D, mem_win_addr=3D, >> mem_win_size=3D536870912, io_win_addr=3D1101659111424) >> at /home/andreas/QEMU/qemu/hw/spapr_pci.c:306 >> #1 0x00000000005760f8 in ppc_spapr_init (ram_size=3D134217728, boot_d= evice=3D >> 0x7fffffffdd50 "cad", kernel_filename=3D0x0, kernel_cmdline=3D0x69= d000 "", >> initrd_filename=3D0x0, cpu_model=3D0x7ab640 "POWER7") >> at /home/andreas/QEMU/qemu/hw/spapr.c:507 >> #2 0x000000000040a4a9 in main (argc=3D, argv=3D, >> envp=3D) at /home/andreas/QEMU/qemu/vl.c:3340 >> >> I'd expect seeing SLOF boot. >=20 > That'll be due to the missing initialization of the sPAPREnvironment > structure, and the phbs_list in particular. I sent a fix for it, but > I'm wondering if something went wrong with the mail, because no-one > replied and now I can't seem to find it in the qemu-devel archives. Thanks. No, I remember reading it now. Just expected all such bug fixes for 1.0 to be in rc1 already. Unfortunate timing for the big Test Day. Andreas >=20 > From cbcfb3b04ec8306697509a48dada8fed07dcdc28 Mon Sep 17 00:00:00 2001 > From: David Gibson > Date: Wed, 2 Nov 2011 12:20:25 +1100 > Subject: [PATCH] pseries: Fix initialization of sPAPREnvironment struct= ure >=20 > Since we added PCI support to the pseries machine, we include a qlist o= f > PCI host bridges in the sPAPREnvironment structure. However this list > was never properly initialized it. Somehow we got away with this until > some other recent change broke it, and we now segfault immediately on > startup. >=20 > This patch adds the required QLIST_INIT(), and while we're at it makes = sure > we initialize the rest of the sPAPREnvironment structure to 0, to avoid > future nasty surprises. >=20 > Signed-off-by: David Gibson > --- > hw/spapr.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) >=20 > diff --git a/hw/spapr.c b/hw/spapr.c > index bdaa938..40cfc9b 100644 > --- a/hw/spapr.c > +++ b/hw/spapr.c > @@ -407,7 +407,9 @@ static void ppc_spapr_init(ram_addr_t ram_size, > long pteg_shift =3D 17; > char *filename; > =20 > - spapr =3D g_malloc(sizeof(*spapr)); > + spapr =3D g_malloc0(sizeof(*spapr)); > + QLIST_INIT(&spapr->phbs); > + > cpu_ppc_hypercall =3D emulate_spapr_hypercall; > =20 > /* Allocate RMA if necessary */ --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg