[U-Boot] qemu-system-arm segfaults on zynq_zed

James Zhou james.zhou.link at outlook.com
Wed Nov 26 10:06:12 CET 2014




Hi Douglas,

It seems to hit in the follow location:


(gdb) f 3
#3  0x00005555557c6a21 in get_page_addr_code (env1=env1 at entry=0x5555562f6100, addr=addr at entry=4294967280)
    at /xilinx/qemu/cputlb.c:325
325                cpu_abort(cpu, "Trying to execute code outside RAM or ROM at 0x"
(gdb) l 320
315            cpu_ldub_code(env1, addr);
316        }
317        pd = env1->iotlb[mmu_idx][page_index] & ~TARGET_PAGE_MASK;
318        mr = iotlb_to_region(cpu->as, pd);
319        if (memory_region_is_unassigned(mr)) {
320            CPUClass *cc = CPU_GET_CLASS(cpu);
321    
322            if (cc->do_unassigned_access) {
323                cc->do_unassigned_access(cpu, addr, false, true, 0, 4);
324            } else {
(gdb) 
325                cpu_abort(cpu, "Trying to execute code outside RAM or ROM at 0x"
326                          TARGET_FMT_lx "\n", addr);
327            }
328        }
329        p = (void *)((uintptr_t)addr + env1->tlb_table[mmu_idx][page_index].addend);
330        return qemu_ram_addr_from_host_nofail(p);
331    }
332    
333    #define MMUSUFFIX _cmmu
334    #undef GETPC

(gdb) p/x addr
$2 = 0xfffffff0


Might be a qemu issue, but not sure how it is triggered by a quick glance.


Regards,

James



Date: Mon, 24 Nov 2014 11:58:05 -0800
From: douglas.b.rupp at gmail.com
To: soren.brinkmann at xilinx.com
CC: u-boot at lists.denx.de; crosthwaitepeter at gmail.com
Subject: Re: [U-Boot] qemu-system-arm segfaults on zynq_zed

I tried with a zed_zynq built u-boot.bin and u-boot.dtb built from
u-boot-2014.10 release, and got slightly different results:
 
qemu: fatal: Trying to execute code outside RAM or ROM at 0xfffffff0.
 
Then a register dump.
 
Oh well, thanks for the pointers in your previous message, will read for
clues.
 
On Mon, Nov 24, 2014 at 10:34 AM, Sören Brinkmann <
soren.brinkmann at xilinx.com> wrote:
 
