Advertisement
Advertisement

More Related Content

Slideshows for you(20)

Advertisement
Advertisement

Project ACRN configuration scenarios and config tool

  1. ACRN Configuration: scenarios and config tool Victor Sun victor.sun@intel.com 3/18/2020
  2. 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
  3. 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
  4. 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
  5. Reference scenario1: SDC • 1 SOS VM (VM0) with 1 Post-launched user VM (VM1)
  6. Reference scenario2: SDC • 1 SOS VM (VM0) with up to 3 Post-launched user VMs (VM1/2/3)
  7. Reference scenario3: INDUSTRY • 1 SOS VM (VM0) with up to 2 Post-launched user VMs (VM1/2) • VM2 is Realtime capable
  8. Reference scenario4: HYBRID • 1 Pre-launched safety VM (VM0) with 1 SOS VM (VM1) and 1 Post-launched user VM (VM2)
  9. Reference scenario5: LOGICAL_PARTITION • 1 Pre-launched safety VM (VM0) and 1 Pre-launched user VM (VM1)
  10. 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
  11. 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.
  12. 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;
  13. Hypervisor Configurations – menuconfig
  14. 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
  15. VM Configurations – C code For Pre-launched VM and SOS VM, all configurations are in *.c/h format referenced by hypervisor
  16. VM Configurations – launch script For Post-launched VM, besides C code configurations most configurations are in launch script file.
  17. VM Configurations – C code Location • VM configurations are scenario specific, it is located in scenarios/$(SCENARIO)/ folder.
  18. 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.
  19. 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
  20. 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
  21. 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 …
  22. But now, we have acrn-config tool!
  23. Configuration tool coverage • Hypervisor configurations ❖ hypervisor/arch/x86/Kconfig • VM configurations ❖ scenario-based: hypervisor/$(SCENARIO)/*.c(*.h) ❖ launch script-based: devicemodel/samples/*.sh • Board configurations ❖ HV-based: hypervisor/arch/x86/configs/$(BOARD).config ❖ scenario-based: hypervisor/arch/x86/configs/$(BOARD)/*.c(*.h) ❖ launch script-based: devicemodel/samples/*.sh Covered by menuconfig Covered by acrn-config
  24. acrn-config tool source code acrn-hypervisor/misc/acrn-config/
  25. Diagram of acrn-config Working Flow
  26. 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
  27. acrn-config xmls acrn-hypervisor/misc/acrn-config/xmls/
  28. 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">
  29. 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.
  30. Glimpse of scenario XML
  31. Glimpse of acrn-config webUI
  32. Let’s start!
  33. 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
  34. 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
  35. 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
  36. 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.
  37. 5. Import Board info
  38. 6. Switch to your board
  39. 7. select your scenario
  40. 8. Configure your scenario • Important: Choose right rootfs/console/bootargs for VM0
  41. 9. Generate source
  42. 10.(optional)Export configurations to XML
  43. 11. Make hypervisor $ cd ~/acrn-hypervisor $ make all BOARD=xxxxx SCENARIO=yyyyy
  44. 12. Switch to launch setting
  45. 13. Switch to launch setting
  46. 14. generate launch script
  47. 15. Let’s rock! • Deploy ACRN on your target board • Copy launch script to SOS VM and run!
  48. 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
  49. 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
  50. Thank you
Advertisement