Table of Contents
PART 1: VM types and reference usage scenario
PART 2: Understand Configurations
PART 3: acrn-config preliminary
PART 4: Let’s start!
…………………….. page 3
…………………….. page 10
…………………….. page 23
…………………….. page 32
ACRN VM types
❑ Pre-launched VM
• Launched earlier by ACRN hypervisor
❑ Service OS VM
• Special pre-launched VM
• Launched by ACRN hypervisor
• Provide service for post-launched VM
❑ Post-launched VM
• Later launched by Service OS VM
ACRN usage scenarios
❑SDC
• classic usage for Software Defined Cockpit
❑ SDC2
• advanced usage for Software Defined Cockpit
❑ INDUSTRY
• classic usage for industry
❑ HYBRID
• advanced usage for industry
❑ LOGICAL_PARTITION
• classic usage for two isolated VMs
Currently ACRN support five reference working scenarios
*For more details in
https://projectacrn.github.io/latest/introduction/index.html?#usage-scenarios
Classify ACRN Configurations
❑ Hypervisor configurations
▪ configure main features/capabilities that supported by ACRN
hypervisor
❑ VM configurations
▪ Describe characteristic/attributes of EACH VM from usage scenario
perspective
❑ Board configurations
▪ provide hardware/board specific information that referenced by ACRN
hypervisor
Hypervisor Configurations - Coverage
• Basic configurations
❖ Board/scenario: make HV on specific board for specific working scenario
❖ Bootloader protocol/UEFI loader name/…
• Feature and Capabilities
❖ Scheduler setup/RDT/ACPI parser/Relocatable/…
• Capacities
❖ Give max boundary for static data structure set up required by FuSa like
MAX_xxx_NUM
❖ HV/SOS/UOS RAM size
• Configurations for debug
❖ Serial setting/log level/… etc.
Hypervisor Configurations - Format
Hypervisor configurations are in config.h format referenced by hypervisor
code, it is generated by Kconfig and not visible in current code base;
VM Configurations - Coverage
• Basic configurations
❖ VM name
❖ Load type
❖ UUID
❖ VCPU settings
❖ Memory settings
❖ Guest OS settings
• Feature and Capabilities
❖ CLOS/RDT settings
❖ Guest flags
• Device settings
❖ UART settings
❖ Passthrough devices
❖ Virtio devices
VM Configurations – C code
For Pre-launched VM and SOS VM, all configurations are in *.c/h format
referenced by hypervisor
VM Configurations – launch script
For Post-launched VM, besides C code configurations most
configurations are in launch script file.
VM Configurations – C code Location
• VM configurations are scenario specific, it is located
in scenarios/$(SCENARIO)/ folder.
VM launch script Location
• The reference launch script for post-launched VM is
located in devicemodel/samples folder and need to
be copied to SOS rootfs.
Board Configurations - Coverage
• Native hardware info
❖ ACPI info
❖ CPU Number
❖ P/C state table
❖ native RDT resource info
❖ DMAR info
• Diff info for different VM configurations
❖ Rootdevice
❖ Guest Bootargs
❖ Customized RDT resource
❖ Pass through devices
• Diff info in hypervisor configurations
❖ HV start address
❖ Debug serial settings
Board Configurations - Location
• Native hardware info
❖ For pre-launched VM and SOS VM, all in *.c/*.h format under
hypervisor/arch/x86/$(BOARD)/ folder;
❖ For post-launched VM, it is in launch script;
• Diff info for different VM configurations
❖ For pre-launched VM and SOS VM, all in *.c/*.h format under
hypervisor/arch/x86/$(BOARD)/ folder;
❖ For post-launched VM, it is in launch script;
• Diff info in hypervisor configurations
❖ In defconfig file format at hypervisor/arch/x86/$(BOARD).config
Does this mean we need to
modify the source code to
configure the new board by
manual?
Of course developer could do so,
but for starters …
Use the ACRN Configuration App
ACRN Configuration App: a web user interface application based on
Flask
▪ Imports board info for current reference
▪ Imports saved scenario/launch XML files for re-configuration
▪ Exports current configuration items and save to XML file
▪ 1-click to generate source code for board/scenario/launch
configurations
▪ Validates current configurations before file exporting or
source code generating
* source: acrn-hypervisor/misc/acrn-config/config_app/
* the app needs network to download some js/css
Acrn configuration XMLs format
We use different root element to identify XML type:
Board XML:
❖ <acrn-config board="BOARD">
Scenario XML:
❖ <acrn-config board="BOARD" scenario="SCENARIO">
Launch XML:
❖ <acrn-config board="BOARD" scenario="SCENARIO"
uos_launcher="UOS_NUMBER">
Scenario/Launch XML rule
▪ Tag name will be shown as a configurable item. (eg. Loader_order/memory)
▪ The desc attribute of a tag will be used as remark for the configurable item.
▪ The configurable and readonly attributes are used to mark whether the items is
configurable for users.
▪ When there is no configurable="0" nor readonly="true", the item is configurable
from the web user Interface.
▪ When configurable="0" or readonly="true", the item is not configurable from the
web user interface.
▪ When configurable="0". the item does not appear on the interface.
1. be careful of your boot mode
• De-privilege boot mode – boot ACRN by efi application
❖ Only work on scenarios that SOS as VM0 (i.e. SDC/SDC2/INDUSTRY)
❖ Only work on platform with UEFI BIOS
❖ SOS cmdline is configured in acrn.conf file of EFI partition
• Direct boot – boot ACRN by GRUB
❖ work on all scenarios and platform with UEFI/ABL/SBL
❖ SOS cmdline should be configured in hypervisor source
2. get target board info
• Setup native Linux environment on target
❖Ubuntu 18.04+ or ClearLinux 30210+
❖Required tools: python3, cpuid, rdmsr, lspci, dmidecode
❖Add cmdline of “idle=nomwait intel_pstate=disable intel_idle.max_cstate=0”
• Copy folder of “acrn-hypervisor/misc/acrn-config/target”to
target
• Run “sudo python3 board_parser.py $(BOARD_NAME)” to
get your board.xml
• Board.xml includes physical platform info like
ACPI/memory/cpuinfo for acrn-config tool reference
3. make menuconfig
• Enter acrn-hypervisor/hypervisor folder and run
“make menuconfig”
• Configure board name, choose your scenario and
other items
• The configurations will be saved in
hypervisor/build/.config file for your reference
4. launch config app
• Install its requirements (one time setup):
$ cd ~/acrn-hypervisor/misc/acrn-config/config_app
$ sudo pip3 install -r requirements
• Launch app:
$ python3 app.py
Open a browser and navigate to the website http://127.0.0.1:5001/
automatically, or you may need to visit this website manually.
15. Let’s rock!
• Deploy ACRN on your target board
• Copy launch script to SOS VM and run!
NOTES
• Current acrn code is buggy on some server platform
• acrn-config refinement is still ongoing
• Hypervisor serial config is important for debug!
• Please refer
https://projectacrn.github.io/latest/tutorials/acrn_config
uration_tool.html for more details
Staging change
• Remove git commit, it is meaningless if source in a
tarball;
• Define HV specific xml instead of Kconfig file to store
HV configurations;
• Do not overwrite current configuration code base, i.e.
generate target configuration to a specified folder