|
3 | 3 | ACRN Configuration Tool
|
4 | 4 | #######################
|
5 | 5 |
|
| 6 | +.. note:: This document is under development and planned for the 1.3 |
| 7 | + release. |
| 8 | + |
| 9 | + |
6 | 10 | ACRN Configurations Introduction
|
7 | 11 | ********************************
|
8 |
| -There are three types of configurations in ACRN: Hypervisor configurations, |
9 |
| -Board configurations and VM configurations. |
| 12 | +There are three types of configurations in ACRN: Hypervisor, |
| 13 | +Board, and VM. We'll explore each of these in the following sections. |
10 | 14 |
|
11 |
| -Hypervisor configurations |
12 |
| -========================= |
13 |
| -Hypervisor configurations is used to select working scenario and target board, |
14 |
| -configure features and capabilities, set up log and serial port etc. to build |
15 |
| -differential hypervisor image for different board. |
| 15 | +Hypervisor configuration |
| 16 | +======================== |
| 17 | +Hypervisor configuration selects a working scenario and target |
| 18 | +board by configuring the hypervisor image features and capabilities such as |
| 19 | +setting up the log and the serial port. |
16 | 20 |
|
17 |
| -Hypervisor configurations is configured by ``Kconfig`` mechanism. |
18 |
| -The configuration file is located at:: |
| 21 | +Hypervisor configuration is done using the ``Kconfig`` ``make |
| 22 | +menuconfig`` mechanism. The configuration file is located at:: |
19 | 23 |
|
20 | 24 | acrn-hypervisor/hypervisor/arch/x86/configs/Kconfig
|
21 | 25 |
|
22 |
| -A defconfig file which located at:: |
| 26 | +A board-specific ``defconfig`` file, located at:: |
23 | 27 |
|
24 | 28 | acrn-hypervisor/hypervisor/arch/x86/configs/$(BOARD)/$(BOARD).config
|
25 | 29 |
|
26 |
| -will be loaded first as the default ``Kconfig`` for the specified board. |
| 30 | +will be loaded first, as the default ``Kconfig`` for the specified board. |
27 | 31 |
|
28 |
| -Board configurations |
29 |
| -==================== |
30 |
| -Board configurations is used to store board related configurations that referenced |
31 |
| -by ACRN hypervisor, including scenario irrelevant information and scenario relevant |
32 |
| -information. Scenario irrelevant information is hardware specific, like ACPI/PCI |
33 |
| -BDF info/.etc. Scenario relevant information is board settings in each scenario |
34 |
| -like root device selection/kernel cmdline. The board configuration is organized |
35 |
| -as ``*.c/*.h`` file and located at:: |
| 32 | +Board configuration |
| 33 | +=================== |
| 34 | +The board configuration stores board-specific settings referenced by the |
| 35 | +ACRN hypervisor. This includes *scenario-relevant* information such as |
| 36 | +board settings, root device selection, and kernel cmdline, and |
| 37 | +*scenario-irrelevant** hardware-specific information such as ACPI/PCI |
| 38 | +and BDF information. The board configuration is organized as |
| 39 | +``*.c/*.h`` files located at:: |
36 | 40 |
|
37 | 41 | acrn-hypervisor/hypervisor/arch/x86/$(BOARD)/
|
38 | 42 |
|
39 |
| -VM configurations |
| 43 | +VM configuration |
40 | 44 | =================
|
41 |
| -VM configurations includes scenario based VM configurations and launch script |
42 |
| -based VM configurations. The former one is used to describe characteristic/attributes |
43 |
| -of the VM on each user scenario, another is launch script parameters for device model |
44 |
| -to launch post-launched User VM. Scenario based VM configurations is organized |
45 |
| -as ``*.c/*.h`` file and located at:: |
| 45 | +VM configuration includes *scenario-based* VM configuration |
| 46 | +information, used to describe the characteristics and attributes for VMs |
| 47 | +on each user scenario, and *launch script-based* VM configuration, where |
| 48 | +parameters are passed to the device model to launch post-launched User |
| 49 | +VMs. |
| 50 | + |
| 51 | +Scenario based VM configurations are organized |
| 52 | +as ``*.c/*.h`` files located at:: |
46 | 53 |
|
47 | 54 | acrn-hypervisor/hypervisor/scenarios/$(SCENARIO)/
|
48 | 55 |
|
49 | 56 | User VM launch script samples are located at::
|
50 | 57 |
|
51 | 58 | acrn-hypervisor/devicemodel/samples/
|
52 | 59 |
|
53 |
| -Configuration Tool Working Flow |
54 |
| -******************************* |
| 60 | +Configuration tool workflow |
| 61 | +*************************** |
55 | 62 |
|
56 |
| -Kconfig |
57 |
| -======= |
58 |
| -Hypervisor configurations is based on ``Kconfig`` ``make menuconfig`` mechanism, |
59 |
| -user could configure it in menuconfig GUI by using ``make menuconfig`` |
60 |
| -command to generate the needed ``.config`` file for hypervisor build usage. |
61 |
| -Before running ``make menuconfig``, user need to create board specific ``defconfig`` |
62 |
| -to setup default ``Kconfig`` value for the specified board. |
| 63 | +Hypervisor configuration workflow |
| 64 | +================================== |
| 65 | +Hypervisor configuration is based on the ``Kconfig`` ``make menuconfig`` |
| 66 | +mechanism. You begin by creating a board specific ``defconfig`` file to |
| 67 | +set up the default ``Kconfig`` values for the specified board. |
| 68 | +Then you configure the hypervisor build options using the ``make |
| 69 | +menuconfig`` graphical interface. The resulting ``.config`` file is |
| 70 | +used by the ACRN build process to create a configured scenario- and |
| 71 | +board-specific hypervisor image. |
63 | 72 |
|
64 | 73 | .. figure:: images/sample_of_defconfig.png
|
65 | 74 | :align: center
|
66 | 75 |
|
67 |
| - Sample of defconfig file |
| 76 | + defconfig file sample |
68 | 77 |
|
69 | 78 | .. figure:: images/GUI_of_menuconfig.png
|
70 | 79 | :align: center
|
71 | 80 |
|
72 |
| - GUI of menuconfig |
| 81 | + menuconfig interface sample |
73 | 82 |
|
74 |
| -Please refer to the :ref:`getting-started-hypervisor-configuration` for detailed steps. |
| 83 | +Please refer to the :ref:`getting-started-hypervisor-configuration` for |
| 84 | +detailed steps. |
75 | 85 |
|
76 |
| -Offline configure tool |
77 |
| -====================== |
78 |
| -For Board configurations and VM configurations, an offline configure tool is |
79 |
| -designed to configure them. The tool source folder is located at:: |
| 86 | +Board and VM configuration workflow |
| 87 | +=================================== |
| 88 | +Python offline tools are provided to configure Board and VM configurations. |
| 89 | +The tool source folder is located at:: |
80 | 90 |
|
81 | 91 | acrn-hypervisor/misc/acrn-config/
|
82 | 92 |
|
83 |
| -Below is offline configure tool working flow: |
| 93 | +Here is the offline configuration tool workflow: |
84 | 94 |
|
85 | 95 | #. Get board info.
|
86 | 96 |
|
87 |
| - a. Setup native Linux environment on target board. |
| 97 | + a. Set up native Linux environment on target board. |
88 | 98 | #. Copy ``target`` folder into target file system and then run
|
89 | 99 | ``sudo python3 board_parser.py $(BOARD)`` command.
|
90 |
| - #. A $(BOARD).xml which includes all needed hardware specific information |
91 |
| - will be generated at ``./out/`` folder. (Here $(BOARD) is the specified board name) |
| 100 | + #. A $(BOARD).xml that includes all needed hardware-specific information |
| 101 | + will be generated in the ``./out/`` folder. (Here ``$(BOARD)`` is the |
| 102 | + specified board name) |
92 | 103 |
|
93 |
| - | **Native Linux requirement:** |
94 |
| - | **Release:** Ubuntu 18.04+ or ClearLinux 30210+ |
95 |
| - | **Tools:** cpuid, rdmsr, lspci, dmidecode(optional) |
96 |
| - | **Kernel cmdline:** "idle=nomwait intel_idle.max_cstate=0 intel_pstate=disable" |
| 104 | + | **Native Linux requirement:** |
| 105 | + | **Release:** Ubuntu 18.04+ or Clear Linux 30210+ |
| 106 | + | **Tools:** cpuid, rdmsr, lspci, dmidecode (optional) |
| 107 | + | **Kernel cmdline:** "idle=nomwait intel_idle.max_cstate=0 intel_pstate=disable" |
97 | 108 |
|
98 | 109 | #. Customize your needs.
|
99 | 110 |
|
100 | 111 | .. note:: **[TO BE DEVELOPED]**
|
101 |
| - The tool in this step is still under development, before its readiness user |
102 |
| - could input the setting by editing the target XML file manually. |
103 |
| - |
104 |
| - a. Copy ``$(BOARD).xml`` to host develop machine; |
105 |
| - #. Run a UI based configure tool on host machine to input the expected scenario settings, |
106 |
| - the tool will do sanity check on the input based on ``$(BOARD).xml`` and then generate |
107 |
| - customized scenario based VM configurations in ``$(SCENARIO).xml``; |
108 |
| - #. In the UI of configure tool, continue to input launch script parameter for |
109 |
| - post-launched User VM. The tool will check the input based on both ``$(BOARD).xml`` |
110 |
| - and ``$(SCENARIO).xml`` and then generate launch script based VM configurations in |
111 |
| - ``$(LAUNCH_PARAM).xml``; |
| 112 | + The tool in this step is still under development. Until then, |
| 113 | + you can input settings by editing the target XML file manually. |
| 114 | + |
| 115 | + a. Copy ``$(BOARD).xml`` to the host develop machine. |
| 116 | + #. Run a UI based configuration tool on the host machine to input the |
| 117 | + desired scenario settings. The tool will do a sanity check on the |
| 118 | + input based on ``$(BOARD).xml`` and then generate a customized |
| 119 | + scenario-based VM configurations in ``$(SCENARIO).xml``. |
| 120 | + #. In the configuration tool UI, input the launch script parameters for the |
| 121 | + post-launched User VM. The tool will sanity check the input based on |
| 122 | + both ``$(BOARD).xml`` and ``$(SCENARIO).xml`` and then generate a launch |
| 123 | + script-based VM configuration in ``$(LAUNCH_PARAM).xml``. |
112 | 124 |
|
113 | 125 | #. Auto generate code.
|
114 |
| - There are three python tools will be used to generate configurations in patch format. |
115 |
| - The patches will be applied to ``acrn-hypervisor`` git tree automatically. |
116 | 126 |
|
117 |
| - a. Run ``python3 board_cfg_gen.py --board $(BOARD).xml`` under ``misc/board_config`` |
118 |
| - folder, it will generate patch for board related configurations; |
119 |
| - #. **[TO BE DEVELOPED]** Run ``python3 scenario_cfg_gen.py --board $(BOARD).xml --scenario |
120 |
| - $(SCENARIO).xml`` under ``misc/scenario_config`` folder, it will generate patch |
121 |
| - for scenario based VM configurations; |
122 |
| - #. **[TO BE DEVELOPED]** Run ``python3 launch_cfg_gen.py --board $(BOARD).xml |
123 |
| - --scenario $(SCENARIO).xml --launch $(LAUNCH_PARAM).xml$`` under ``misc/launch_config`` |
124 |
| - folder, it will generate launch script for the specified post-launch User VM; |
| 127 | + Python tools are used to generate configurations in patch format. |
| 128 | + The patches will be applied to your local ``acrn-hypervisor`` git tree |
| 129 | + automatically. |
| 130 | + |
| 131 | + a. Generate a patch for the board-related configuration with:: |
| 132 | + |
| 133 | + cd misc/board_config |
| 134 | + python3 board_cfg_gen.py --board $(BOARD).xml |
| 135 | + |
| 136 | + #. **[TO BE DEVELOPED]** Generate a patch for scenario-based VM |
| 137 | + configuration with:: |
| 138 | + |
| 139 | + cd misc/scenario_config |
| 140 | + python3 scenario_cfg_gen.py --board $(BOARD).xml --scenario |
| 141 | + |
| 142 | + #. **[TO BE DEVELOPED]** Generate the launch script for the specified |
| 143 | + post-launch User VM with:: |
| 144 | + |
| 145 | + cd misc/launch_config |
| 146 | + python3 launch_cfg_gen.py --board $(BOARD).xml --scenario $(SCENARIO).xml --launch $(LAUNCH_PARAM).xml$ |
125 | 147 |
|
126 |
| -#. Re-build ACRN hypervisor. Please refer to the :ref:`getting-started-building` |
127 |
| - to re-build ACRN hypervisor on host machine; |
| 148 | +#. Re-build the ACRN hypervisor. Please refer to the |
| 149 | + :ref:`getting-started-building` to re-build ACRN hypervisor on host machine. |
128 | 150 |
|
129 | 151 | #. Deploy VMs and run ACRN hypervisor on target board.
|
130 | 152 |
|
131 | 153 | .. figure:: images/offline_tools_workflow.png
|
132 | 154 | :align: center
|
133 | 155 |
|
134 |
| - offline tool working flow |
| 156 | + offline tool workflow |
0 commit comments