[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Booting Xen on qemu-arm

On 02/06/2019 14:55, Denis Obrezkov wrote:

Hi Denis,

I am trying to boot xen on qemu arm. I was able to boot Linux kernel
with u-boot:

~/bin/qemu-3.1.0/arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine
virt -m 256M -bios u-boot.bin -device
loader,file=zImage,force-raw=on,addr=0x41000000 -nographic -no-reboot
-mon qemu-monitor,mode=readline

Then, in u-boot:

setenv bootargs root=/dev/ram rw earlyprintk=serial,ttyAMA0 console=ttyAMA0

bootz 0x41000000 - 0x40000000

So, I use a device tree from this machine's default location - 0x40000000

After that, I produced an image:

mkimage -A arm -T kernel -a 0x46000000 -e 0x46000000 -C none -d
"xen/xen" xen-uImage

You don't need to produce a uImage here. Xen is by default supporting the Linux boot protocol, so you could use bootz.

And tried to launch it:

  ~/bin/qemu-3.1.0/arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine
virt -m 512M -bios u-boot.bin -device
loader,file=xen-uImage,force-raw=on,addr=0x41000000 -device
loader,file=zImage,addr=0x45000000 -nographic -no-reboot -chardev
-mon qemu-monitor,mode=readline

So, I put xen image to 0x41000000 and Linux zImage to 0x45000000. I want
to use qemu's default device tree in 0x40000000.

In u-boot:

fdt addr 0x40000000
fdt resize

fdt set /chosen \#address-cells <1>
fdt set /chosen \#size-cells <1>
fdt set /chosen xen,xen-bootargs "console=dtuart dtuart="/pl011@9000000""
fdt mknod /chosen module@0
fdt set /chosen/module@0 compatible "xen,linux-zimage"
fdt set /chosen/module@0 reg <0x45000000 0x853200 >
fdt set /chosen/module@0 bootargs "earlyprintk=serial,ttyAMA0
console=ttyAMA0,115200n8 earlycon=xenboot"

bootm 0x41000000 - 0x40000000

And I get the output:

## Booting kernel from Legacy Image at 41000000 ...
    Image Name:
    Created:      2019-06-02  10:16:13 UTC
    Image Type:   ARM Linux Kernel Image (uncompressed)
    Data Size:    753672 Bytes = 736 KiB
    Load Address: 46000000
    Entry Point:  46000000
    Verifying Checksum ... OK
## Flattened Device Tree blob at 40000000
    Booting using the fdt blob at 0x40000000
    Loading Kernel Image ... OK
    reserving fdt memory region: addr=40000000 size=2000
    Using Device Tree in place at 40000000, end 40004fff

Starting kernel ...

And I have no output after that.

This maybe because Xen crashed before the console is setup. You can compile Xen with earlyprintk.

Can you provide the command line you use to build Xen?

I don't understand several things:

Where should I put xen-uImage, kernel and fdt? I assume they are loaded
to ram to the specified addresses (ram is from 0x40000000).

You can put the blob wherever you want in the RAM as long as it does not clash with other things (e.g U-boot, DT).

Can I use a
default QEMU device tree in 0x40000000 or should I load the one
generated by u-boot with the command:

fdt addr 0x40000000 will load the device tree and the subsequent one will directly modify it.

~/bin/qemu-3.1.0/arm-softmmu/qemu-system-arm -machine virt,gic_version=3 
-machine virtualization=true -cpu cortex-a15 -machine type=virt -m 512 -display 
none -machine dumpdtb=virt.dtb

Also, we have created a node /chosen/module@0. Where can I find its 
description? What is it?

You can read more about the description in [1]. In short, it used to to tell Xen where any modules (e.g Dom0 kernel, Dom0 Initramfs,...) are loaded in memory.


[1] https://xenbits.xen.org/docs/unstable/misc/arm/device-tree/booting.txt

Julien Grall

Xen-users mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.