Xen Zynq Distribution Support Forums
Qemu launches but boot hangs before login prompt - Printable Version

+- Xen Zynq Distribution Support Forums (http://xzdforums.dornerworks.com)
+-- Forum: General Xilinx Support (http://xzdforums.dornerworks.com/forumdisplay.php?fid=1)
+--- Forum: Getting Started (http://xzdforums.dornerworks.com/forumdisplay.php?fid=10)
+--- Thread: Qemu launches but boot hangs before login prompt (/showthread.php?tid=654)

Pages: 1 2


Qemu launches but boot hangs before login prompt - brettstahlman - 02-22-2017

Preliminary question: Is it necessary to match Petalinux version to Xilinx SDK version? I'm using the latest version of each:
  • Petalinux version 2016.4
  • Xilinx SDK version 2016.3
Here's the command I'm using to launch qemu:

Quote:qemu-system-aarch64 -L $RELEASE_DIR/etc/qemu -M arm-generic-fdt -
device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 -serial monConfusedtdio -serial
/dev/null -display none -device loader,file=$RELEASE_DIR/dist/images/linux/bl31.elf,cpu=0 -
device loader,file=$RELEASE_DIR/dist/images/linux/u-boot.elf -gdb tcp::9000 -tftp /tftpboot
-drive file=$RELEASE_DIR/dist/images/dom0.img,format=raw,if=sd -redir tcp:2222::22 -net
nic,vlan=0 -net user,vlan=0 -net nic,vlan=0 -net nic,vlan=0 -net nic,vlan=0 -hw-dtb
$RELEASE_DIR/dist/images/linux/zynqmp-qemu-arm.dtb -pflash
$RELEASE_DIR/dist/images/linux/nand0.qcow2

The last message I see in the boot console is...

Quote:Initializing random number generator...

...and I never get a prompt. Looking back through the build output, I see several things that look problematic: e.g.,

Quote:WARNING: CPU: 0 PID: 1 at /opt/Xilinx/petalinux-v2016.3-final/components/linux-kernel/xlnx-4.6/drivers/ata/libahci.c:225 ahci_enable_ahci+0x4c/0x60

...which is followed by a stack dump from ahci_enable_ahci.

I also see several errors/warnings regarding Mali device driver: e.g.,

Mali: ERR: <...>/mali_pp.c
mali_pp_reset_wait()
Mali PP: Failed to reset core Mali_PP0, rawstat: 0x00000000

Mali: ERR: <...>/mali_kernel_core.c
mali_parse_product_info()
Failed to create initial PP object

Mali: ERR: <...>/mali_kernel_linux.c
mali_probe()
mali_probe(): Failed to initialize Mali device driver.
mali-utgard: probe of fd4b0000.gpu failed with error -14
Mali: Mali device driver loaded


RE: Qemu launches but boot hangs before login prompt - jarvis_roach - 02-22-2017

Brett,

When using XZD, we recommend you use the versions of the Xilinx tool indicated in the User Manual as we have found issues in the past with mismatched versions of Xilinx tools, especially with regards to QEMU and bootgen. For XZD_20161231, that would be version 2016.3 of PetaLinux and the XSDK.


RE: Qemu launches but boot hangs before login prompt - brettstahlman - 02-22-2017

(02-22-2017, 08:53 PM)jarvis_roach Wrote: Brett,

When using XZD, we recommend you use the versions of the Xilinx tool indicated in the User Manual as we have found issues in the past with mismatched versions of Xilinx tools, especially with regards to QEMU and bootgen. For XZD_20161231, that would be version 2016.3 of PetaLinux and the XSDK.

Ok. I'll give it a try and report back if I still have issues...
Thanks!


RE: Qemu launches but boot hangs before login prompt - brettstahlman - 02-23-2017

Ok. I've installed the correct version of petalinux (2016.3), but now I'm getting the following network errors. I can start another thread if you think it makes sense...

qemu-system-aarch64: -net user,vlan=0: could not set up host forwarding rule 'tcp:2222::22'
qemu-system-aarch64: -net user,vlan=0: Device 'user' could not be initialized


RE: Qemu launches but boot hangs before login prompt - brettstahlman - 02-23-2017

(02-23-2017, 07:39 PM)brettstahlman Wrote: Ok. I've installed the correct version of petalinux (2016.3), but now I'm getting the following network errors. I can start another thread if you think it makes sense...

qemu-system-aarch64: -net user,vlan=0: could not set up host forwarding rule 'tcp:2222::22'
qemu-system-aarch64: -net user,vlan=0: Device 'user' could not be initialized

Figured it out. Apparently there was another qemu command running, which was preventing the tcp redirect from working. I can now boot successfully, and I can connect with "ssh root@localhost -p 2222".


RE: Qemu launches but boot hangs before login prompt - jarvis_roach - 02-23-2017

Can you double check the command you're using to run QEMU (even so far as copy/paste from User's Maual), and post it again here if it's still giving you issues?

Another thing to check is if you already have QEMU running and squatting on that port. `ps -e | grep qemu` should do the trick.


RE: Qemu launches but boot hangs before login prompt - brettstahlman - 02-23-2017

(02-23-2017, 10:53 PM)jarvis_roach Wrote: Can you double check the command you're using to run QEMU (even so far as copy/paste from User's Maual), and post it again here if it's still giving you issues?

Another thing to check is if you already have QEMU running and squatting on that port. `ps -e | grep qemu` should do the trick.

Yes. I replied to my post above a little before your reply. QEMU squatting on that port was indeed the issue. Also, I had to copy xen-qemu.dtb from images/ into the /tftpboot directory. Incidentally, why is this necessary, given that there's also a -hw-dtb directive in the qemu-system-aarch64 command?


RE: Qemu launches but boot hangs before login prompt - jarvis_roach - 02-23-2017

The -hw-dtb directive is actually used for QEMU to know what devices to emulate; QEMU understands it, not sure if the semantics are understood by Xen and Linux. 'xen.dtb' is the device-tree that Xen and Dom0 use, with all the semantics that they expect.


RE: Qemu launches but boot hangs before login prompt - brettstahlman - 02-23-2017

(02-23-2017, 11:22 PM)jarvis_roach Wrote: The -hw-dtb directive is actually used for QEMU to know what devices to emulate; QEMU understands it, not sure if the semantics are understood by Xen and Linux.  'xen.dtb' is the device-tree that Xen and Dom0 use, with all the semantics that they expect.

Understood. Thanks!


RE: Qemu launches but boot hangs before login prompt - Nathan.Studer - 02-24-2017

(02-23-2017, 11:22 PM)jarvis_roach Wrote: The -hw-dtb directive is actually used for QEMU to know what devices to emulate; QEMU understands it, not sure if the semantics are understood by Xen and Linux.  'xen.dtb' is the device-tree that Xen and Dom0 use, with all the semantics that they expect.

From unpleasant experience I can tell you that the QEMU device tree and system device tree (i.e. xen.dtb) are not interchangeable.  If you give Qemu the wrong device tree it will refuse to run and complain about device tree syntax errors.  If you give Xen/Linux the wrong device tree, the system will hang when u-boot makes the jump to the hypervisor/kernel.

     Nate