Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
./qemu-system-aarch64 \
           -machine type=virt,virtualization=on,pflash0=rom,pflash1=efivars \
           -cpu max,pauth-impdef=on \
           -smp 8 \
           -accel tcg \
           -device virtio-net-pci,netdev=unet \
           -device virtio-scsi-pci \
           -device scsi-hd,drive=hd \
           -netdev user,id=unet,hostfwd=tcp::2222-:22 \
           -blockdev driver=raw,node-name=hd,file.driver=host_device,file.filename=/dev/zen-ssd2/bookworm-arm64,discard=unmap \
           -serial mon:stdio \
           -blockdev node-name=rom,driver=file,filename=(pwd)/pc-bios/edk2-aarch64-code.fd,read-only=true \
           -blockdev node-name=efivars,driver=file,filename=$HOME/images/qemu-arm64-efivars \
           -m 8192 \
           -object memory-backend-memfd,id=mem,size=8G,share=on \
           -display none \
           -kernel /home/alex/lsrc/linux.git/builds/arm64/arch/arm64/boot/Image \
           -append "root=/dev/sda2"

Installing Xen

The best way is to build the current Xen you are interested on your host with a crossbuild and then:

Code Block
make debball CROSS_COMPILE=aarch64-linux-gnu- XEN_TARGET_ARCH=arm64

and you can copy the resulting image to your emulated system and install it. Make sure you haven’t installed any of the disto bits. You may need to run update-grub manually to add the Xen entries.

Booting Xen Directly

Once you have the user space tooling installed you can now boot the hypervisor directly and manually load the dom0 kernel. Please note you’ll want to skip the UEFI bios for this:

Code Block
 ./qemu-system-aarch64 \
           -machine type=virt,virtualization=on \
           -cpu max,pauth-impdef=on \
           -smp 8 \
           -accel tcg \
           -device virtio-net-pci,netdev=unet \
           -device virtio-scsi-pci \
           -device scsi-hd,drive=hd \
           -netdev user,id=unet,hostfwd=tcp::2222-:22 \
           -blockdev driver=raw,node-name=hd,file.driver=host_device,file.filename=/dev/zen-ssd2/bookworm-arm64,discard=unmap \
           -serial mon:stdio \
           -m 8192 \
           -object memory-backend-memfd,id=mem,size=8G,share=on \
           -display none \
           -kernel $HOME/lsrc/xen/xen.git/xen/xen.efi \
           -append "dom0_mem=4G,max:4G loglvl=all guest_loglvl=all" \
           -device guest-loader,addr=0x49000000,kernel=$HOME/lsrc/linux.git/builds/arm64/arch/arm64/boot/Image,bootargs="console=hvc0 earlyprintk=xen root=/dev/sda2"