> I suppose the uboot.bin files you are talking about are binaries that
> had been converted with objcopy or similar from ELF to binary. That
> probably works well. The Zynq boot.bin is a container file that contains
> the Zynq bootloader and (optionally) other things (like U-Boot). I doubt
> QEMU is able to parse this Zynq specific file (though, it's all
> documented, so it could be implemented I guess). So, you probably want to
> pass the u-boot.elf as kernel, but I don't know to what extend that works
> currently. For that we need input from Peter.
> For more information about the Zynq boot.bin format, please have a look
> at section 6.3.2 in the Zynq TRM
> (
> http://www.xilinx.com/support/documentation/user_guides/ug585-Zynq-7000-TRM.pdf
> )
> and the Zynq SW developer guide
> (
> http://www.xilinx.com/support/documentation/user_guides/ug821-zynq-7000-swdev.pdf
> ).
>
>         Sören
>
> On Mon, 2014-11-24 at 10:24AM -0800, Douglas Rupp wrote:
> > For versatilepb arm, there's a blog post that describes a recipe of how
> to
> > build and boot "uboot.bin" in qemu.  It works fine, here's the link if
> > you're interested.
> > https://balau82.wordpress.com/2010/03/10/u-boot-for-arm-on-qemu/
> >
> > I assumed that uboot was standardized enough so that it would work the
> same
> > for other machine/board emulations. I'd like to understand why it's not
> > working.
> >
> > The problem I'm trying to solve is to configure networking in uboot for
> the
> > xilinx-zynq-a9 bsp for vxworks7 running under qemu.  Vxworks7 uses uboot
> > where 6.9 didn't, and the default device tree isn't set correctly for my
> > network, it just has some random defaults that are expected to be
> > customized.  The alternative is to use real hardware, which should work
> > well enough for debugging but in general it's much easier to debug and
> run
> > tests in qemu especially when working remotely.
> >
> > So any ideas you might have on what's special about zynq utboot would be
> > appreciated.
> >
> > On Mon, Nov 24, 2014 at 9:45 AM, Sören Brinkmann <
> soren.brinkmann at xilinx.com
> > > wrote:
> >
> > > I don't think boot.bin is a legal "kernel". IIRC, I had issues running
> > > on QEMU, but it was slightly better than what you describe.
> > >
> > >         Sören
> > >
> > > On Mon, 2014-11-24 at 09:40AM -0800, Douglas Rupp wrote:
> > > >    The result is:
> > > >
> > > >    arm-softmmu/qemu-system-arm -M arm-generic-fdt -nographic -smp 2
> > > -machine
> > > >    linux=on -serial mon:stdio -dtb devicetree.dtb -kernel boot.bin
> > > >    SPI device 0x7f8161521ee0
> > > >    qemu: fatal: Trying to execute code outside RAM or ROM at
> 0xfffffff0
> > > >
> > > >    then a register dump
> > > >
> > > >    The "boot.bin" and "devicetree.dtb" is from xilinx binary release
> > > >    2014.3-release/zed
> > > >
> > > >    I tried removing -smp 2 -machine linux=on, and same error.
> > > >    On Mon, Nov 24, 2014 at 9:21 AM, Sören Brinkmann
> > > >    <[1]soren.brinkmann at xilinx.com> wrote:
> > > >
> > > >      Could you try whether these instructions work?
> > > >      [2]http://www.wiki.xilinx.com/QEMU
> > > >
> > > >              Sören
> > > >      On Mon, 2014-11-24 at 08:58AM -0800, Douglas Rupp wrote:
> > > >      > I built qemu-system-arm from the xilinx-master branch.
> > > >       xilinx-zynq-a9 is
> > > >      > not a supported machine. :(
> > > >      >
> > > >      > On Mon, Nov 24, 2014 at 7:02 AM, Douglas Rupp
> > > >      <[3]douglas.b.rupp at gmail.com>
> > > >      > wrote:
> > > >      >
> > > >      > > It's the version of qemu-system-arm downloaded for Ubuntu
> 14.04
> > > >      > > Version info:
> > > >      > > qemu-system-arm --version
> > > >      > > QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.7)
> > > >      > >
> > > >      > > I also tried the three "boot.bin" files in
> > > "2014.3-release.tar.gz"
> > > >      > > downloaded from the Xilinx website, those in subdirectories
> > > >      zc70x/zc706/
> > > >      > > and zc70x/zc702/, and zed/ .  Same command line.  Hangs
> with no
> > > >      output.
> > > >      > >
> > > >      > > I also tried the version 2.0.0 version of qemu-system-arm
> from
> > > the
> > > >      > > [4]open-do.org website that we regular use with
> xlnx-zynq-a9
> > > bsp for
> > > >      > > vxworks7, it boots vxworks without uboot, but hangs with
> uboot.
> > > >      > >
> > > >      > > You're suggesting that only the qemu-system-arm built from
> the
> > > >      xilinx repo
> > > >      > > is functional with uboot?  I used that version of qemu
> about a
> > > year
> > > >      ago,
> > > >      > > and it worked fine for Linux but it was an ancient version
> of
> > > qemu
> > > >      (at that
> > > >      > > time).
> > > >      > >
> > > >      > > On Sun, Nov 23, 2014 at 10:17 PM, Jagan Teki
> > > >      <[5]jagannadh.teki at gmail.com>
> > > >      > > wrote:
> > > >      > >
> > > >      > >> On 24 November 2014 at 06:03, Douglas Rupp
> > > >      <[6]douglas.b.rupp at gmail.com>
> > > >      > >> wrote:
> > > >      > >> > I'm brand new to Uboot, so hopefully this is just some
> > > missing
> > > >      switch.
> > > >      > >> I
> > > >      > >> > did search the archive, and I was able to build and
> u-boot a
> > > >      > >> versaatilepb
> > > >      > >> > version, but xilinx-zynq-a9 is the one I really need.
> > > >      > >> >
> > > >      > >> > u-boot-2014.10$ make zynq_zed_defconfig
> > > >      > >> > u-boot-2014.10$ make all CROSS_COMPILE=arm-none-eabi-
> > > ARCH=arm
> > > >      > >> > u-boot-2014.10$ qemu-system-arm -M xilinx-zynq-a9 -m
> 1024M
> > > >      -nographic
> > > >      > >> > -kernel u-boot-dtb.bin
> > > >      > >> > Segmentation fault (core dumped)
> > > >      > >>
> > > >      > >> I guess it may be qemu usage issue, is qemu from
> > > >      > >> [7]https://github.com/Xilinx/qemu ?
> > > >      > >>
> > > >      > >> + Peter
> > > >      > >> Hope, he will give some inputs
> > > >      > >>
> > > >      > >> >
> > > >      > >> > What am I doing wrong?
> > > >      > >>
> > > >      > >> thanks!
> > > >      > >> --
> > > >      > >> Jagan.
> > > >      > >>
> > > >      > >
> > > >      > >
> > > >
> > > >      > _______________________________________________
> > > >      > U-Boot mailing list
> > > >      > [8]U-Boot at lists.denx.de
> > > >      > [9]http://lists.denx.de/mailman/listinfo/u-boot
> > > >
> > > > Links:
> > > > 1. mailto:soren.brinkmann at xilinx.com/
> > > > 2. http://www.wiki.xilinx.com/QEMU
> > > > 3. mailto:douglas.b.rupp at gmail.com/
> > > > 4. http://open-do.org/
> > > > 5. mailto:jagannadh.teki at gmail.com/
> > > > 6. mailto:douglas.b.rupp at gmail.com/
> > > > 7. https://github.com/Xilinx/qemu
> > > > 8. mailto:U-Boot at lists.denx.de/
> > > > 9. http://lists.denx.de/mailman/listinfo/u-boot
> > >
>
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
>
>

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


 		 	   		  


More information about the U-Boot mailing list