XEN - MarekBykowski/readme GitHub Wiki

HOME » Linux Kernel facilities » Virtualization in ARM » XEN

XEN references

XEN from Xlinix wiki really good https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842530/XEN+Hypervisor
https://www.linaro.org/blog/on-the-performance-of-arm-virtualization/
https://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions#Booting_Xen
https://git.yoctoproject.org/cgit/cgit.cgi/meta-arm/tree/meta-arm-autonomy/documentation/arm-autonomy-quickstart.md

XEN HOWTO

Linux config

Linux needs to be built with the following options enabled:

CONFIG_XEN  
CONFIG_HVC_DRIVER  
CONFIG_HVC_XEN  

Device-tree

The DTB file for XEN, should be the same as for Linux, with a few entries added to the chosen node. The "xen,dom0-bootargs" corresponds to the Linux Kernel command line. Then you need to add in the boot module, we have added the "multiboot,kernel" followed by the generic compatibility string "multiboot,module" that is always present. reg property specifies the physical address of the module in RAM and the length of the module

cat <<EOF > script.source
tftpboot \${loadaddr} xen
tftpboot \${fdt_addr} device-tree.dtb
tftpboot 0x3000000 Image
fdt addr \${fdt_addr}
fdt resize

fdt set /chosen \#address-cells <1>
fdt set /chosen \#size-cells <1>
fdt set /chosen xen,xen-bootargs "dom0_mem=4096M"
fdt set /chosen xen,dom0-bootargs "console=hvc0 earlycon panic=-1 root=/dev/mmcblk0p2 rw rootwait"
fdt mknod /chosen module@0
fdt set /chosen/module@0 compatible "multiboot,kernel" "multiboot,module"
fdt set /chosen/module@0 reg <0x3000000 0x\${filesize}>
booti \${loadaddr} - \${fdt_addr}
EOF

mkimage -A arm64 -T script -C none -a 0x02100000 -e 0x02100000 -d script.source script.scr

Memory map with XEN

When running Operating Systems on top of Xen, the addresses are subject to a two-stage translation, from VA->IPA and from IPA->PA.

XEN refers to VA and IPA as a guest virtual and guest physical, or just virtual and physical, whereas IPA, and PA as physical and machine. Note, XEN does not do the VA to IPA page table walk, it remains with the OS, whereas it only cares of physical to machine translation xen/arch/arm/p2m.c.

For Dom0, Xen will create a 1:1 (identity) memory map, that is IPA and PA are the same. Xen takes the IPA memory map form the device-tree of Linux kernel, mostly.

For any additional guests (DomU), Xen will create an artificial memory map and interrupt map, that is IPA and PA are not identical.

⚠️ **GitHub.com Fallback** ⚠️