* [Qemu-devel] clk_setup decl missing in virtex_init @ 2011-11-07 22:46 Michael Eager 2011-11-07 23:05 ` Edgar E. Iglesias 0 siblings, 1 reply; 5+ messages in thread From: Michael Eager @ 2011-11-07 22:46 UTC (permalink / raw) To: qemu-devel The declaration of clk_setup is missing in qemu/hw/virtex_ml507.c: static void virtex_init(ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { ... <no decl for clk_setup> ... memset(clk_setup, 0, sizeof(clk_setup)); This SEGVs because clk_setup is an inline function defined in ppc.h. (I presume that the linker generates an out-of-line copy.) It isn't clear what the declaration should be. In ppc405_uc.c, there is a decl: clk_setup_t clk_setup[PPC405EP_CLK_NB]; -- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] clk_setup decl missing in virtex_init 2011-11-07 22:46 [Qemu-devel] clk_setup decl missing in virtex_init Michael Eager @ 2011-11-07 23:05 ` Edgar E. Iglesias 2011-11-07 23:25 ` Michael Eager 2011-11-14 8:52 ` Fabien Chouteau 0 siblings, 2 replies; 5+ messages in thread From: Edgar E. Iglesias @ 2011-11-07 23:05 UTC (permalink / raw) To: Michael Eager; +Cc: qemu-devel, Fabien Chouteau On Mon, Nov 07, 2011 at 02:46:47PM -0800, Michael Eager wrote: > The declaration of clk_setup is missing in > qemu/hw/virtex_ml507.c: > > static void virtex_init(ram_addr_t ram_size, > const char *boot_device, > const char *kernel_filename, > const char *kernel_cmdline, > const char *initrd_filename, const char *cpu_model) > { > ... > <no decl for clk_setup> > ... > memset(clk_setup, 0, sizeof(clk_setup)); > > This SEGVs because clk_setup is an inline function defined in ppc.h. > (I presume that the linker generates an out-of-line copy.) > > It isn't clear what the declaration should be. In ppc405_uc.c, there > is a decl: > clk_setup_t clk_setup[PPC405EP_CLK_NB]; Hi the following patch seems to work on my side. Fabien, could you please see if this was your intention? It seems to be commit ddd1055b07fdfe488a22c2275adaca75f4206d30 that introduced the segfault. Cheers commit 8e95771e4afb6e91c30a53943118afef4631b919 Author: Edgar E. Iglesias <edgar.iglesias@gmail.com> Date: Tue Nov 8 00:00:55 2011 +0100 virtex: Remove memset of clk_setup clk_setup is now a function. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> diff --git a/hw/virtex_ml507.c b/hw/virtex_ml507.c index d31a204..5ea0e60 100644 --- a/hw/virtex_ml507.c +++ b/hw/virtex_ml507.c @@ -202,7 +202,6 @@ static void virtex_init(ram_addr_t ram_size, cpu_model = "440-Xilinx"; } - memset(clk_setup, 0, sizeof(clk_setup)); env = ppc440_init_xilinx(&ram_size, 1, cpu_model, 400000000); qemu_register_reset(main_cpu_reset, env); ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] clk_setup decl missing in virtex_init 2011-11-07 23:05 ` Edgar E. Iglesias @ 2011-11-07 23:25 ` Michael Eager 2011-11-08 21:01 ` Edgar E. Iglesias 2011-11-14 8:52 ` Fabien Chouteau 1 sibling, 1 reply; 5+ messages in thread From: Michael Eager @ 2011-11-07 23:25 UTC (permalink / raw) To: Edgar E. Iglesias; +Cc: qemu-devel, Fabien Chouteau Works for me. On 11/07/2011 03:05 PM, Edgar E. Iglesias wrote: > On Mon, Nov 07, 2011 at 02:46:47PM -0800, Michael Eager wrote: >> The declaration of clk_setup is missing in >> qemu/hw/virtex_ml507.c: >> >> static void virtex_init(ram_addr_t ram_size, >> const char *boot_device, >> const char *kernel_filename, >> const char *kernel_cmdline, >> const char *initrd_filename, const char *cpu_model) >> { >> ... >> <no decl for clk_setup> >> ... >> memset(clk_setup, 0, sizeof(clk_setup)); >> >> This SEGVs because clk_setup is an inline function defined in ppc.h. >> (I presume that the linker generates an out-of-line copy.) >> >> It isn't clear what the declaration should be. In ppc405_uc.c, there >> is a decl: >> clk_setup_t clk_setup[PPC405EP_CLK_NB]; > > > Hi > > the following patch seems to work on my side. Fabien, could > you please see if this was your intention? It seems to be > commit ddd1055b07fdfe488a22c2275adaca75f4206d30 that > introduced the segfault. > > Cheers > > commit 8e95771e4afb6e91c30a53943118afef4631b919 > Author: Edgar E. Iglesias<edgar.iglesias@gmail.com> > Date: Tue Nov 8 00:00:55 2011 +0100 > > virtex: Remove memset of clk_setup > > clk_setup is now a function. > > Signed-off-by: Edgar E. Iglesias<edgar.iglesias@gmail.com> > > diff --git a/hw/virtex_ml507.c b/hw/virtex_ml507.c > index d31a204..5ea0e60 100644 > --- a/hw/virtex_ml507.c > +++ b/hw/virtex_ml507.c > @@ -202,7 +202,6 @@ static void virtex_init(ram_addr_t ram_size, > cpu_model = "440-Xilinx"; > } > > - memset(clk_setup, 0, sizeof(clk_setup)); > env = ppc440_init_xilinx(&ram_size, 1, cpu_model, 400000000); > qemu_register_reset(main_cpu_reset, env); > > -- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] clk_setup decl missing in virtex_init 2011-11-07 23:25 ` Michael Eager @ 2011-11-08 21:01 ` Edgar E. Iglesias 0 siblings, 0 replies; 5+ messages in thread From: Edgar E. Iglesias @ 2011-11-08 21:01 UTC (permalink / raw) To: Michael Eager; +Cc: qemu-devel, Fabien Chouteau On Mon, Nov 07, 2011 at 03:25:45PM -0800, Michael Eager wrote: > Works for me. Thanks, I've applied the fix. Cheers ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] clk_setup decl missing in virtex_init 2011-11-07 23:05 ` Edgar E. Iglesias 2011-11-07 23:25 ` Michael Eager @ 2011-11-14 8:52 ` Fabien Chouteau 1 sibling, 0 replies; 5+ messages in thread From: Fabien Chouteau @ 2011-11-14 8:52 UTC (permalink / raw) To: Edgar E. Iglesias; +Cc: Michael Eager, qemu-devel On 08/11/2011 00:05, Edgar E. Iglesias wrote: > On Mon, Nov 07, 2011 at 02:46:47PM -0800, Michael Eager wrote: >> The declaration of clk_setup is missing in >> qemu/hw/virtex_ml507.c: >> >> static void virtex_init(ram_addr_t ram_size, >> const char *boot_device, >> const char *kernel_filename, >> const char *kernel_cmdline, >> const char *initrd_filename, const char *cpu_model) >> { >> ... >> <no decl for clk_setup> >> ... >> memset(clk_setup, 0, sizeof(clk_setup)); >> >> This SEGVs because clk_setup is an inline function defined in ppc.h. >> (I presume that the linker generates an out-of-line copy.) >> >> It isn't clear what the declaration should be. In ppc405_uc.c, there >> is a decl: >> clk_setup_t clk_setup[PPC405EP_CLK_NB]; > > > Hi > > the following patch seems to work on my side. Fabien, could > you please see if this was your intention? It seems to be > commit ddd1055b07fdfe488a22c2275adaca75f4206d30 that > introduced the segfault. > That's right the memset should have been removed in my patch. Thanks, -- Fabien Chouteau ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-11-14 8:52 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-11-07 22:46 [Qemu-devel] clk_setup decl missing in virtex_init Michael Eager 2011-11-07 23:05 ` Edgar E. Iglesias 2011-11-07 23:25 ` Michael Eager 2011-11-08 21:01 ` Edgar E. Iglesias 2011-11-14 8:52 ` Fabien Chouteau
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).