Xen ARM with Virtualization Extensions/Salvator-X: Difference between revisions
Lars.kurth (talk | contribs) No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
== General information == |
== General information == |
||
This wiki |
This wiki describes how to run XEN on Renesas Salvator-X board with R-Car H3 SoC. |
||
Due to the fact that Renesas provide their reference software in form of [http://elinux.org/index.php?title=R-Car/Boards/Yocto-Gen3&oldid=446036 Yocto build instruction], it is provided additional steps in order to add XEN to the system being built. Those steps add meta-virtualization layer and a glue layer to the Yocto build. |
|||
{{WarningLeft|Only core-image-minimal configuration are now supported }} |
|||
XEN hypervisor is taken from a master branch of [http://xenbits.xen.org/gitweb/?p=xen.git xen.git]. |
|||
This wiki relies on Renesas Yocto version [http://elinux.org/index.php?title=R-Car/Boards/Yocto-Gen3&oldid=446036 2.19.0]. |
|||
== Known limitations == |
== Known limitations == |
||
Due to different XEN specifics there is a list of system deviations from Renesas'es reference software: |
|||
In current state (Linux kernel 4.6) there is impossible to use same device tree, as used for non-Xen environment. |
|||
# Some on device addresses (avs, reset, pll modules) are hardcoded in board specific files, so Xen doesn't know about them nothing - we have to create nodes for this in DTS. This is solved follow [https://github.com/qbeeukraine/meta-platform-xen/blob/2.12/minimal/meta-rcar-gen3-xen/recipes-kernel/linux/linux-renesas/patches/0004-arm64-dts-renesas-Forward-hardcoded-devices.patch patch] |
|||
# CMA, ADSP, Multimedia & lossy_decompression memory regions are disabled in current state - they use predefined addresses, but it can't guarantee that Dom0 will be allocated within required memory ranges. This limitation is under investigation & planned to be resolved in future releases. |
|||
* ATF exits to bootloader in EL2 mode |
|||
== Setup == |
|||
* TEE client is not functional |
|||
* reserved memory is not supported |
|||
* adsp, mmngr, mmngrbuf are dropped because they rely on reserved memory |
|||
Because of the fact that Renesas BSP u-boot uses cli-simple, adequate manual updating of fdt is not possible. So within the glue layer it is provided a [https://github.com/xen-troops/meta-demo/blob/master/meta-rcar-gen3-xen/recipes-kernel/linux/linux-renesas/r8a7795-salvator-x-xen.dts device tree] with changes required for XEN. |
|||
Follow setup are based & tested on official Renesas Yocto 2.12.0 release (https://github.com/renesas-rcar/meta-renesas/releases/tag/Renesas-Yocto-v2.12.0) |
|||
Please consider changes to dts and appropriate dtb load in case you want system configuration changes (i.e. nfs server ip, dom0 root option, xen command line, etc.) |
|||
* Checkout on follow commits |
|||
poky - 40376446904ae3529be41737fed9a0b650ed167d |
|||
== System build == |
|||
meta-linaro - 9b1fd178309544dff1f7453e796a9437125bc0d9 |
|||
meta-openembedded - 8ab04afbffb4bc5184cfe0655049de6f44269990 |
|||
* Follow the [http://elinux.org/index.php?title=R-Car/Boards/Yocto-Gen3&oldid=446036 instruction] to the system build step 10, including it. |
|||
meta-renesas - 522efd09043aa8af1eec01af2b9e025df424d9a5 |
|||
* Clone some additional yocto layers are required |
|||
* Add meta-virtualization layer with its dependencies: |
|||
meta-selinux - 4c75d9cbcf1d75043c7c5ab315aa383d9b227510 |
|||
git clone git://git.yoctoproject.org/meta-virtualization -b morty ../meta-virtualization |
|||
meta-virtualizaion - 042425c1d98bdd7e44a62789bd03b375045266f5 |
|||
bitbake-layers add-layer ../meta-virtualization |
|||
* Clone meta-platform-xen repository in the same directory |
|||
git clone |
git clone git://git.yoctoproject.org/meta-selinux -b jethro ../meta-selinux |
||
bitbake-layers add-layer ../meta-selinux |
|||
* Initialize yocto build environment |
|||
bitbake-layers add-layer ../meta-openembedded/meta-networking |
|||
source poky/oe-init-build-env |
|||
bitbake-layers add-layer ../meta-openembedded/meta-python |
|||
* Copy local.conf & bblayers.conf from supplied xen layer |
|||
cp meta-platform-xen/meta-rcar-gen3-xen/docs/sample/conf/salvator-x/linaro-gcc/bsp/*.conf ./conf/ |
|||
* Add the glue layer |
|||
* Build yocto |
|||
git clone https://github.com/xen-troops/meta-demo -b master ../meta-demo |
|||
bitbake core-image-minimal |
|||
bitbake-layers add-layer ../meta-demo/meta-rcar-gen3-xen |
|||
* Target images will be located in follow folder |
|||
build/tmp/deploy/images/salvator-x-xen |
|||
* Continue build steps from [http://elinux.org/index.php?title=R-Car/Boards/Yocto-Gen3&oldid=446036 instruction] |
|||
== BL2 & U-boot update procedure == |
== BL2 & U-boot update procedure == |
||
It is crucial to update ATF on the board in order to get XEN start in EL2. |
|||
Please reference to recent version of board manual for this procedure. |
|||
Follow bootloaders should be updated: |
|||
Please follow your board manual to find out ATF update procedure. |
|||
# BL2 bootloader - from on we leave bootloaders in EL2 mode |
|||
# U-boot - don't disable SCIF clock & don't update memory nodes in DTS file |
|||
== Running the system == |
|||
Setup tftp and nfs as described in [http://elinux.org/index.php?title=R-Car/Boards/Yocto-Gen3&oldid=446036#Running_Yocto_images instruction]. |
|||
== Check u-boot environment variables == |
|||
Please consider that default expected nfs server setup is ''nfsroot=192.168.1.100:/srv/dom0''. |
|||
Set follow configuration in u-boot command prompt. |
|||
bootargs=dom0_mem=512M console=dtuart dtuart=serial0 dom0_max_vcpus=1 bootscrub=0 flask_enforcing=1 |
|||
bootcmd=tftp 0x78080000 xen-salvator-x-xen.uImage; tftp 0x73800000 Image-r8a7795-salvator-x-dom0.dtb; tftp 0x7a000000 Image; tftp 0x7c000000 xenpolicy-salvator-x-xen; bootm 0x78080000 - 0x73800000 |
|||
For the system boot issue from u-boot cli: |
|||
== Dom0 rootfs setup == |
|||
By default (as it recommended by Renesas manual) rootfs should be located on nfs drive with ip gained by dhcp. |
|||
But this behavior can be changed by editing follow file: |
|||
build/tmp/work-shared/salvator-x-xen/kernel-source/arch/arm64/boot/dts/renesas/r8a7795-salvator-x-dom0.dts |
|||
or additional patch can be added to follow file |
|||
meta-rcar-gen3-xen/recipes-kernel/linux/linux-renesas/xen_dom0.scc |
|||
setenv bootargs #empties the bootargs added by u-boot |
|||
== Resources == |
|||
tftp 0x48000000 Image-r8a7795-salvator-x-xen.dtb |
|||
[http://elinux.org/R-Car/Boards/Salvator-X Salvator-X elinux resource] |
|||
tftp 0x48080000 xen-salvator-x.uImage |
|||
[https://lists.xenproject.org/archives/html/xen-devel/2016-07/msg00109.html Board support patch series] |
|||
tftp 0x7a000000 Image |
|||
bootm 0x48080000 - 0x48000000 |
|||
[[Category:XenARM]] |
[[Category:XenARM]] |
||
[[Category:Yocto]] |
[[Category:Yocto]] |
||
[[Category:Developers]] |
[[Category:Developers]] |
||
[[Category:Xen 4.7]] |
Latest revision as of 16:43, 14 July 2017
General information
This wiki describes how to run XEN on Renesas Salvator-X board with R-Car H3 SoC.
Due to the fact that Renesas provide their reference software in form of Yocto build instruction, it is provided additional steps in order to add XEN to the system being built. Those steps add meta-virtualization layer and a glue layer to the Yocto build.
XEN hypervisor is taken from a master branch of xen.git.
This wiki relies on Renesas Yocto version 2.19.0.
Known limitations
Due to different XEN specifics there is a list of system deviations from Renesas'es reference software:
- ATF exits to bootloader in EL2 mode
- TEE client is not functional
- reserved memory is not supported
- adsp, mmngr, mmngrbuf are dropped because they rely on reserved memory
Because of the fact that Renesas BSP u-boot uses cli-simple, adequate manual updating of fdt is not possible. So within the glue layer it is provided a device tree with changes required for XEN.
Please consider changes to dts and appropriate dtb load in case you want system configuration changes (i.e. nfs server ip, dom0 root option, xen command line, etc.)
System build
- Follow the instruction to the system build step 10, including it.
- Add meta-virtualization layer with its dependencies:
git clone git://git.yoctoproject.org/meta-virtualization -b morty ../meta-virtualization bitbake-layers add-layer ../meta-virtualization git clone git://git.yoctoproject.org/meta-selinux -b jethro ../meta-selinux bitbake-layers add-layer ../meta-selinux bitbake-layers add-layer ../meta-openembedded/meta-networking bitbake-layers add-layer ../meta-openembedded/meta-python
- Add the glue layer
git clone https://github.com/xen-troops/meta-demo -b master ../meta-demo bitbake-layers add-layer ../meta-demo/meta-rcar-gen3-xen
- Continue build steps from instruction
BL2 & U-boot update procedure
It is crucial to update ATF on the board in order to get XEN start in EL2.
Please follow your board manual to find out ATF update procedure.
Running the system
Setup tftp and nfs as described in instruction.
Please consider that default expected nfs server setup is nfsroot=192.168.1.100:/srv/dom0.
For the system boot issue from u-boot cli:
setenv bootargs #empties the bootargs added by u-boot tftp 0x48000000 Image-r8a7795-salvator-x-xen.dtb tftp 0x48080000 xen-salvator-x.uImage tftp 0x7a000000 Image bootm 0x48080000 - 0x48000000