qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [TestDay] ppc64 pseries segfault
@ 2011-11-08 10:40 Andreas Färber
  2011-11-09  1:36 ` Andreas Färber
  2011-11-09  1:41 ` David Gibson
  0 siblings, 2 replies; 6+ messages in thread
From: Andreas Färber @ 2011-11-08 10:40 UTC (permalink / raw)
  To: qemu-devel Developers; +Cc: Alexander Graf, David Gibson

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=0x1247f80, busname=
    0x77f1b2 "pci", buid=<optimized out>, mem_win_addr=<optimized out>,
    mem_win_size=536870912, io_win_addr=1101659111424)
    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=0x1247f80, busname=
    0x77f1b2 "pci", buid=<optimized out>, mem_win_addr=<optimized out>,
    mem_win_size=536870912, io_win_addr=1101659111424)
    at /home/andreas/QEMU/qemu/hw/spapr_pci.c:306
#1  0x00000000005760f8 in ppc_spapr_init (ram_size=134217728, boot_device=
    0x7fffffffdd50 "cad", kernel_filename=0x0, kernel_cmdline=0x69d000 "",
    initrd_filename=0x0, cpu_model=0x7ab640 "POWER7")
    at /home/andreas/QEMU/qemu/hw/spapr.c:507
#2  0x000000000040a4a9 in main (argc=<optimized out>, argv=<optimized out>,
    envp=<optimized out>) at /home/andreas/QEMU/qemu/vl.c:3340

I'd expect seeing SLOF boot.

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [TestDay] ppc64 pseries segfault
  2011-11-08 10:40 [Qemu-devel] [TestDay] ppc64 pseries segfault Andreas Färber
@ 2011-11-09  1:36 ` Andreas Färber
  2011-11-09  1:41 ` David Gibson
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2011-11-09  1:36 UTC (permalink / raw)
  To: qemu-devel Developers; +Cc: Alexander Graf, David Gibson

Am 08.11.2011 11:40, schrieb Andreas Färber:
> $ ppc64-softmmu/qemu-system-ppc64 -M pseries -L .../pc-bios
> 
> segfaults. Backtrace:
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000000578a7e in spapr_create_phb (spapr=0x1247f80, busname=
>     0x77f1b2 "pci", buid=<optimized out>, mem_win_addr=<optimized out>,
>     mem_win_size=536870912, io_win_addr=1101659111424)
>     at /home/andreas/QEMU/qemu/hw/spapr_pci.c:306
> 306	    QLIST_INSERT_HEAD(&spapr->phbs, phb, list);

Fixed by http://patchwork.ozlabs.org/patch/123204/

Apparently not all outstanding patches were pulled into rc1.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [TestDay] ppc64 pseries segfault
  2011-11-08 10:40 [Qemu-devel] [TestDay] ppc64 pseries segfault Andreas Färber
  2011-11-09  1:36 ` Andreas Färber
@ 2011-11-09  1:41 ` David Gibson
  2011-11-09  1:46   ` Alexander Graf
  2011-11-09  1:52   ` Andreas Färber
  1 sibling, 2 replies; 6+ messages in thread
From: David Gibson @ 2011-11-09  1:41 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-devel Developers, Alexander Graf

On Tue, Nov 08, 2011 at 11:40:20AM +0100, Andreas Färber 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=0x1247f80, busname=
>     0x77f1b2 "pci", buid=<optimized out>, mem_win_addr=<optimized out>,
>     mem_win_size=536870912, io_win_addr=1101659111424)
>     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=0x1247f80, busname=
>     0x77f1b2 "pci", buid=<optimized out>, mem_win_addr=<optimized out>,
>     mem_win_size=536870912, io_win_addr=1101659111424)
>     at /home/andreas/QEMU/qemu/hw/spapr_pci.c:306
> #1  0x00000000005760f8 in ppc_spapr_init (ram_size=134217728, boot_device=
>     0x7fffffffdd50 "cad", kernel_filename=0x0, kernel_cmdline=0x69d000 "",
>     initrd_filename=0x0, cpu_model=0x7ab640 "POWER7")
>     at /home/andreas/QEMU/qemu/hw/spapr.c:507
> #2  0x000000000040a4a9 in main (argc=<optimized out>, argv=<optimized out>,
>     envp=<optimized out>) at /home/andreas/QEMU/qemu/vl.c:3340
> 
> I'd expect seeing SLOF boot.

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.

