| 1 |
Booting Xen |
| 2 |
=========== |
| 3 |
|
| 4 |
Xen follows the zImage protocol defined for 32-bit ARM Linux[1] and the |
| 5 |
Image protocol defined for ARM64 Linux[2]. |
| 6 |
|
| 7 |
In both cases the recommendation to boot in HYP/EL2 mode is a strict |
| 8 |
requirement for Xen. |
| 9 |
|
| 10 |
The exceptions to this on 32-bit ARM are as follows: |
| 11 |
|
| 12 |
Xen does not require the machine type to be passed in r1. This |
| 13 |
register is ignored (so may be invalid or the actual machine type). |
| 14 |
|
| 15 |
Xen does not support the ATAG list and requires Device |
| 16 |
Tree. Therefore r2 must point to the physical address of device tree |
| 17 |
block (dtb) in system RAM. |
| 18 |
|
| 19 |
NOTE: although Xen uses the zImage protocol there is no compression |
| 20 |
actually used. This should be transparent to the bootloader. The |
| 21 |
zImage protocol should still be used and not the stricter "raw |
| 22 |
(non-zImage)" protocol described in arm/Booting. |
| 23 |
|
| 24 |
The exceptions to this on 64-bit ARM are as follows: |
| 25 |
|
| 26 |
Xen binary should be loaded in memory below 10 TiB. |
| 27 |
|
| 28 |
Booting Guests |
| 29 |
-------------- |
| 30 |
|
| 31 |
Xen supports the legacy image header[3], zImage protocol for 32-bit |
| 32 |
ARM Linux[1] and Image protocol defined for ARM64[2]. |
| 33 |
|
| 34 |
Until Xen 4.17, in case of legacy image protocol, Xen ignored the load |
| 35 |
address and entry point specified in the header. This has now changed. |
| 36 |
|
| 37 |
Now, it loads the image at the load address provided in the header. |
| 38 |
And the entry point is used as the kernel start address. |
| 39 |
|
| 40 |
A deviation from uboot is that, Xen treats "load address == 0x0" as |
| 41 |
position independent execution (PIE). Thus, Xen will load such an image |
| 42 |
at an address it considers appropriate. Also, user cannot specify the |
| 43 |
entry point of a PIE image since the start address cennot be |
| 44 |
predetermined. |
| 45 |
|
| 46 |
Users who want to use Xen with statically partitioned domains, can provide |
| 47 |
the fixed non zero load address and start address for the dom0/domU kernel. |
| 48 |
The load address and start address specified by the user in the header must |
| 49 |
be within the memory region allocated by Xen. |
| 50 |
|
| 51 |
Also, it is to be noted that if user provides the legacy image header on |
| 52 |
top of zImage or Image header, then Xen uses the attributes of legacy |
| 53 |
image header to determine the load address, entry point, etc. |
| 54 |
|
| 55 |
|
| 56 |
Firmware/bootloader requirements |
| 57 |
-------------------------------- |
| 58 |
|
| 59 |
Xen relies on some settings the firmware has to configure in EL3 before starting Xen. |
| 60 |
|
| 61 |
* Xen must be entered in NS EL2 mode |
| 62 |
|
| 63 |
* The bit SCR_EL3.HCE (resp. SCR.HCE for 32-bit ARM) must be set to 1. |
| 64 |
|
| 65 |
|
| 66 |
[1] linux/Documentation/arm/booting.rst |
| 67 |
Latest version: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/arch/arm/booting.rst |
| 68 |
|
| 69 |
[2] linux/Documentation/arm64/booting.rst |
| 70 |
Latest version: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/arch/arm64/booting.rst |
| 71 |
|
| 72 |
[3] legacy format header |
| 73 |
Latest version: https://source.denx.de/u-boot/u-boot/-/blob/master/include/image.h#L315 |
| 74 |
https://linux.die.net/man/1/mkimage |