From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmREF-0006V5-GT for qemu-devel@nongnu.org; Sun, 15 Jan 2012 09:38:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmREE-0005xU-Ab for qemu-devel@nongnu.org; Sun, 15 Jan 2012 09:38:39 -0500 Received: from mail-yw0-f45.google.com ([209.85.213.45]:50754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmREE-0005wf-6x for qemu-devel@nongnu.org; Sun, 15 Jan 2012 09:38:38 -0500 Received: by yhr47 with SMTP id 47so1106582yhr.4 for ; Sun, 15 Jan 2012 06:38:37 -0800 (PST) Message-ID: <4F12E4E4.8030001@codemonkey.ws> Date: Sun, 15 Jan 2012 08:38:28 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <4F117F49.1090208@web.de> In-Reply-To: <4F117F49.1090208@web.de> Content-Type: multipart/mixed; boundary="------------080009070600050802010809" Subject: Re: [Qemu-devel] [PATCH] isapc: Fix segfault during initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel This is a multi-part message in MIME format. --------------080009070600050802010809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 01/14/2012 07:12 AM, Jan Kiszka wrote: > From: Jan Kiszka > > Linking the RTC device state to the PIIX does not belong into the > common path that is shared with the isapc. QEMU crashes otherwise. > > Signed-off-by: Jan Kiszka Does isapc actually work for you? I tried to write a qemu-test test case (attached below) to help prevent future regressions. I can reproduce your SEGV but with your patch applied, I get no output (not even the BIOS runs). Here's the command line. Even a simple 'qemu-system-x86_64 -M isapc' reproduces it: /home/anthony/build/qemu/x86_64-softmmu/qemu-system-x86_64 -kernel bin/vmlinuz-3.0 -initrd .tmp-3510/initramfs-3510.img.gz -append console=ttyS0 seed=24689 -M isapc -pidfile .tmp-3510/pidfile-3510.pid -qmp unix:.tmp-3510/qmpsock-3510.sock,server,nowait Regards, Anthony Liguori > --- > hw/pc_piix.c | 22 +++++++++++----------- > 1 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/hw/pc_piix.c b/hw/pc_piix.c > index b70431f..3aea3cc 100644 > --- a/hw/pc_piix.c > +++ b/hw/pc_piix.c > @@ -201,6 +201,17 @@ static void pc_init1(MemoryRegion *system_memory, > } > idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0"); > idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1"); > + > + /* FIXME there's some major spaghetti here. Somehow we create the > + * devices on the PIIX before we actually create it. We create the > + * PIIX3 deep in the recess of the i440fx creation too and then lose > + * the DeviceState. > + * > + * For now, let's "fix" this by making judicious use of paths. This > + * is not generally the right way to do this. > + */ > + qdev_property_add_child(qdev_resolve_path("/i440fx/piix3", NULL), > + "rtc", (DeviceState *)rtc_state, NULL); > } else { > for(i = 0; i< MAX_IDE_BUS; i++) { > ISADevice *dev; > @@ -211,17 +222,6 @@ static void pc_init1(MemoryRegion *system_memory, > } > } > > - /* FIXME there's some major spaghetti here. Somehow we create the devices > - * on the PIIX before we actually create it. We create the PIIX3 deep in > - * the recess of the i440fx creation too and then lose the DeviceState. > - * > - * For now, let's "fix" this by making judicious use of paths. This is not > - * generally the right way to do this. > - */ > - > - qdev_property_add_child(qdev_resolve_path("/i440fx/piix3", NULL), > - "rtc", (DeviceState *)rtc_state, NULL); > - > audio_init(isa_bus, pci_enabled ? pci_bus : NULL); > > pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, --------------080009070600050802010809 Content-Type: application/x-shellscript; name="isapc.sh" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="isapc.sh" IyEvYmluL3NoCgppbl9ob3N0KCkgewogICAgcWVtdSAtTSBpc2FwYwp9Cgppbl9ndWVzdCgp IHsKICAgIDoKfQoKaWYgdGVzdCAkUUVNVV9URVNUOyB0aGVuCiAgICBpbl9ob3N0CmVsc2UK ICAgIGluX2d1ZXN0CmZpCg== --------------080009070600050802010809--