>From cbcfb3b04ec8306697509a48dada8fed07dcdc28 Mon Sep 17 00:00:00 2001
From: David Gibson <david@gibson.dropbear.id.au>
Date: Wed, 2 Nov 2011 12:20:25 +1100
Subject: [PATCH] pseries: Fix initialization of sPAPREnvironment structure

Since we added PCI support to the pseries machine, we include a qlist of
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.

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.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/spapr.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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 = 17;
     char *filename;
 
-    spapr = g_malloc(sizeof(*spapr));
+    spapr = g_malloc0(sizeof(*spapr));
+    QLIST_INIT(&spapr->phbs);
+
     cpu_ppc_hypercall = emulate_spapr_hypercall;
 
     /* Allocate RMA if necessary */
-- 
1.7.7.1



-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [TestDay] ppc64 pseries segfault
  2011-11-09  1:41 ` David Gibson
@ 2011-11-09  1:46   ` Alexander Graf
  2011-11-09  1:52   ` Andreas Färber
  1 sibling, 0 replies; 6+ messages in thread
From: Alexander Graf @ 2011-11-09  1:46 UTC (permalink / raw)
  To: David Gibson; +Cc: Andreas Färber, qemu-devel Developers


On 09.11.2011, at 02:41, David Gibson wrote:

> On Tue, Nov 08, 2011 at 11:40:20AM +0100, Andreas Färber 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=0x1247f80, busname=
>>    0x77f1b2 "pci", buid=<optimized out>, mem_win_addr=<optimized out>,
>>    mem_win_size=536870912, io_win_addr=1101659111424)
>>    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=0x1247f80, busname=
>>    0x77f1b2 "pci", buid=<optimized out>, mem_win_addr=<optimized out>,
>>    mem_win_size=536870912, io_win_addr=1101659111424)
>>    at /home/andreas/QEMU/qemu/hw/spapr_pci.c:306
>> #1  0x00000000005760f8 in ppc_spapr_init (ram_size=134217728, boot_device=
>>    0x7fffffffdd50 "cad", kernel_filename=0x0, kernel_cmdline=0x69d000 "",
>>    initrd_filename=0x0, cpu_model=0x7ab640 "POWER7")
>>    at /home/andreas/QEMU/qemu/hw/spapr.c:507
>> #2  0x000000000040a4a9 in main (argc=<optimized out>, argv=<optimized out>,
>>    envp=<optimized out>) at /home/andreas/QEMU/qemu/vl.c:3340
>> 
>> I'd expect seeing SLOF boot.
> 
> 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.

I got it, no worries. It just didn't make it for rc1, but will be in rc2! Sorry for being so unresponsive recently - I was on the road for 3 weeks O_o.


Alex

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [TestDay] ppc64 pseries segfault
  2011-11-09  1:41 ` David Gibson
  2011-11-09  1:46   ` Alexander Graf
@ 2011-11-09  1:52   ` Andreas Färber
  2011-11-09  2:03     ` Alexander Graf
  1 sibling, 1 reply; 6+ messages in thread
From: Andreas Färber @ 2011-11-09  1:52 UTC (permalink / raw)
  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ärber 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=0x1247f80, busname=
>>     0x77f1b2 "pci", buid=<optimized out>, mem_win_addr=<optimized out>,
>>     mem_win_size=536870912, io_win_addr=1101659111424)
>>     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=0x1247f80, busname=
>>     0x77f1b2 "pci", buid=<optimized out>, mem_win_addr=<optimized out>,
>>     mem_win_size=536870912, io_win_addr=1101659111424)
>>     at /home/andreas/QEMU/qemu/hw/spapr_pci.c:306
>> #1  0x00000000005760f8 in ppc_spapr_init (ram_size=134217728, boot_device=
>>     0x7fffffffdd50 "cad", kernel_filename=0x0, kernel_cmdline=0x69d000 "",
>>     initrd_filename=0x0, cpu_model=0x7ab640 "POWER7")
>>     at /home/andreas/QEMU/qemu/hw/spapr.c:507
>> #2  0x000000000040a4a9 in main (argc=<optimized out>, argv=<optimized out>,
>>     envp=<optimized out>) at /home/andreas/QEMU/qemu/vl.c:3340
>>
>> I'd expect seeing SLOF boot.
> 
> 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

> 
> From cbcfb3b04ec8306697509a48dada8fed07dcdc28 Mon Sep 17 00:00:00 2001
> From: David Gibson <david@gibson.dropbear.id.au>
> Date: Wed, 2 Nov 2011 12:20:25 +1100
> Subject: [PATCH] pseries: Fix initialization of sPAPREnvironment structure
> 
> Since we added PCI support to the pseries machine, we include a qlist of
> 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.
> 
> 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.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
>  hw/spapr.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> 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 = 17;
>      char *filename;
>  
> -    spapr = g_malloc(sizeof(*spapr));
> +    spapr = g_malloc0(sizeof(*spapr));
> +    QLIST_INIT(&spapr->phbs);
> +
>      cpu_ppc_hypercall = emulate_spapr_hypercall;
>  
>      /* Allocate RMA if necessary */

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [TestDay] ppc64 pseries segfault
  2011-11-09  1:52   ` Andreas Färber
