Anastasiia Lukianenko | 8071348 | 2020-08-06 12:43:01 +0300 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | Xen guest ARM64 board |
| 4 | ===================== |
| 5 | |
| 6 | This board specification |
| 7 | ------------------------ |
| 8 | |
Michal Simek | 1be82af | 2023-05-17 09:17:16 +0200 | [diff] [blame] | 9 | This board is to be run as a virtual Xen [1] guest with U-Boot as its primary |
Anastasiia Lukianenko | 8071348 | 2020-08-06 12:43:01 +0300 | [diff] [blame] | 10 | bootloader. Xen is a type 1 hypervisor that allows multiple operating systems |
| 11 | to run simultaneously on a single physical server. Xen is capable of running |
| 12 | virtual machines in both full virtualization and para-virtualization (PV) |
| 13 | modes. Xen runs virtual machines, which are called “domains”. |
| 14 | |
| 15 | Paravirtualized drivers are a special type of device drivers that are used in |
| 16 | a guest system in the Xen domain and perform I/O operations using a special |
| 17 | interface provided by the virtualization system and the host system. |
| 18 | |
Michal Simek | 1be82af | 2023-05-17 09:17:16 +0200 | [diff] [blame] | 19 | Xen support for U-Boot is implemented by introducing a new Xen guest ARM64 |
Anastasiia Lukianenko | 8071348 | 2020-08-06 12:43:01 +0300 | [diff] [blame] | 20 | board and porting essential drivers from MiniOS [3] as well as some of the work |
| 21 | previously done by NXP [4]: |
| 22 | |
| 23 | - PV block device frontend driver with XenStore based device enumeration and |
| 24 | UCLASS_PVBLOCK class; |
| 25 | - PV serial console device frontend driver; |
Andrii Chepurnyi | 0501c99 | 2023-10-03 08:58:28 +0000 | [diff] [blame] | 26 | - Virtio block device support; |
Anastasiia Lukianenko | 8071348 | 2020-08-06 12:43:01 +0300 | [diff] [blame] | 27 | - Xen hypervisor support with minimal set of the essential headers adapted from |
| 28 | the Linux kernel; |
| 29 | - Xen grant table support; |
| 30 | - Xen event channel support in polling mode; |
| 31 | - XenBus support; |
| 32 | - dynamic RAM size as defined in the device tree instead of the statically |
| 33 | defined values; |
| 34 | - position-independent pre-relocation code is used as we cannot statically |
| 35 | define any start addresses at compile time which is up to Xen to choose at |
| 36 | run-time; |
| 37 | - new defconfig introduced: xenguest_arm64_defconfig. |
Andrii Chepurnyi | 0501c99 | 2023-10-03 08:58:28 +0000 | [diff] [blame] | 38 | - new defconfig introduced: xenguest_arm64_virtio_defconfig. |
Anastasiia Lukianenko | 8071348 | 2020-08-06 12:43:01 +0300 | [diff] [blame] | 39 | |
| 40 | |
| 41 | Board limitations |
| 42 | ----------------- |
| 43 | |
Michal Simek | 1be82af | 2023-05-17 09:17:16 +0200 | [diff] [blame] | 44 | 1. U-Boot runs without MMU enabled at the early stages. |
Anastasiia Lukianenko | 8071348 | 2020-08-06 12:43:01 +0300 | [diff] [blame] | 45 | According to Xen on ARM ABI (xen/include/public/arch-arm.h): all memory |
| 46 | which is shared with other entities in the system (including the hypervisor |
| 47 | and other guests) must reside in memory which is mapped as Normal Inner |
| 48 | Write-Back Outer Write-Back Inner-Shareable. |
| 49 | Thus, page attributes must be equally set for all the entities working with |
| 50 | that page. |
| 51 | Before MMU is set up the data cache is turned off and pages are seen by the |
| 52 | vCPU and Xen in different ways - cacheable by Xen and non-cacheable by vCPU. |
| 53 | So it means that manual data cache maintenance is required at the early |
| 54 | stages. |
| 55 | |
| 56 | 2. No serial console until MMU is up. |
| 57 | Because data cache maintenance is required until the MMU setup the |
| 58 | early/debug serial console is not implemented. Therefore, we do not have |
Michal Simek | 1be82af | 2023-05-17 09:17:16 +0200 | [diff] [blame] | 59 | usual prints like U-Boot’s banner etc. until the serial driver is |
Anastasiia Lukianenko | 8071348 | 2020-08-06 12:43:01 +0300 | [diff] [blame] | 60 | initialized. |
| 61 | |
| 62 | 3. Single RAM bank supported. |
| 63 | If a Xen guest is given much memory it is possible that Xen allocates two |
| 64 | memory banks for it. The first one is allocated under 4GB address space and |
| 65 | in some cases may represent the whole guest’s memory. It is assumed that |
Michal Simek | 1be82af | 2023-05-17 09:17:16 +0200 | [diff] [blame] | 66 | U-Boot most likely won’t require high memory bank for its work andlaunching |
Anastasiia Lukianenko | 8071348 | 2020-08-06 12:43:01 +0300 | [diff] [blame] | 67 | OS, so it is enough to take the first one. |
| 68 | |
| 69 | |
| 70 | Board default configuration |
| 71 | --------------------------- |
| 72 | |
| 73 | One can select the configuration as follows: |
| 74 | |
| 75 | - make xenguest_arm64_defconfig |
| 76 | |
| 77 | [1] - https://xenproject.org/ |
| 78 | |
| 79 | [2] - https://wiki.xenproject.org/wiki/Paravirtualization_(PV) |
| 80 | |
| 81 | [3] - https://wiki.xenproject.org/wiki/Mini-OS |
| 82 | |
| 83 | [4] - https://source.codeaurora.org/external/imx/uboot-imx/tree/?h=imx_v2018.03_4.14.98_2.0.0_ga |