xen: document failed attempt

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-25 00:00:00 +00:00
parent 05aa5c7c79
commit 8825222579
2 changed files with 49 additions and 14 deletions

View File

@@ -8550,9 +8550,9 @@ kill %1
`stress -c 1 -t 1` makes gem5 irresponsive for a very long time. `stress -c 1 -t 1` makes gem5 irresponsive for a very long time.
== Linux kernel build system === Linux kernel build system
=== vmlinux vs bzImage vs zImage vs Image ==== vmlinux vs bzImage vs zImage vs Image
Between all archs on QEMU and gem5 we touch all of those kernel built output files. Between all archs on QEMU and gem5 we touch all of those kernel built output files.
@@ -8571,6 +8571,38 @@ as mentioned at:
* https://unix.stackexchange.com/questions/352215/how-do-i-extract-vmlinux-from-an-arm-image * https://unix.stackexchange.com/questions/352215/how-do-i-extract-vmlinux-from-an-arm-image
* https://raspberrypi.stackexchange.com/questions/88621/why-doesnt-extract-vmlinux-work-with-raspbians-boot-kernel-img * https://raspberrypi.stackexchange.com/questions/88621/why-doesnt-extract-vmlinux-work-with-raspbians-boot-kernel-img
== Xen
TODO: get prototype working and then properly integrate:
....
./build-xen
....
Source: link:build-xen[]
This script attempts to build Xen for aarch64 and feed it into QEMU through link:boot-wrapper-arch64[]
The current bad behaviour is that it prints just:
....
Boot-wrapper v0.2
....
and nothing else.
We will also need `CONFIG_XEN=y` on the Linux kernel, but first Xen should print some Xen messages before the kernel is ever reached.
If we pass to QEMU the xen image directly instead of the boot wrapper one:
....
-kernel ../xen/xen/xen
....
then Xen messages do show up, so it seems that the configuration failure lies in the boot wrapper itself rather than Xen.
Bibliography: this attempt was based on: https://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions/FastModels which is the documentation for the ARM Fast Models closed source simulators.
== QEMU == QEMU
=== Introduction to QEMU === Introduction to QEMU

View File

@@ -1,39 +1,42 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# TODO get working, aarch64 Xen integration attempt. # https://github.com/cirosantilli/linux-kernel-module-cheat#xen
# Current state: prints to Boot-wrapper v0.2 to screen and hangs.
# Bibliography:
# https://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions/qemu-system-aarch64
# https://blog.xenproject.org/2014/04/01/virtualization-on-arm-with-xen/
set -eux set -eux
cd submodules/xen cd submodules/xen
make \ make \
-j `nproc` \ -j `nproc` \
dist-xen \ dist-xen \
CONFIG_DEBUG=y \ CONFIG_DEBUG=y \
CONFIG_EARLY_PRINTK=vexpress \ CONFIG_EARLY_PRINTK=pl011,0x09000000 \
CROSS_COMPILE=aarch64-linux-gnu- \ CROSS_COMPILE=aarch64-linux-gnu- \
XEN_TARGET_ARCH=arm64 \ XEN_TARGET_ARCH=arm64 \
; ;
cd ../boot-wrapper-aarch64 cd ../boot-wrapper-aarch64
autoreconf -i
../../out/qemu/default/aarch64-softmmu/qemu-system-aarch64 \ ../../out/qemu/default/aarch64-softmmu/qemu-system-aarch64 \
-machine virt \ -machine virt \
-machine virtualization=on \ -machine virtualization=on \
-machine gic_version=3 \
-cpu cortex-a57 \
-kernel xen-system.axf \
-serial mon:stdio \
-nographic \
-machine dumpdtb=dtb.dtb \ -machine dumpdtb=dtb.dtb \
; ;
autoreconf -i
./configure \ ./configure \
--enable-gicv3 \ --enable-gicv3 \
--enable-psci \ --enable-psci \
--host=aarch64-linux-gnu \ --host=aarch64-linux-gnu \
--with-cmdline="console=hvc0 root=/dev/vda rw mem=1G" \ --with-cmdline="console=hvc0 earlycon=pl011,0x09000000 root=/dev/vda rw" \
--with-dtb=dtb.dtb \ --with-dtb=dtb.dtb \
--with-kernel-dir=../../out/linux/default/aarch64 \ --with-kernel-dir=../../out/linux/default/aarch64 \
--with-xen-cmdline="dtuart=/uart@1c090000 console=dtuart no-bootscrub dom0_mem=1G loglvl=all guest_loglvl=all" \ --with-xen-cmdline="dtuart=/pl011,0x09000000 console=dtuart no-bootscrub dom0_mem=512M loglvl=all guest_loglvl=all" \
--with-xen=../xen/xen/xen \ --with-xen=../xen/xen/xen \
; ;
make -j `nproc`
../../out/qemu/default/aarch64-softmmu/qemu-system-aarch64 \ ../../out/qemu/default/aarch64-softmmu/qemu-system-aarch64 \
-M virt \ -machine virt \
-M virtualization=on \ -machine virtualization=on \
-machine gic_version=3 \
-cpu cortex-a57 \ -cpu cortex-a57 \
-kernel xen-system.axf \ -kernel xen-system.axf \
-serial mon:stdio \ -serial mon:stdio \