@ 2011-11-09  2:03     ` Alexander Graf
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Graf @ 2011-11-09  2:03 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-devel Developers, David Gibson


On 09.11.2011, at 02:52, Andreas Färber wrote:

> Am 09.11.2011 02:41, schrieb David Gibson:
>> On Tue, Nov 08, 2011 at 11:40:20AM +0100, Andreas Färber 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=0x1247f80, busname=
>>>    0x77f1b2 "pci", buid=<optimized out>, mem_win_addr=<optimized out>,
>>>    mem_win_size=536870912, io_win_addr=1101659111424)
>>>    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=0x1247f80, busname=
>>>    0x77f1b2 "pci", buid=<optimized out>, mem_win_addr=<optimized out>,
>>>    mem_win_size=536870912, io_win_addr=1101659111424)
>>>    at /home/andreas/QEMU/qemu/hw/spapr_pci.c:306
>>> #1  0x00000000005760f8 in ppc_spapr_init (ram_size=134217728, boot_device=
>>>    0x7fffffffdd50 "cad", kernel_filename=0x0, kernel_cmdline=0x69d000 "",
>>>    initrd_filename=0x0, cpu_model=0x7ab640 "POWER7")
>>>    at /home/andreas/QEMU/qemu/hw/spapr.c:507
>>> #2  0x000000000040a4a9 in main (argc=<optimized out>, argv=<optimized out>,
>>>    envp=<optimized out>) at /home/andreas/QEMU/qemu/vl.c:3340
>>> 
>>> I'd expect seeing SLOF boot.
>> 
>> 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.

Well, it's mostly been unfortunate scheduling for my travelings :). But yes, unfortunate it was indeed.


Alex

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-09  2:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 10:40 [Qemu-devel] [TestDay] ppc64 pseries segfault Andreas Färber
2011-11-09  1:36 ` Andreas Färber
2011-11-09  1:41 ` David Gibson
2011-11-09  1:46   ` Alexander Graf
2011-11-09  1:52   ` Andreas Färber
2011-11-09  2:03     ` Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).