Commit Graph

1384 Commits

Author SHA1 Message Date
Weiyi Feng a2cf3ac46b config_tools: add set default function for cat widget
add set default function for cat widget

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-05-24 10:57:45 +08:00
Chenli Wei bfa91dccfc misc: hide RDT for basic mode
The current RDT element display for basic and advance mode, it not
necessary, so this patch hide RDT for basic mode.

Tracked-On: #6690
Signed-off-by: Chenli Wei chenli.wei@intel.com
2022-05-24 10:15:55 +08:00
Chenli Wei de13c67b9d misc: fix the physical memory segmentation UI issue
Current physical memory segmentation UI have an redundant title when
user select the advance mode, so we set the MemoryInfo element title
to NULL to fix this issue.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-05-23 17:46:42 +08:00
Wu Zhou ed70da3ed6 config-tools: change the tooltip width to 60%
Tooltip width was set to 50%. This could not just cut the line into
2 lines, for the line has to be cut by word. This would leave one
word on a new line, looks weird.

Set to 60% will solve this issue.

Tracked-On: #7541

Signed-off-by: Wu Zhou <wu.zhou@intel.com>
2022-05-23 17:17:55 +08:00
Kunhui-Li 56602a42f0 config_tools: add restriction for Maximum Virtual CLOS configuration
Add restriction for Maximum Virtual CLOS configuration that don't allow
negative numbers.

Tracked-On: #7530
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-05-23 16:38:04 +08:00
Kunhui-Li af10a3bb0a config_tools: hide tty and sock in UI
For virtio console, in order to hide tty and sock backend types,
change "xs:sequence" to "xs:all" in the XML schema
to slice the backend type list and update backend type to
"BasicVirtioConsoleBackendType" to call the sliced value.

Tracked-On: #6691
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-05-23 16:38:04 +08:00
Conghui 57e0b966e9 config-tools: bugfix for saving configuration
When user delete all the VMs from UI, and click 'Save' button, a warning
message should appear to show that at least one VM is needed.

Tracked-On: #7532
Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-23 15:37:58 +08:00
Conghui 73f0d2795d config-tools: clean launch scripts before saving
Clean all launch scripts before click "Save" button, the new launch
scripts will be created after that.

Add a blank line to the warning dialog box.

Tracked-On: #7532
Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-23 15:37:58 +08:00
Conghui 38905c663f config-tools: change dialog box message
Change dialog box message when click "Use a Different Board" button.

Tracked-On: #7532
Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-23 15:37:58 +08:00
Wu Zhou 59ec4cf6c2 config-tools: add vsock option in configurator
vsock is the new socket address family for host/guest communication.
Configurator option for vsock CID is added in this patch.
Also vsock parameter is generated in script.

Tracked-On: #7535
Signed-off-by: Wu Zhou <wu.zhou@intel.com>
2022-05-23 14:44:25 +08:00
Weiyi Feng 84550004dd config_tools: add custom CAT widget
add custom CAT widget

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-05-22 20:10:24 +08:00
Weiyi Feng 8ffbcc22ce config_tools: fix Windows config_tools package build script
fix error return code of config_tools python package build script in Windows environment

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-05-22 20:10:24 +08:00
Weiyi Feng b288ae9ce7 config_tools: ignore cache in develop env
ignore cache in develop env

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-05-22 20:10:24 +08:00
Conghui 6a0ada0a91 config-tools: change name for board XML
Use file name as the board xml name instead of using the name in
'board' field in board XML.

e.g.

1. Initial filename is "my_potato.xml"
2. User imports my_potato.xml into the Configurator
3. Resulting file is my_potato.board.xml

Tracked-On: #7521
Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-21 23:23:02 +08:00
Conghui 777cfae536 config-tools: change warning message
Change warning message for deleting pre-launched VM and post-launched VM.

Tracked-On: #7524
Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-21 20:03:01 +08:00
Conghui b4306fa1ee config-tools: correct the confirm log
When clicking the Save button in UI, the log message is incorrect for
pre-launched VM.
Do not show 'launch script' related message when there is only pre-launched
VMs.

Tracked-On: #7524
Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-21 20:03:01 +08:00
Calvin Zhang 4e2abfb473 misc: configurator: add check for uniqueness of cpus in Pre-launched VM
CPUs assigned to Pre-launched VM can not be shared. Add a xsd rule to
check it.

Tracked-On: #7526
Signed-off-by: Calvin Zhang <calvinzhang.cool@gmail.com>
2022-05-20 18:55:10 +08:00
Calvin Zhang 8a6445d949 misc: configurator: Remove acrn config files when selecting a working folder
Instead of removing all .xml and .sh files, just remove:
*.board.xml
scenario.xml
launch*.sh

Tracked-On: #7495
Signed-off-by: Calvin Zhang <calvinzhang.cool@gmail.com>
2022-05-20 17:22:53 +08:00
Ziheng Li 72054f57fa [config_tool] Duplicate VM name
refine error messages.

Tracked-On: projectacrn#7519
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-05-20 16:53:48 +08:00
Junjie Mao be2e411f33 config_tools: fix option passing to device model in launch scripts
Generated launch scripts tracks the options to ACRN device model in an
array `dm_params`. Those scripts use `${dm_params[*]}` to join all
elements in the array and pass the joined string to acrn-dm.

One tricky thing about `${dm_params[*]}` is that it joins the array
elements as one single unquoted string. This means an option as a string
with whitespaces will be split by the shell and passed to acrn-dm as
multiple options. This does not happen to the options generated today, but
prevents users from using, e.g., the -B option to pass the full command
line options for the guest kernel.

Rather than joining all elements as an unquoted string, it is more
preferrable to treat each element in `dm_params` as a quoted string. This
patch does this by:

  1. replacing `${dm_params[*]}` with `"{dm_params[@]}"`, and

  2. removing the quotes around plaintext options in `dm_params`.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-05-20 15:54:56 +08:00
Yuanyuan Zhao 3d62043c7b config_tool: add 'make clean' to local directory
This patch use 'make clean' to clean up the files left after
a 'make configurator'.

Tracked-On: #7508
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
2022-05-20 14:25:33 +08:00
hangliu1 82232f7f75 misc: configurator:Fix delete vm button apearance
update activeVMID to make the delete vm button disappear
when all VMs are deleted.

Tracked-On: #7516
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-05-20 13:37:46 +08:00
David B. Kinder c60c89d3de config: restore FEATURES on the basic tab
A previous PR incorectly removed the hypervisor FEATURES options on the
basic tab because all options were advanced.  One wasn't (IVSHMEM).

Tracked-on: #7514

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-05-20 11:54:36 +08:00
Chenli Wei f7094466cb misc: add the define of MAX_IR_ENTRIES
The current code align MAX_IR_ENTRIES with the roundup to 2^n of the
CONFIG_MAX_PT_IRQ_ENTRIES, there is an issue of the powerof2_roundup to
calculate the macro, and the code style is very ugly when we use macro
to fix it.

So this patch move the calculate and define of MAX_IR_ENTRIES to offline
tool.

Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-05-20 09:08:47 +08:00
Calvin Zhang 12b81d83ca misc: configurator: validate user settings before writing down
After clicking save button, validate settings before writing down
scenario.xml, otherwise broken scenario.xml will be generated.

Tracked-On: #7470
Signed-off-by: Calvin Zhang <calvinzhang.cool@gmail.com>
2022-05-19 16:50:15 +08:00
Wu Zhou eac0e335a8 config-tools: add validation to vuart widget
vuart widget don't have empty line check for required fields.
Added in this patch.

Tracked-On: #7506
Signed-off-by: Wu Zhou <wu.zhou@intel.com>
2022-05-19 13:15:23 +08:00
Wu Zhou c4216a3817 config-tools: vuart widget's vm_name changes when edited
When vm_name is edited in in the vm tab, the vuart connection widget's
vm_name field should change to the new name. Add name replacing in form
change event.

Tracked-On: #7506
Signed-off-by: Wu Zhou <wu.zhou@intel.com>
2022-05-19 13:15:23 +08:00
Yuanyuan Zhao e106766b9e config_tools: add LAPIC passthrough to Service VM
Add LAPIC passthrough to Service VM advanced Parameters tab.

Tracked-On: #7502
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
2022-05-19 10:47:08 +08:00
Calvin Zhang e4f11ca4c8 misc: configurator: report the errors on clicking save button
On clicking save button, current scenario configuration is validated and
errors should be prompted out if any.

BTW, fix unrecognized value in cpu affinity object.

Fixes: 5a3b38f778 ("config-tools: add confirm message")
Tracked-On: #7469
Signed-off-by: Calvin Zhang <calvinzhang.cool@gmail.com>
2022-05-19 10:21:17 +08:00
Wu Zhou 7750a6c25b config-tools: add property check before IVSHMEM
If IVSHMEM is not presented, reading its property could lead to
failure in js. Add property check before it.

Tracked-On: #7500

Signed-off-by: Wu Zhou <wu.zhou@intel.com>
2022-05-19 09:54:40 +08:00
Junjie Mao c4f46d9c28 config_tools: gracefully process board XMLs with non-standard info
Occasionally the regular expressions searching for manufacturer and product
name of the target board fail to find a matching line in a given board XML,
possibly because the board XML does not contain such info. This causes an
alert to be raised while it does not impact the functionality of the
configurator.

This patch adds a check to suppress such alerts.

Tracked-On: #6691
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-05-19 09:31:46 +08:00
Junjie Mao 22a47fe795 config_tools: check XML file structures on load
This patch validates the structure of the XML files given before they are
further used by the rest of the configurator. With this validation process,
the configurator confirms the XML files are well-structured and can thus
access certain nodes and contents without checking their existence or data
types.

Upon validation failure, an alert will pop up informing the user that the
given XML file is ill-formed. No further details are given as of now
because we assume users should not care about the internal structure of
those files.

Tracked-On: #6691
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-05-19 09:31:46 +08:00
Ziheng Li 54ff64acc1 board_inspector.py fails to run on target with clean Ubuntu installation
Python package is not in debian package, so put its installation
process in the acrn-board-inspector.postinst script

Tracked-On: projectacrn#7498
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-05-18 15:41:42 +08:00
Calvin Zhang a8a9b2f40a misc: configurator: remove config files when choosing a working folder
Instead of deleting all files, just remove xml and launch scripts.

Tracked-On: #7495
Signed-off-by: Calvin Zhang <calvinzhang.cool@gmail.com>
2022-05-18 15:09:25 +08:00
Kunhui-Li 5c72036a67 config_tools: using XPATH expression to handle input data
XPATH 2.0 already supports functions like for-expressions,
so we use XPATH expression instead of the python code to format
virtio input data.

Tracked-On: #6691
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-05-18 14:40:26 +08:00
Ziheng Li 859f6b803c [config_tool] Duplicate VM name
Added check and error prompt for duplicate names of VM
before save scenario.
Tracked-On: projectacrn#7486
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-05-18 13:22:34 +08:00
Wu Zhou 398184f3a6 config-tools: fix configurator build issue
Fix configurator build issue introduced by #7483

Tracked-On: #7492
2022-05-18 12:46:06 +08:00
Chenli Wei 0d05632c42 misc: add assert for vUART connection
The current UI have no live-check to check whether a VM connect to
itself.

So we add an assert to the schema and return error when user connect a
VM to itself.

Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-05-18 10:39:10 +08:00
Calvin Zhang c7a797ac51 misc: configurator: Use more precise acrn version identifier
Display acrn version string from `git describe --dirty` at UI footer to
help testing. Append the same version to deb package name as well.

Tracked-On: #7488
Signed-off-by: Calvin Zhang <calvinzhang.cool@gmail.com>
2022-05-17 13:25:50 +08:00
Wu Zhou 14ab083cc8 config-tools: add validation trigger to get instant result
The validation triggers 'change' happens only when data input completed.
Added 'blur', 'input', 'focus' to get instant result.

Tracked-On: #7481

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
2022-05-17 11:26:10 +08:00
Wu Zhou 39490c72b1 config-tools: add validation to IVSHMEM widget
Add validation to IVSHMEM widget, displaying error msg below the
input line. Currently only check for empty line.

Tracked-On: #7481

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
2022-05-17 11:26:10 +08:00
Yifan Liu 0adfe7a439 misc: configurator: Fix user-input working directory not working
User-input working directory will not work if there's no path split at
the end. This patch checks and adds if no path split at the end of
working directory path.

Tracked-On: #7484
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-05-17 11:00:59 +08:00
Kunhui-Li c1528cd479 config_tools: add virtio devices widget
This patch adds virtio devices widget according to the new design.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-05-16 14:28:46 +08:00
Kunhui-Li 3653b268ed config_tools: format vitio input in configurator
This patch formats virtio input entry as "Device name: xxx, Device physical path: xxx".

Tracked-On: #6691
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-05-16 14:28:46 +08:00
David B. Kinder 3a133d3138 Fix make configurator not picking up schema changes
Artificates left over from a previous make configurator build prevented
changes to a schema (.xsd) file from getting incorporated into a
subsequent make configurator build.

Tracked-on: #7461

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-05-16 09:43:26 +08:00
David B. Kinder 8ffb0dee4d schema changes for DX configurator option presentation
Edit the schema (.xsd) files to modify the order options are presented.
None of these changes invalidate existing scenario XML files, as they
only reorder elements within the existing parent element, or tweak the
acrn:views, acrn:title, or documentation content.

Move simple type elements before complex type options (under the same
parent element) to avoid the confusion where options look like they're
part of a section based on the title that's added before complex typed
options but not simple typed options.

* add acrn:title to pcpu (pCPU list)
* change documentation for binary option saying "checked" instead of 'y'
* move HYPERV_ENABLED before RDT (simple type before complex type)
* move vuart_connections before FEATURES
* move name before vm_type
* move console_vuart, os_type, vuart0, vbootloader, usb_xhci before
  lapic_passthrough
* add acrn:title to epc_section
* add acrn:title to memory
* move gpu to top of virtio_devices (simple type before completx type)

Tracked-On: #5692

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-05-16 09:12:20 +08:00
Junjie Mao 72445d01b4 config_tools: add placeholders in input widgets
The configurator today shows "Please Input" as the placeholder of input
widgets, which is far from informative.

This patch specifies element or type specific placeholders in the XML
schema by reusing the `acrn:widget-options` annotation mechanism. For
manually-designed widgets such as ivshmem or vUART the placeholders are
added in the corresponding vue directly.

Tracked-On: #6691
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-05-13 15:50:20 +08:00
Chenli Wei c972aeae22 misc: define the MAX_VUART_NUM_PER_VM by offline tool
The current code define MAX_VUART_NUM_PER_VM for all VM and it's a hard
code which can't match our vUART logic which need dynamic setting.

This patch move the define of MAX_VUART_NUM_PER_VM to offline tool and
calculate it automatically.

Tracked-On: #8782
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-05-13 13:50:07 +08:00
Chenli Wei 2045577f12 misc: add vUART channel for s5 feature
"S5" is one of the ACPI sleep states which means the function to shut
down the VMs.

On ACRN, the User VM must be shut down before powering off the Service
VM, so we need a vUART channel to communicate between the Service VM
and User VMs.

This patch adds a vUART channel for each User VM connect to Service VM

Tracked-On: #8782
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-05-13 13:50:07 +08:00
Fei Li d625ce0677 misc: acrnd: fix a minor build Werror
The comparison ((argv + 1)) will always evaluate as 'true' for the pointer
operand in 'argv + 8' must not be NULL.

Tracked-On: #7453
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-05-13 12:57:32 +08:00
Yifan Liu 1651863584 misc: configurator: Fix minor bug of vUART label error
The connection label should be consistent with vUART name

Tracked-On: #7455
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-05-13 11:38:45 +08:00
Yuanyuan Zhao 27222e1583 config_tools: change JSON Schema source file
Use the JSON Schema convered while building.
The file will be updated in time.

Tracked-On: #7459
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
2022-05-13 11:13:42 +08:00
Yuanyuan Zhao 38c73cc6e2 config_tools: remove JSON Schema in repo
The JSON Schema converted from schema while building.
Remove the JSON Schema in repo.

Tracke-On: #7459
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
2022-05-13 11:13:42 +08:00
Yuanyuan Zhao db53f21404 config_tools: create json schema path
Create a temporary directroy to write JSON Schema while build packages.

Tracked-On: #7459
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
2022-05-13 11:13:42 +08:00
lirui34 722561fbf5 config tool: fix d3hot_reset unbind tap create issue
The config tool supports auto add d3hot_reset option to
the windows vm script when user configure the usb passthru event,
but it's not handled in the template script or not the pci event
will not unbind successfully while launching the windows guest.
One more fix is for the existing tap network interface check function.

Tracked-On: #7363
Signed-off-by: lirui34 <ruix.li@intel.com>
2022-05-13 09:36:58 +08:00
hangliu1 3afb222d90 [config tool][doc]: remove old configurator
remove configurator in misc/config_tools/config_app, since
there is new configurator in misc/config_tools/configurator.
remove related document.

Tracked-On: #7466

Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-05-12 15:42:26 +08:00
Weiyi Feng 856ef44bd7 config_tools: fix can't save cpu affinity config issue
fix can't save cpu affinity config issue

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-05-12 09:51:34 +08:00
Yuanyuan Zhao 9f08eeb999 config-tools: modify scenario.json in build directory
Copy scenrio.json to build directory, and modify the temporary file
to avoid pollution of hypervisor repo.

Tracked-On: #7459
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
2022-05-12 09:29:27 +08:00
Yifan Liu 130266442e misc: configurator: Add vUART widget
Tracked-On: #7455
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-05-11 22:05:43 +08:00
Chenli Wei d5c0a40665 misc: modify the generate logic of vcat config
The current code generate vcat info by count the CLOS MASK and the
scenario xml should set multiple times.

It is not an ideal solution, so we add an "virtual_cat_number" element
to set the virtual CLOS number and get the MAX pcbm directly.

Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-05-11 17:00:51 +08:00
Chenli Wei a1b266f807 misc: refine CLOS module for expansibility
This patch refine CLOS module by the following aspects:

1 Unified CACHE_ID type to Hex Format
2 Rewrite policy merge with RDT Class
3 Modify the logic of generate CPU mask

Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-05-11 17:00:51 +08:00
Conghui f172502044 config-tools: bugfix for file related issue in UI
1. when using existing configuration, UI show the existing information.
2. remove launch script when removing post-launched VM.
3. new working folder created with no existing files.
4. automatically minimized.

Tracked-On: #7450
Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-11 11:38:26 +08:00
Weiyi Feng c31cad225c config_tools: update project nodejs dependencies when windows build script run
update project nodejs dependencies when windows build script run

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-05-11 10:16:38 +08:00
Weiyi Feng 631de1d6fd config_tools: add default value for new vm cpu_affinity setting
add default value for new vm cpu_affinity setting

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-05-11 10:16:38 +08:00
Weiyi Feng b8d9e288bf config_tools: add custom cpu_affinity component
add custom cpu_affinity component

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-05-11 10:16:38 +08:00
Weiyi Feng ebef897088 config_tools: let windows build scripts auto exit when an error occurs
let windows build scripts auto exit when an error occurs

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-05-11 10:16:38 +08:00
Wu Zhou c12f3adee0 config-tools: ivshmem.vm_name changes with name edit
This patch is to fix the issue that when user edits VM name, the VM_NAME
field in IVSHMEM data doesn't sync.

To fix this, configForm emits a 'vmNameChange' when VM name is edited.
Then old name is replaced with new name. And when deleting VM, the old
name is replaced with null.

Tracked-On: #7445

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
2022-05-11 09:47:29 +08:00
Wu Zhou c4f9146746 config-tools: limit the tooltip box max-width
The tooltip box's default width is inconsistent with the screen width.
It could run off the configurator window when the tooltip text is long.
Limit it to 50%.

Tracked-On: #7442

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
2022-05-10 17:55:32 +08:00
Weiyi Feng d6a69970c6 config_tools: update node-fetch version lock to 2.6.7
update node-fetch version lock to 2.6.7

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-05-10 13:21:50 +08:00
Helmut Buchsbaum f5c63dd5ff doc: Adapt documentation to change of acrnlog log path
Tracked-On: #6688
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2022-05-10 09:20:14 +08:00
Helmut Buchsbaum 549d9004e9 acrn_log: Fix log path to comply with Linux FSSTD
Change logging path to /var/log/acrnlog to be compliant with the Linux
FSSTD, see https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html.

Tracked-On: #6688
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2022-05-10 09:20:14 +08:00
Helmut Buchsbaum a22d0497d7 life_mngr: Makefile: Fix permission of life_mngr.conf
Tracked-On: #6688
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2022-05-10 09:20:14 +08:00
Helmut Buchsbaum bea9c8d165 life_mngr: Makefile: Fix install path creation of CONF_DIR
Tracked-On: #6688
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2022-05-10 09:20:14 +08:00
Helmut Buchsbaum 5dbf09daef life_mngr: Makefile: Use sysconfdir
Tracked-On: #6688
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2022-05-10 09:20:14 +08:00
Helmut Buchsbaum d3d0cba778 board-inspector: Fix sys.path for all internal modules
Tracked-On: #6688
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2022-05-10 09:20:14 +08:00
Junjie Mao ae2a78eb0e config_tools: drop version constraints on elementpath and xmlschema
After commit f8f1689a8 ("config_tools: do not apply distinct-values on a
union of node-set"), it has been confirmed that the reported build issue no
longer exists when using the latest elementpath (2.5.0) and
xmlschema (1.10.0). So this patch removes the version constraints in
requirements.txt.

Tracked-On: #7372
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-05-09 17:46:59 +08:00
Yifan Liu a12edaaab2 misc: configurator: Disable steps until prior step completed
Step 2 should be available after board is imported/created, and step
3 should follow step 2.

Tracked-On: #7435
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-05-09 11:25:11 +08:00
Weiyi Feng 5172bbf760 config_tools: fix can't find deb in build stage issue
fix can't find deb in build stage issue

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-05-09 09:56:01 +08:00
Kunhui-Li 8d78136ffb config_tools: add logic for virtio_framework in launch script
If the user select "Kernel based (Virtual Host)" in virtio_framework
entry, the "vhost" string will be added to the dm parameter.
The generated launch script will look like below:
"virtio-net tap=WaaG,vhost,mac_seed=${mac:0:17}-POST_STD_VM1"

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-05-09 09:26:16 +08:00
Kunhui-Li cceb169347 config_tools: update the text format of backend_device_file
Currently, the “backend_device_file” entry is a text combination of the
elements `//device-classes/inputs/input/name` and `//device-classes/inputs/input/phys`.
The format <name>:<phys> is shown in UI and the generated launch scripts.

However, we find ":" in some device physical path in adl-s-crb platform,
this will result in script can't correctly distinguish <name> and <phys> by a colon.
And we are not sure if colon will be found in the name variable in the future.

So this patch updates the text format of backend_device_file to
"Device name: xxx, Device physical path: xxx"
And the new text format will be shown in the UI and the generated launch script.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-05-09 09:26:16 +08:00
Weiyi-Feng 06b942f5eb config_tools: Add vue-json-schema-form and advanced custom component for IVSHMEM field
1. add Vue devtools support
2. update project dependencies
3. refactor configurator source code tree for private library hook
4. fix build issue
5. dynamic load scenario JSON schema(fix cache issue)
6. add vjsf 1.12.2 (latest) for private package dependencies
7. remove vjsf unnecessary files
8. use private vjsf as configurator dependencies
9. Add custom IVSHMEM_REGION widget
10. add a script to populate default values
11. get default values before export scenario xml
12. specify widgets in XML schema
13. add missing vjsf license file
14. populate default values to empty nodes
15. when user clicks save button, update formData with each field default value
16. fix when the user clicks the save button will collapse configFom
17. add success message for saving scenario XML

vue-json-schema-form 1.12.2 (latest)link: b30ea7c2d6/packages/lib

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-05-08 15:52:28 +08:00
Calvin Zhang e36b615fe1 misc: configurator: Config usb mediator devices in dropdown list
Support detecting connected usb devices in board_inspector and list them
in the usb mediator configuration menu.

Tracked-On: #7424
Signed-off-by: Calvin Zhang <calvinzhang.cool@gmail.com>
2022-05-07 17:37:03 +08:00
Conghui 2d66ba4d40 config-tools: add warning message
Add warning message when users select a new board for an existing
configuration.

Tracked-On: #7413
Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-07 15:31:35 +08:00
Conghui 292978aff1 config-tools: bugfix for deleting Service VM
When deleting Service VM, Post-launched VMs also need to be deleted.

Tracked-On: #7413
Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-07 15:31:35 +08:00
Conghui ab51dcdab4 config-tools: show confirm info for deleting VMs
Show different confirm windows for Service_VM and other VMs.

Tracked-On: #7413
Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-07 15:31:35 +08:00
Conghui 02c8043ff9 config-tools: change tab color
change tab color

Tracked-On: #7413
Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-07 15:31:35 +08:00
Conghui 5a3b38f778 config-tools: add confirm message
Add confirm message when saveing scenario and launch scripts.

Tracked-On: #7413

Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-07 15:31:35 +08:00
Yifan Liu 33c506427e misc: configurator: Bugfix: misplaced enum property
During conversion from xml to scenario.json, elements with "maxOccurs"
property is processed as json array, and (most) properties of that elements
goes to the json array. However the "enum" property should belong to the
array item, not the array itself.

Tracked-On: #7421
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-05-07 13:12:40 +08:00
Yifan Liu bf656a1141 misc: configurator: Bugfix: Incorrect DynamicEnum type
Currently dynamicEnum hook returns all available options (enums) as a
list of strings. However in some cases strings need to be converted to
target types.

One example is CPU affinity. The dynamicEnum should produce a list of
all available pCPUIDs (a list of integers), instead of a list of
strings.

This patch adds a converter in get_enum to do the type conversion.

Tracked-On: #7420
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-05-07 13:12:40 +08:00
Yifan Liu 35dc60192f misc: configurator: Re-assign VMID based on load order
Previously if user creates a shared scenario and adds a pre-launched VM,
the pre-launched VM will be assigned a VMID that's greater than service
VM, which will be blocked by scenario validation.

This patch re-assigns the VMID before saving as scenario XMLs based on
their load order. The UI-only VM name will have no impact on VMID that's
actually written to scenario XML.

Tracked-On: #7419
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-05-07 13:12:40 +08:00
Yifan Liu ee3a527464 misc: configurator: Open folder callback bugfix
Open folder callback should append a path split after selecting working
folder, same way as it did with default one.

Tracked-On: #7418
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-05-07 13:12:40 +08:00
Ziheng Li 8bdbedd6cf config-tools:Board Inspector Behaviors Improvement
1.Temporarily store the log in the form of tempfile,
and the temporary file will be deleted after the summary log information is displayed.
2.Now, the logs will be printed when they generated as well.

Tracked-On: #6689
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-05-07 11:25:44 +08:00
Kunhui-Li 019ae24c94 config_tools: update the hugepage algorithm
update the hugepages algorithm as the following steps.
1. calculate the total hugepages of service vm using the formula.
   "total memory - the memory consumed by pre-launched VMs - 3G
   -1G(memory need by service vm supporting virtio gpu)
   -300M*num(number of virtio gpu instance)"
2. calculate hugepage 2M/1G based post-launched vm memory setting.
3. correct the 2M/1G hugepages with the total hugepages in step 1.
   "correct_mb, correct_gb= math.modf(total hugepages - the memory
    consumed by Post_launched vm)
    hugepages_1gb = hugepages_1gb + correct_gb
    hugepages_2mb = hugepages_2mb + math.ceil(correct_mb*1024/2)"

Tracked-On: #7301
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-05-07 10:51:10 +08:00
jackwhich 9aa373aa3a config-tools: Update board.xml file based on board inspector modification
Update board.xml file according to board inspector modification
for removing nowait parameter in cmdline by commit: 4b81a2d89

Tracked-On: #7371
Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2022-05-07 09:45:51 +08:00
Calvin Zhang 257b04f9ce misc: deb: Fix the ServiceVM kernel line in ACRN grub entry
After replacing partitioned ACRN deb with shared deb, the stale
multiboot module for ACPI1.bin was left in ACRN grub entry because it
was taken as kernel image.

Tracked-On: #7400
Signed-off-by: Calvin Zhang <calvinzhang.cool@gmail.com>
2022-05-07 09:11:23 +08:00
Zhou, Wu 1f20d5e7a0 config-tools: board_inspector deb appends kernel CMDLINE
Currently installing board_inspector deb would overwrite the grub
default kernel CMDLINE GRUB_CMDLINE_LINUX_DEFAULT. This could lose
some useful kernel args configured by user.

This patch is to change the 'overwrite' operation to 'append'.

Simply appending new CMDLINE to GRUB_CMDLINE_LINUX_DEFAULT could
not work. We need to remove duplicated args, and keep the args in
its origin order.

Tracked-On: #7402

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
2022-05-06 15:08:33 +08:00
Conghui 9669cc1c58 config-tools: add alert for non-exist file
Add alert when importing an non-exist scenario file

Tracked-On: #7413
Signed-off-by: Conghui <conghui.chen@intel.com>
2022-05-06 13:39:27 +08:00
hangliu1 1540d3479f config tool:add vmname in launch script
add vmname in generated launched script by a comment

Tracked-On: #7410
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-05-06 09:09:25 +08:00
hangliu1 0c5f7b5985 config tool:add restriction for some parameters
add value restriction for memory size and max pt irq entry

Tracked-On: #7407
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-05-05 16:50:22 +08:00
hangliu1 fd76e342ef config tool: add schema check for cpu_affinity
cpu_affinity is required field for non-service vm,
add the check in case user misconfig it.

Tracked-On: #7405
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-05-05 15:51:59 +08:00
David B. Kinder 69f8f6dcdc doc: fix malformed virtio gpu device description
xs:documentation content has an indented line that causes the reST
formatting of the generated content to be off (leading spaces on lines
are significant to reST formatting).

Tracked-On: #5692

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-05-03 15:43:18 +08:00
Zhou, Wu 4b81a2d89a config-tools: remove 'nomwait' from board_inspector's requirement
This patch is about the bug that VMs can't idle.

ACRN enables VM's C-state by extracting host's C-state table.
The C-state table has two types of interfaces: system-IO and mwait. VMs
just need one of them. ACRN can support both.

Currently we are telling users to use the system-IO type. That is, by
adding 'nomwait intel_idle.max_cstate=0' to host Linux's CMD line when
using board_inspector. (The reaseon we were using system-IO is that
mwait was buggy on Apollo Lake.)

But recent tests show that system-IO is somehow buggy. Linux c-state
driver(no matter intel_cstate or acpi_cstate) fails to enter idle state
with system-IO. This can always be reproduced on native environments.
MPERF counters show CPU cores are not in real idle state as expected.

To enable C-state in VMs, we have to switch to mwait.
As ACRN has already supported both system-IO and mwait, we don't have
to modify any code. We just need to tell user to use mwait instead of
system-IO.
That is, don't add 'nomwait intel_idle.max_cstate=0' to host Linux's
CMD line when using board_inspector. Just add 'intel_idle.max_cstate=0'

Due to the Apollo Lake's mwait bug, 'nomwait' is still needed for
Apollo Lake as an exception.

Tracked-On: #7371

Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
2022-04-30 17:06:23 +08:00
lirui34 b7f50ef980 config_tools: Add virtio_device example for all the platforms
We should add virtio_devices network / block / console nodes
to the generic_board scenario xmls.
But now we found some of the hybrid / hybrid_rt even the shared xml
are missing virtio devices block nodes, or not user will generate
invalid launch scripts.

Tracked-On: #7392
Signed-off-by: lirui34 <ruix.li@intel.com>
2022-04-29 17:50:31 +08:00
Junjie Mao f8f1689a88 config_tools: do not apply distinct-values on a union of node-set
The latest version of the elementpath library (i.e. 2.5.0) fails to
evaluate an XPATH which feeds a union of node sets to the `distinct-values`
function. An exception will be raised in such case, which eventually causes
the hypervisor build to fail.

This patch removes the usage of `distinct-values` function in the
XPATH. This may cause some additional delays to the evaluation of the
assertion, but at least will not impact the build even the latest versions
of the Python libraries are used.

Tracked-On: #7372
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-28 15:36:11 +08:00
Chenli Wei 3b4841b91d misc: fix the issue of create hv node
There was an issue of create hv node by clos module, the direct cause
is the create logic and the indirect cause is these modules of
static_allocators was not sorted before run which cause some platform
have issue and CI could not found.

So this patch fix the create issue and sorted the modules list to make
sure all these platform could work well and get the same allocation.xml

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-04-28 13:42:54 +08:00
Ziheng Li 92c9252f4c [acrn-configuration tool] make scenario shared file error cp error
Fixed the error that the "'chmod +x ./build/acrn_release_deb/DEBIAN/preinst'"
command and "sed -i \'s/\r//\' ./build/acrn_release_deb/DEBIAN/preinst" command
are still executed when there is no "./build/acrn_release_deb/DEBIAN/preinst"
file after build.

Tracked-On: projectacrn#7383
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-04-28 10:10:55 +08:00
Weiyi-Feng c544ac98bc config_tools: fix document typo
fix document typo

Tracked-On: #6691
Signed-off-by: Weiyi Feng weiyix.feng@intel.com

Co-authored-by: David Kinder <david.b.kinder@intel.com>
2022-04-27 12:54:47 +08:00
Weiyi Feng f9cb5edc7e config_tools: update configurator document and build script
1. update configurator document.
2. fix build script doesn't generate allchecks.xsd issue.
3. add open_devtools command, now we can get detail debug info in prod.
4. remove vconsole component, which will cause some strange js runtime issue in Linux.

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-27 12:54:47 +08:00
Ziheng Li c9e982557b [acrn-deb] install_compile_package function is not consistent with gsg
Remove misc/packaging/install_uSoS.py,
because there's no use for this script.

Tracked-On: projectacrn#7370
Signed-off-by: Ziheng Li  <ziheng.li@intel.com>
2022-04-27 10:33:34 +08:00
Ziheng Li 21d5a2f8ee [acrn-configuration tool] make scenario shared file error cp error
Fixed the problem that the "'cp %s %s' % (source, target), cur_dir" command
is still executed when there is no ACPI_VM.bin file after build.

Tracked-On: projectacrn#7366
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-04-27 01:10:29 +08:00
Geoffroy Van Cutsem e748842da0 config_tools: add 'configurator' to error message
A new target is available to the gen_acrn_deb.py script, namely
'configurator'. The error message in case the user passes an incorrect target
provides the valid option but did not mention this new 'configurator' target.

Tracked-On: #7367
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2022-04-26 17:36:21 +08:00
Qiang Zhang b894b89f41 board_inspector: transform non-viewable characters in brand string
Some cpu reports a brand string with non-viewable characters. While XML
string value can not contain NULL bytes or control characters.

So replace non-viewable characters in brand string with spaces.

Tracked-On: #7365
Signed-off-by: Qiang Zhang <qiang4.zhang@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-26 16:35:43 +08:00
Yifan Liu 26cab008e8 misc: config_tools: Add Check for RTVM pCPU assignment
Previously we have checks to make sure pre-launched RTVM does not share
pCPU with others. This patch extends this check to all RTVMs.

Tracked-On: #7361
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-04-26 13:42:13 +08:00
hangliu1 b49facb61d config tool: add d3hot_reset in launch script
add d3hot_reset in launch script when USB xhci is selected
for passthrough device

Tracked-On: #7363
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-26 12:58:27 +08:00
Weiyi Feng 38f79d986b config_tools: fix build issue
fix build issue

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-26 09:22:57 +08:00
David B. Kinder aa170a3d11 doc: update acrn:title for uniqueness and context clarity
Make small changes to DX-friendly acrn:title names to make them unique
across the options and to provide meaningful names when shown out of
context in the config option documentation.

Tracked-On: #5692

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-04-25 09:10:47 -07:00
Weiyi Feng 696ba31be8 config_tools: refactor configurator for web page cache issue
refactor configurator for web page cache issue

Tracked-On: #7356
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-25 18:13:12 +08:00
Conghui 8e61d417db configurator: bugfix for removing Service VM
When removing Service VM from UI, the post-launched VMs should also be
removed.
Besides, add a warning window when removing Service VM.

Tracked-On: #7349
Signed-off-by: Conghui <conghui.chen@intel.com>
Reviewed-by:  Weiyi Feng <weiyix.feng@intel.com>
2022-04-25 13:16:46 +08:00
Kunhui-Li 15e83758d6 config_tools: update upgrader.py script for virtio
1. add virtio gpu logic in upgrader.py script.
2. fix the upgraded virtio elements issue.
3. add the logic to remove the element with empty value in xml file
to use the default value.

Tracked-On: #7301
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-25 10:19:24 +08:00
Kunhui-Li 68f88a4bc9 config_tools: update virtio console to support multiple console sockets
this patch updates virtio console in schema and launch script generation
logic to support multiple console sockets. And check the schema and launch
script, now we support multiple console/input/network/block, multiple gpu is
not supported in schema.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-25 10:19:24 +08:00
hangliu1 e63a17a7c8 config tool:Fix tap name filter error
when tap name is number, it will lead to failure of
adding tap dev, fix it.

Tracked-On: #7351

Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-24 18:17:57 +08:00
Chenli Wei c962eaa3c9 misc: refine XMLs for new RDT design
After we redesign the RDT, we should update our XMLs for these new
schema format.

This patch remove all 'CLOS_MASK' of RDT region which will be create
by user setting.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-04-24 16:52:24 +08:00
Chenli Wei 4807385fe2 misc: refine cache config
The current RDT setting requires users to calculate the CLOS mask and
the details, it is not a user-friendly setting.

So we redesigned RDT, users can easily specify the cache of each vcpu
for VMs.

This patch add an RDT region element for schema, calculate and generate
all the mask and rdt parameters by config tool to generates rdt_info
struct for board.c.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-04-24 16:52:24 +08:00
Conghui c25de24a92 config-tools: remove board and scenario attributes
Remove board and scenario attributes from scenario XMLs

Tracked-On: #7345
Signed-off-by: Conghui <conghui.chen@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-24 13:53:32 +08:00
Conghui c0fd2e9ce0 config-tools: tiny fix in upgrader
Do not copy the 'board' and 'scenario' in <acrn-config> to the new xml.

Tracked-On: #7345
Signed-off-by: Conghui <conghui.chen@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-24 13:53:32 +08:00
Junjie Mao 27d1dde01e config_tools: list dependencies on Python libraries in requirements.txt
This patch adds a requirements.txt file that lists the libraries and their
versions the ACRN configuration toolset needs. The versions of elementpath
and xmlschema are fixed to the latest one supporting Python 3.6 due to the
requirement of the customized overlay.

Such requirements apply to both the board inspector and the XML
manipulation part of the configurator.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-24 12:21:22 +08:00
hangliu1 991735404e config tool:update vbootloader xsd file
update vbootloader and vuart0 in schema

Tracked-On: #7294
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-22 18:39:43 +08:00
hangliu1 50082af5b2 config tool:Fix parameters in Configurator UI
Change parameters attribute to impact UI effect.

Tracked-On: #7335
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-22 16:18:28 +08:00
zihengL1 01bd41025a misc: alloc HPAn by VM whole size setting
1.Unified the function naming style in this file
2.Added the procedure for possible input 0 value of hpa_region in check_hpa()
3.Modified the delimiting spaces between two lines

Tracked-On: #6690
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Ziheng L1 <ziheng.li@intel.com>
2022-04-22 14:46:05 +08:00
Chenli Wei cf05e37c85 config_tools: refine XMLs setting for HPAn
1. After the data structure of vm/memory in scenario and schema files.
The scenario will look like this.

<hpa_region>
  <start_hpa>xxx</start_hpa>
  <size_hpa>xxx</size_hpa>
</hpa_region>

We should change all XMLs for the new design.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-04-22 14:46:05 +08:00
Chenli Wei 52268f5cc2 config_tools: refine memory setting for HPAn
1. Update the data structure of vm/memory in scenario and schema files.
The scenario will look like this.

<hpa_region>
  <start_hpa>xxx</start_hpa>
  <size_hpa>xxx</size_hpa>
</hpa_region>

2. Update xsl files to generate the related struct.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-22 14:46:05 +08:00
jackwhich 6c0e8ff793 config-tools: update xmls due to cpu_id parser changed
The cpu_id is allocated contiguously by the kernel, start at 0.
However, today's cache information extractors parse them as hexadecimal number,
more than 10 will result in incomplete cache information.
The issue now is fixed, so update the board xml.

Tracked-On: #6689
Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2022-04-22 13:25:31 +08:00
Kunhui-Li 6647b2e266 config_tools: add virtio gpu
Virtio gpu device UI will be implemented after 3.0.
As a workaround, this patch simply adds the virtio gpu entry in schema
and launch script generation logic.

Tracked-On: #7301
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-21 21:40:38 +08:00
Junjie Mao 2d968105f1 board_inspector: parse cpu IDs in decimal rather than hexadecimal
Unlike other CPU IDs, the cpu_id field under //processors//thread in the
board XML is in decimal as it is assigned by the kernel continuously,
starting from 0. However, the cache info extractor today parses them as
hexadecimal numbers, leading to incomplete cache info when more than 10
processors are present on the board. This patch fixes this issue.

Tracked-On: #6689
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-21 15:37:47 +08:00
Junjie Mao 8bf5b18400 board_inspector: check the number of PCI domains
Today ACRN works only on platforms with a single PCI domain (which is true
for most client and IoT platforms). This limitation is also used to
simplify the implementation of the board inspector. As a result, on
platforms with multiple PCI domains, the board inspector may crash when
parsing information about PCI devices.

This patch adds a check on the number of PCI domains before the board
inspector attempts to extract any information, and terminates the tool
early if multiple PCI domains are detected.

Tracked-On: #6689
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-21 10:08:53 +08:00
Junjie Mao 53efa3851e board_inspector: add a missing module import
This patch adds the import of the `sys` module in platformbase.py which
uses `sys.exit` to terminate the board inspector upon fatal errors.

Tracked-On: #6689
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-21 10:08:53 +08:00
Junjie Mao 739ecc629f board_inspector: filter out non-present PCI buses
The lookup extractor of the board inspector filters out non-PCI or
non-present devices by checking the presence of vendor ID and class code.
The same logic applies to PCI buses as well, but is neglected today.

This patch adds the missing check.

Tracked-On: #6689
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-21 10:08:53 +08:00
Junjie Mao 4fe6cae877 config_tools: track whether each vCPU is used for real-time or not
According to DX recommendations, this patch adds a Boolean item to each
vCPU which allows users to specify the vCPUs intended for
real-time-critical tasks. This information will be used to organize other
widgets (CAT-related ones for now) in the configurator to tell apart
real-time ones from the others for better clarity.

All vCPUs are by default not real-time-critical, except those in the RT VMs
which are.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-21 10:08:53 +08:00
Junjie Mao 7ca33206fb board_inspector: add a cmdline option to inject LLC CAT capability
This patch adds the command line option --add-llc-cat to the board
inspector to allow users adding CAT capabilities of the last level cache to
the generated board XML even when the hardware does not report so for any
reason.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-21 10:08:53 +08:00
Junjie Mao db17992293 config_tools: add assertions on the uniqueness of vBDF
This patch adds the assertion (in XSD) that validates if all explicitly
specified vBDF (including those for virtual UART controllers and IVSHMEM
interfaces) are unique.

Tracked-On: #7330
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-21 10:08:53 +08:00
Junjie Mao 5bd3e96426 config_tools: add default values to vBDF of vUART and IVSHMEM
Different from other nodes which have static default values, the virtual
BDF nodes of virtual UART endpoints or IVSHMEM interfaces have a set of
default values and should be used with uniqueness guaranteed. The existing
default value mechanism in XSD does not include support for this.

This patch adds two more ACRN-specific annotations, namely `acrn:defaults`
and `acrn:unique-among`, that have the following semantics.

  - `acrn:defaults` is a Python expression that evaluates to an iterable.

  - `acrn:unique-among` is an xpath that specifies the nodes. Each node
    within the select ones shall have a value unique among them. The xpath
    is evaluated with the variable `parent` defined as the parent node
    under which the vBDF node is to be appended.

Tracked-On: #7330
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-21 10:08:53 +08:00
David B. Kinder 410d317fe4 doc: update schema type documentation
Add documentation for enumerated types and value restrictions so it
shows up in the option documention.  Also add additional acrn:title
annotations.

Tracked-On: #5692

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-04-20 13:44:23 -07:00
David B. Kinder f1dbb35da0 doc: fix doc formatting in xsd files
Documentation continuation lines must not be indented unless required by
rst syntax.

Added some type explations for enumerations, but would be better to
generate the enumeration values by scanning the tree. Figure that out in
another PR.  (This would prevent the documented list of values from
being out of sync with the actual list of values in the enumeration.)

Tracked-On: #5692

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-04-20 09:42:21 -07:00
zihengL1 5dcae86e2f packaging: error while loading shared libraries: libSDL2-2.0.so.0
Added the "libsdl2-2.0-0" package in file
"misc/packaging/gen_acrn_deb.py

Tracked-On: projectacrn#7291
Signed-off-by: zihengL1 <ziheng.li@intel.com>
2022-04-20 13:10:36 +08:00
jackwhich 845970b376 config-tools: update nuc11/whl/generic_board board files
Because Board Inspector modifies the SR-IOV function,
VF information is correctly captured when Board Inspector
collects Board information. So update the board xmls

Tracked-On: #7031
Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2022-04-20 10:55:00 +08:00
hangliu1 7bcc5b7383 config tool:add support for bootargs missing
Bugfix:bootargs is optional parameter, which may be not
present in xml as a node, asl_gen.py needs to process
that case.

Tracked-On: #7307
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-19 13:20:08 +08:00
hangliu1 5d938e751b config tool: update schema
Update "Borrowed Virtual Time" scheduler description
Update "RELOC" and "MULTIBOOT2" parameter name
Update xml

Tracked-On: #7297
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-18 19:29:51 +08:00
Zhou, Wu 423312881d config-tools: extract the SSRAM area size
The GPA SSRAM area size in pre-launched VMs was hard-coded to 8MB.

Since this area is mapped from host SSRAM area, it will cause compile
problem when host's SSRAM area is larger than 8MB.

To solve this issue, we have to calculate SSRAM area's size in
gpa.py, and generate a macro PRE_RTVM_SW_SRAM_MAX_SIZE for HV
to use.

PRE_RTVM_SW_SRAM_START_GPA/END_GPA can be calculated by end/size
in HV, so they are removed.

When SSRAM is not configured in the system, PRE_RTVM_SW_SRAM_MAX_SIZE
is set to 0.

Crl_bin is not needed in guest. So it's size is removed in bin_gen.py.

Tracked-On: #7212

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
2022-04-18 16:47:23 +08:00
zihengL1 5011b9396d packaging: error while loading shared libraries: libSDL2-2.0.so.0
Added the "libsdl2-dev" dependency in file
"misc/packaging/gen_acrn_deb.py"

Tracked-On: projectacrn#7291
Signed-off-by: zihengL1 <ziheng.li@intel.com>
2022-04-18 16:17:30 +08:00
Junjie Mao 46fab9e8a0 board_inspector: extract PF and VF info
This patch adds logic to the extractors to fetch the following information.

  1. All the details of an SR-IOV capability, which are reported in the
     SR-IOV extended capability structure.

  2. Correctly report the vendor ID, device ID and BAR addresses of VFs.

  3. Refer each VF back to the corresponding PF. Use XPATH to search for
     all the VFs enabled by a PF.

Tracked-On: #7301
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-18 14:58:58 +08:00
Junjie Mao 93ccc0f473 board_inspector: parse SR-IOV capability structure properly
This patch adds the logic needed to fully parse an SR-IOV extended
capability structure. Such information will later be used to extract all
information about physical and virtual functions.

Tracked-On: #7301
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-18 14:58:58 +08:00
Junjie Mao 0a77891f1c board_inspector: maintain a mapping from cap names to cap struct
In order to ease the access of certain capability structure of a PCI config
space, this patch changes the class PCIConfigSpace to maintain a
_caps_as_dict dictionary that maps capability names (as specified in the
caps.py and extcaps.py) to the actual capability structures.

Tracked-On: #7301
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-18 14:58:58 +08:00
hangliu1 2d0089f06b config tool: update cpu affinity check algorithm
pcpu in pre-launched RTVM cannot share with other VM

Tracked-On: #7287
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-18 13:41:37 +08:00
Kunhui-Li e56c0372f0 config_tools: update the upgrader.py script for virtio devices
We have redesigned Virtio devices, so this patch updates
the upgrader.py script for them.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-15 14:20:11 +08:00
Kunhui-Li 2ce914428c config_tools: refine virtio in launch script
1. for virtio console, reference to the document
https://projectacrn.github.io/latest/developer-guides/hld/virtio-console.html,
the generated launch script will look like this:
`virtio-console,[@]stdio|tty|pty|file:portname[=portpath]\
[,[@]stdio|tty|pty|file:portname[=portpath][:socket_type]]`
  *receding with @ marks the port as a console port,
   otherwise it is a normal virtio-serial port
  *The portpath can be omitted when backend is stdio or pty.
2. for virtio input, the generated launch script as below.
`<name>:<phys>,id=<anyString>`
The launch script will automatically find the specific /dev/input/eventX
according to the event name and phys got from board.xml.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-15 14:20:11 +08:00
Kunhui-Li 76dc2b3a5e config_tools: refine Virtio devices in the schema
We have redesigned Virtio and UI for user, so this patch updates the schema
for the new design.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-15 14:20:11 +08:00
hangliu1 cb5d245d9e config tool: generate HV land ivshmem parameter
add support for HV land ivshmem prefix in launch script

Tracked-On: #7279
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-14 10:02:46 +08:00
hangliu1 108424180d deb-pkg: add OVMF_debug.fd in acrn deb
add OVMF_debug.fd in acrn deb

Tracked-On: #7272
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-13 14:34:25 +08:00
hangliu1 5c3e7a29ee config tool/doc:update SCHED_IORR in schema
hide SCHED_IORR and KERNEL_RAWIMAGE in schema
and update SCHED_IORR in doc

Tracked-On: #7256
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-13 13:35:52 +08:00
hangliu1 1157d1d41c config tool: update virtio block setting
add support for more than one virtio block setting
for specific vm

Tracked-On: #7277
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-13 11:13:02 +08:00
hangliu1 0e4a94f9dd config tool: hide PTM in schema
change acrn:view attribute to ""

Tracked-On: #7261
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-12 13:55:20 +08:00
hangliu1 f656ef0abc config tool: Fix service vm cpu affinity issue
default value of minOccurs is "1", which will trigger problem
when user leave pcpu_id blank while preserve cpu_affinity in
service VM.

Tracked-On: #7267
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-12 11:34:56 +08:00
hangliu1 7bf96c5a97 config tool: Fix combined cpu_affinity warning
Service vm could have the combination of big and
little core cpu_affinity setting, fix the assert.

Tracked-On: #7270
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-12 10:05:27 +08:00
Fei Li 59e27ce49e mise: life_mngr: fix some minor bugs
1. enlarge receive Service VM message time to 10s. Now in some extreme
environments, Service VM will takes more than 1s to ACK the User VM's
requirements.
2. fix a bug to calculate string pointer size.

Tracked-On: #7215
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-04-06 18:15:06 +08:00
hangliu1 310120092e config tool: service vm parameter display
Fix it in schema by adding attribute acrn:applicable-vms

Tracked-On:#7262

Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-06 15:40:44 +08:00
Geoffroy Van Cutsem 8b16be9185 Remove "All rights reserved" string headers
Many of the license and Intel copyright headers include the "All rights
reserved" string. It is not relevant in the context of the BSD-3-Clause
license that the code is released under. This patch removes those strings
throughout the code (hypervisor, devicemodel and misc).

Tracked-On: #7254
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2022-04-06 13:21:02 +08:00
Weiyi Feng ac9824cd54 configurator: fix can't load scenario without pci_devs issue
fix can't load scenario without pci_devs issue

Tracked-On: #7246
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-06 11:17:18 +08:00
Kunhui-Li 080335bbe7 config_tools: fix the issue that fail to read XSD file
fix the path issue that fail to read XSD file.

Tracked-On: #6689
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-06 10:31:55 +08:00
Weiyi Feng 3d8fa80949 configurator: update configurator version to 0.3.0
update configurator version to 0.3.0

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-01 12:19:40 +08:00
Weiyi Feng ce71921011 configurator: fix some schema field does not provide display name issue
fix some schema field does not provide display name issue

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-01 12:19:40 +08:00
Weiyi Feng 3f1057b747 configurator: fix single vm scenario load issue
fix single vm scenario load issue

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-01 12:19:40 +08:00
Weiyi Feng 578a482626 configurator: fix displayed scenario path
fix displayed scenario path

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-01 12:19:40 +08:00
Reyes, Amy 9a4cb33f39 config_tools: Update Configurator UI XSD
- Update labels and descriptions

Tracked-On: #5692
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-04-01 10:04:57 +08:00
Weiyi Feng a79d2ded7e configurator: update configurator dependencies to latest version
update configurator dependencies to latest version

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-01 09:14:43 +08:00
Kunhui-Li 74dc103d9e config_tools: remove board and scenario attributes
remove board and scenario attributes dependency for new configuration.

To do:
will remove board and scenario attributes in all scenario XML files
and update the upgrader.py after the new configuration works.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-31 19:32:52 +08:00
Weiyi-Feng 260718d544 configurator: autoload board and scenario xml when exist
autoload board and scenario xml when exist

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-03-31 19:26:33 +08:00
Weiyi Feng 3c4f14ede7 configurator: add new configurator
add new configurator

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
(cherry picked from commit 1232a7229af7ed60706cc725acf955ccbd8ca035)
2022-03-31 19:26:33 +08:00
Junjie Mao cdb142397b config-tools: fix the generation of DM-land ivshmem regions
The device-model land ivshmem regions are not properly generated into the launch
scripts today because:

  1. Those regions are provided by "Device Model", not "Device model".

  2. VM names are not properly encoded in the XPATH that search for the
     ivshmem regions accessible to a VM.

This patch fixes both issues.

Fixes: 0d84ecc4a ("config_tools: merge data in launch XMLs into scenario XMLs")
Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-31 15:59:42 +08:00
Fei Li e17acec539 misc: life_mngr: add a separate config to allow trigger sysreboot
Tracked-On: #7215
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-03-30 16:49:07 +08:00
Fei Li 187e19da2f misc: minor fix
Some minor comments refine and fix some typo

Tracked-On: #7215
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-03-30 16:49:07 +08:00
jackwhich 4169bfc21c config-tools: updated nuc11/whl board files
Because the board inspector update uses XPATH
to extract available PCI devices or serial ports,
So the board xmls need to be updated for all boards.

Tracked-On: #6690
Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2022-03-30 11:42:25 +08:00
Fei Li 25d5f2452e Misc: life_mngr: system reboot support
Now reuse allow_trigger_s5 in life_mngr_config to allow WAAG to trigger
system reboot.

Tracked-On: #7215
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-03-30 10:04:00 +08:00
Fei Li 6ea861affc Misc: life_mngr: a new common function to handle socket
Add a new common function to handle socket request, this will make
it is easy to add more socket request in windows lifecycle manager.

Tracked-On: #7215

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-03-30 10:04:00 +08:00
Fei Li b555bdc8ae Misc: acrnd: acrnd servie should start after life_mngr.service
acrnd servie should start after life_mngr.service, otherwise,
lifecycle manager in service VM will start after lifecycle
manager in User VM.

Tracked-On: #6994

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-03-30 10:04:00 +08:00
Kunhui-Li c9de9b61a3 config_tools: add BIOS invalid setting check
1. check if VMX feature is enabled in the BIOS setting.
If disabled, board inspector will show error message.
2. check if Hyper-Threading is enabled in the BIOS setting.
If enabled, board inspector will show warning message.
3. check if VT-d is enabled in the BIOS setting.
If disabled, board inspector will show error message.

v2-->v3:
Use the class names instead of addresses, and invoke the rdmsr method
of each class.

v1-->v2:
1. For the Hyper-Threading BIOS check, update the log level to the warning.
2. For VMX invalid BIOS check, the XDS does the actual check,
the board inspector only collects information.

Tracked-On: #6689
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-30 09:43:31 +08:00
Kunhui-Li 7dfc3c683c config_tools: add CPU capability checks
Add CPU capability checks.
If a feature is not supported on this processor, the board inspector
will show error message because it would impact ACRN’s ability
to function properly.

v3-->v4:
Update the error messages.

v2-->v3:
1. For VMX features, split each feature as a separate property, capability
checks in XML schema will then check all those features.
2. Use the class names instead of addresses, and invoke the rdmsr method
of each class.

v1-->v2:
1. Define each register as a class inheriting the `MSR` class defined
in platformbase.py, and define each bit as fields of that class.
2. The board inspector simply collects the CPU capability and attribute,
and the XSD does the actual check

Tracked-On: #6689
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-30 09:43:31 +08:00
Junjie Mao 29e3dd7163 board_inspector: add schema-based board checks
This patch adds schema-based board checks mechanism.
This provides integrators with a mechanism that XSD does
the actual board data check.

Tracked-On: #6689
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-30 09:43:31 +08:00
Minggui Cao d2a8e20117 misc: set PMU_PT flag for pre-launched RTVM
For post-launched RTVM, the acrn-dm can own PMU_PASSTHROUGH flag; for
pre-launched RTVM, need set it in configuration file by default.

Tracked-On: #6966
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
2022-03-29 09:34:17 +08:00
Junjie Mao 9be4a282c4 config_tools: extract serial ttys in board XML
This patch extracts all serial ttys in the native environment and updates
the XML schema to specify the XPATH that evaluates to the available ttys
for users to choose as the hypervisor console port.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-28 09:43:38 +08:00
Kunhui-Li e47765d8e5 config_tools: extract virtio device input basic information
Add a new extractor 70-device-classes.py which extracts virtio device
input basic information such as: name and phys.

An example:
<device_classes>
  <inputs>
    <input>
      <name>Power Button</name>
      <phys>LNXPWRBN/button/input0</phys>
    </input>
  <inputs>
</device_classes>

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-03-28 09:43:38 +08:00
Junjie Mao 8c46c2306f config_tools: format BDF in descriptions of PCI devices
This patch adds the BDF (in the format BBBB:DD.F) of each PCI device into
its description, which helps the configurator to fetch all available PCI
devices via XPATH rather than text manipulating functions.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-28 09:43:38 +08:00
Reyes, Amy 95c2849cee config_tools: Update Configurator UI XSD
- Update XSD files to match field names and tooltips in parameter spreadsheet

Tracked-On: #5692
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-03-25 15:06:24 +08:00
Junjie Mao 9197193e12 config_tools/upgrader: convert the old SERVICE_VM type
In the old days SERVICE_VM was also an acceptible VM type. It is now converted
to the load_order, with the vm_type field replaced by STANDARD_VM. This patch
adds this conversion logic into the upgrader.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-22 16:37:13 +08:00
Kunhui-Li e1f5c32ea2 config_tools: remove CONFIG_IOMMU_BUS_NUM
Since PR #6943 has landed, the `CONFIG_IOMMU_BUS_NUM` has been renamed
to `ACFG_MAX_PCI_BUS_NUM`, this patch removes the obsolete code about
`CONFIG_IOMMU_BUS_NUM`.

v1-->v2:
Update the upgrader.py to add a description of this obsoleted item.

Tracked-On: #6942
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-22 16:37:13 +08:00
Kunhui-Li b6538a4299 config_tools: fix the issue that got wrong device name after specifying mac address
If user add the specific mac address (eg: mac=00:16:3E:77:A9:41)
in launch script, we will get the device name with the specified mac address.
This is unexpected. This patch updates the parser to fix the issue.

v1-->v2:
Update the parser with regex.

Tracked-On: #7197
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-22 11:33:09 +08:00
Kunhui-Li 95a9c05a25 config_tools: remove the assume of virtio-net device name
Since PR #7185 has removed the assume of virtio-net device name,
we also remove it in the launch script generation logic.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-22 11:33:09 +08:00
jackwhich f8763cc953 config-tools: remove WHL sdc scenario/launch file
Because there is no SDC scenario in the generic template,
We remove the SDC specific scenario

Tracked-On: #6701
Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2022-03-21 15:04:38 +08:00
Reyes, Amy f5b021b1b5 doc: Minor style cleanup
- Remove "currently"
- Capitalize titles and Device Model

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-03-18 16:35:00 -07:00
Junjie Mao d776e4ad47 config_tools: packaging config tool scripts for easier import
The next-generation ACRN configurator will embed a Python interpreter built
in WebAssembly (WASM) for executing Python scripts for manipulating
scenario schemas and validating user data. It is quite tedious to
separately import multiple modules there due to the restriction of that
Python environment. The recommended approach is to package those
modules (e.g. as a *.wic file) so that all modules can be imported in one
shot.

This patch adds the files needed to package the scripts. The package is
solely used for the configurator to import and not intended to be used by
end users for any purpose.

v1 -> v2:

  * Fix the license header of __init__.py
  * Move patterns of ignored files to the top-level .gitignore

Tracked-On: #6691
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2022-03-18 08:49:06 +08:00
Chenli Wei 8e7a1ac7a0 misc: refine the non-stand vUART config
The Service VM needs a 'serial.conf' file to recognize and use
non-standard vUART with the 'setserial' package.

The logic of create serial.conf should update after we move vUART
connection to global and use endpoint to replace the target VM id.

This patch select the new vUART connection and check whether one of the
endpoint is Service VM, if yes, then check the io_port and record it
when the vUART is non-standard.

All these non-standard vUART will be written to the serial.conf.

Tracked-On: #6690
Reviewed-by: Junjie Mao junjie.mao@intel.com
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-03-17 18:33:15 +08:00
Junjie Mao cfcea64976 config_tools: add schema of checker schemas
This patch adds a (meta) XML schema of those XML schema files specifying
the validation rules (using xs:assert constructs). This provide integrators
with a mechanism to confirm the well-formedness of those rules, especially
the customized annotations for advanced error reporting.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-16 10:44:16 +08:00
Junjie Mao e266ab2649 config_tools: find and report counter examples on validation error
In order for more effective and specific error reporting, this patch
enhanced the XML assertion validation mechanism by:

  - Enhancing the elementpath library at runtime to capture of quantified
    variables that causes an assertion to fail, which can be used as a
    counter example of the rule.

  - Allowing error messages (as xs:documentation in the XML schema)
    embedding XPath (up to 2.0) which will be evaluated against the counter
    example to provide more specific information about the error.

  - Adding to assertions a mandatory attribute which specifies the context
    node(s) of an error using XPath. These nodes can be further used in the
    configurator to attach the errors to the widgets where users can fix
    them.

v1 -> v2:

  * Logging the validation errors according to their defined severity

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-16 10:44:16 +08:00
Junjie Mao d781b7bf17 config_tools: implement existing scenario checks in XSD
Now we have transitioned to use XML schema to record all data validation
rules against board and scenario XMLs. While most checks originally in the
Python scripts are about the syntax of the XML files and thus naturally
covered by the XML schemas, there are still a few that conduct cross-check
on data consistency.

This patch migrates those checks into XML schema as assertions.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-16 10:44:16 +08:00
Junjie Mao 44f0c32735 config_tools: change MMIOResourcesConfiguration to xs:all
The "MMIO resources" section of a VM definition may contain different nodes
depending on the VM load order, but the schema slicer cannot convert the
complex type specifying this section because the schema requires those
nodes to be a strictly-ordered sequence (by xs:sequence), not a set (by
xs:all).

As there is no requirement on this strict ordering, this patch converts
that complex type to be an unordered set instead.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-16 10:44:16 +08:00
Junjie Mao 0d84ecc4a1 config_tools: merge data in launch XMLs into scenario XMLs
Splitting the definitions of a post-launched VM into two files, namely the
scenario XML and launch XML, introduces duplicated field in both files and
leads to a high probability of having inconsistencies between them (see
issue #7156 as an example). Further more, this split has also adds much
complexity to the configurator which has to either hide some of the items
from user interfaces or synchronize different fields upon changes.

The advantage of the split, however, is not widely adopted. Having a
separate XML capturing the VM definition tweakable in the service VM at
runtime seems to give users more flexibility to redefine a VM without
recompiling the hypervisor. But that is not a common practice in the
industry segment; instead it is preferred to have a static scenario
definition to make sure that all resources are allocated carefully in a
fixed manner in order for better determinism.

As a result, this patch merges the fields in launch XMLs into the schema of
scenario XMLs. Some fields are post-launched VM specific and thus added,
while the others have similar items in scenario XMLs today.

The launch script generator is also updated accordingly to generate launch
scripts from the new scenario XMLs (which now contain the same amount of
information as previous launch XMLs).

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao 678879fd34 config_tools: more annotation on the config items
This patch adds the following annotations to the config items defined in
the schema of scenario XMLs:

  - acrn:title, which defines the human-readable label of the corresponding
    widgets in the configurator.

  - acrn:views, which controls in which view(s) this item shows in the
    configurator.

  - acrn:applicable-vms, which specifies the kinds of VMs (pre-launched,
    post-launched and/or service VM) this item applies to. An item not
    applicable to a certain type of VM will not be shown in the
    configurator, and will trigger validation error if that item exists for
    a VM of that specific type.

v1 -> v2:

  * Preserve the CPU affinity settings for service VMs. This will be needed
    later when we want to restrict the available CPUs the service VM can use at
    runtime (but not at initialization time).

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao f392164b40 config_tools: add ivshmem providers
A shared memory region can be provided either by the hypervisor or by the
device model. Before recent schema changes this is telled by the "hv:/" or
"dm:/" prefix.

This patch adds another node under an IVSHMEM region to represent the
provider, following the practice that information in the old-school
encodings is split and put as separate XML nodes.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao 609e09cf37 config_tools: drop obsolete config items
This patch drops a few config items which are no longer needed, including:

  - vm.os_config.name
  - vm.UEFI_OS_LOADER_NAME
  - vm.pci_dev_num

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao e88532b59d config_tools: refine console virtual UARTs
As is recommended by UX/DX reviews, the per-VM console virtual UART is now
limited to the following choices:

  - Disabled
  - a COM port from COM1 to COM4
  - PCI based

This patch converts the schema of scenario XMLs to integrate this
recommendation and add logic in the scenario upgrader to migrate data from
old scenario XMLs.

v1 -> v2:

  * Update the static allocators and C source transformers according to the
    new console vUART config item.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao 7ad9596dd6 config_tools: change representation of build types
Instead of using a Boolean variable indicating whether a build is for debug
or release, it is more intuitive to specify the build types as "debug" or
"release".

This patch converts the config item RELEASE to BUILD_TYPE which takes
"debug" or "release" as of now.

The generated header and makefile still uses RELEASE, and the command line
option RELEASE=<y or n> is also preserved.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao 7a1fbcf51f config_tools: add upgrader of scenario XMLs
With a bunch of dramatic improvement to the schema of scenario XML
recently, it is now non-trivial for users of previous releases to migrate
their scenario definitions to the next-gen schema, which will be a
major obstacle when upgrading to the next ACRN release.

In order to ease the upgrade of scenario XML, this patch introduces a
script that takes a scenario XML of previous releases and generates a new
one which satisfies the latest schema. The major data that can be migrated
include:

  - Virtual UART and shared memory configurations

  - VM types, load_order and guest flags

Other data are preserved as long as they are still needed according to the
schema. The script to print a list that summarizes the data that are
unintendedly discarded during the upgrade, so that users can double check
the results and edit the generated scenario using the configurator.

The upgrader share the same command-line interface of the default value
populator and scenario validator.

More upgrading logic will be added at the same time the schema is changed.

v1 -> v2:
  * The upgrader now pretty-prints the upgraded XML.
  * Apply the upgrader to the current scenario XMLs in the repo. The
    ordering of nodes are adjusted to align with the schema, but no
    essential changes are made.
  * Set the log level to INFO.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao 0e225c4b23 config_tools: add a slicer of XML schema
We plan to add the following attributes to element definitions in the XML
schema:

  - acrn:applicable-vms, which specify if an element applies to a
    pre-launched VM, the service VM or a post-launched VM

  - acrn:views, which specify if an element shall appear in the basic or
    advanced tab in the configurator.

In order to reduce the attributes above to existing XML technologies, we
need to create new complex types that lists all config items that applies
to a pre-launched VM, the service VM or a post-launched VM, or that should
be shown in the basic or advanced view. Such types can then be used to
replace the original, all-in-one type during validation or configurator
rendering.

When unspecified, an element always applies under all possible
circumstances.

To realize this slicing mechanism, this patch adds a generic class
implementing the common part of slicing XML schema types and two
specific-purpose slicers according to the applicable VMs or views
attributes.

v2 -> v3:

  * Update configdoc.xsl to recognize types in xs:alternative nodes.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao 433b37b1a8 config_tools: unify the CLI of scenario-manipulating scripts
Today the scripts that populate default values and validate scenarios have
different command-line interfaces: the former requires an XML schema as
input (which is cumbersome in most cases), while the latter always infer
where the XML schema is (which is inflexible).

This patch unifies the command line options of those scripts as follows:

  - The scenario XML is always a required positional argument.

  - The output file path (if any) is an optional positional argument.

  - The schema XML file is an optional long option. When not specified, the
    scripts will always use the one under the misc/config_tools/schema
    directory.

Also, this patch makes the validator.py executable, as is done to other
executable scripts in the repo.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao 0a7910c7f0 config_tools: composing operations around XMLs as pipelines
There is an increasing demand of composing different operations around XML
schemas and/or data in different ways for different purpose. Today we
already have:

  - Validate XML data, which takes XML schemas and data (board and
    scenario) as inputs.
  - Fill in missing nodes in XML data with default values, which takes XML
    schema and data (scenario only) as inputs.

In the near future we'll extend the operations around XMLs by introducing
XML schema preprocessing and XML data upgrading, adding more possibilities
to construct a larger operation by composing smaller ones.

In order for minimized code repetition and easier composition, this patch
introduces an infrasturcture that abstracts each operation as a pipeline
stage. Each stage defines its own inputs and outputs and can be composed
sequentially as a larger, single operation.

The existing operations listed above, along with XML file loaders, are then
refactored to provide pipeline stages. The main methods are also refined to
complete their tasks by constructing and invoking pipelines.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao 4fb6ad247a config_tools: do not create leaf nodes without default values
Today the default value populator will always create a node if it is
required by the schema but not provided in the given XML file. This could
hide issues in a given scenario XML if a node does not have default
values (i.e. require user's inputs) but accepts empty text.

This patch avoids the creation of nodes without a default value so that, at
validation stage, missing of essential data is always reported.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao 06eacfa32d config_tools: walk through xs:alternative
The "xs:alternative" nodes in XML schema enables specifying different types
for the same node according to the contents of that node. A typical usage
of this construct in the schema of scenario XMLs is to specify different
types for a `vm` node depending on whether it is a pre-launched,
post-launched or service VMs, so that each VM contains only configurations
supported in that kind of VM.

This patch adds support of xs:alternative nodes to the schema transformer
so that default values can be populated appropriately after we add
xs:alternative nodes to the schema.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao 9f13bbc349 config_tools: abstract schema walk as a separate class
Today the script default_populator.py fills in default values by visiting
an XML schema and an XML tree simultaneously and add a node to the latter
whenever one satisfying the schema does not exist. This visiting logic is
not only useful for filling in default values, but also for upgrading
XMLs to new schemas.

This patch abstracts the flow of the visiting above as a separate class,
just like tree visitors or transformers. The current default value
populator is then refactored to extend that class by inheritance.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao 74071d1bd4 config_tools: move RDT-related checks to a separate file
Assertions in XML schema are placed under schema/checks as the central
place, in order to make it easier to enhance the error reporting
specifically on assertion failures in the near future.

This patch moves the RDT related assertions in the schema to a dedicate
file uner schema/checks.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
hangliu1 e83c9b6430 config tool: Fix tee guest flag
Fix tee guest flag

Tracked-On:#6690
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-03-10 14:35:57 +08:00
hangliu1 c4bf41bfd0 config tool: fixup load_order bug
fixup load_order bug

Tracked-On:#6690
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-03-09 13:06:15 +08:00
Tw d1e3e8d633 dm/tools: compatible with openssl3.0
HMAC_*, MD5_* and SHA256_* are deprecated since openssl3.0, replace them with the corresponding equivalents.

Tracked-On: #6743
Signed-off-by: Tw <wei.tan@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-03-08 17:39:47 +08:00
Chenli Wei 71129879d1 misc: modify vuart config for xmls
We have redesign the vuart and the UI for user, so the config tool
should change the schema and xform for the new xml, then change the
static_allocators to alloc irq for new connection.

This patch modify the xmls for vuart new design.

Tracked-On: #6690
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
2022-03-08 17:07:48 +08:00
Chenli Wei 9450fcf3e1 misc: refine vuart connection
We have redesign the vuart and the UI for user, so the config tool
should change the schema and xform for the new xml, then change the
static_allocators to alloc irq and io_port for new connection.

This patch add a new vuart connection type and change the xforms to
adapter the new type.

Tracked-On: #6690
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
2022-03-08 17:07:48 +08:00
Kunhui-Li d9a80dc746 config_tools: fix the issue that doesn't offline CPU in SCHED_NOOP mode
Fix the issue that doesn't offline CPU in SCHED_NOOP mode.

Tracked-On: #7172
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-04 10:31:19 +08:00
Kunhui-Li 08f7c2582c config_tools: remove some obsolete code
Since PRs #7115 and #6664 have landed, the ivshmem and hv_ram_size have
been refined, some related checks are obsolete in config tool.
So we remove these checks here.

Tracked-On: #7136
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-03-03 14:40:59 +08:00
Xiangyang Wu ecf99c45a3 Misc: life_mngr: support user VM reboot
Add user VM reboot command and related command handler in
lifecycle manager to support user VM reboot.

Libvirt will send user VM reboot command to lifecycle manager
of service VM through socket, this command is forwarded to the
specified user VM, user VM will execute reboot command to start
reboot itself.

v1-->v2:
	Update some interfaces name to make it reable:
        (1) enable_uart_channel_dev_resend -->
	start_uart_channel_dev_resend
	(2) enable_all_uart_channel_dev_resend -->
	start_all_uart_channel_dev_resend
	(3) disable_uart_channel_dev_resend -->
	stop_uart_channel_dev_resend
	(4) get_reboot_flag --> get_user_vm_reboot_flag

Tracked-On: #5921

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-03-03 14:40:04 +08:00
hangliu1 c2695f290d config tool: remove guest flag for scenario xml
remove guest flags and add lapic_passthrough field

Tracked-On: #6690
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-03-02 15:50:23 +08:00
hangliu1 0068d4e826 config tool: remove guest_flags in user interface
The concept of guest_flags is hard to understand for users.
So turn guest_flags into several parameters in config tool
user interface, list as below:

GUEST_FLAG_LAPIC_PASSTHROUGH ---> lapic_passthrough
GUEST_FLAG_IO_COMPLETION_POLLING ---> io_completion_polling
GUEST_FLAG_VCAT_ENABLED ---> virtual_cat_support
GUEST_FLAG_SECURE_WORLD_ENABLED ---> secure_world_support
GUEST_FLAG_HIDE_MTRR ---> hide_mtrr_support
GUEST_FLAG_NVMX_ENABLED ---> nested_virtualization_support
GUEST_FLAG_SECURITY_VM ---> security_vm
GUEST_FLAG_RT ---> vm_type(RTVM)
GUEST_FLAG_TEE ---> vm_type(TEE_VM)
GUEST_FLAG_REE ---> vm_type(REE_VM)

In addition, HV global parameter NVMX_ENABLE is removed
from user interface, when config tool detects more than
one VM with nested_virtualization_support, NVMX_ENABLE is
assigned as 'y' automatically.

v1->v2:
*Rebase on the latest xml schema checking change
*Remove "all rights reserved" from the license header in guest_flags.py

v2->v3:
*Change the name of the new config items to CAPITAL_CASE style
*Combine guest flag policy to an XPATH in guest_flags.py
*Use count() to directly deduce NVMX_ENABLED in config_common.xsl and
update `boolean-by-key-value` to process 'true'

v3->v4:
*Change the name of the new config items to lower_case style
*Change guest_flag_node to allocation_vm_node in guest_flags.py
*Separate value case and key case for boolean-by-key-value

Tracked-On: #6690
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-02 15:50:23 +08:00
Kunhui-Li 1034443796 config_tools: fix the issue that fail to get apic_id node
Update the XPATH of apic_id to tolerate the variance of reported
intermediate levels.

Tracked-On: #7159
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-02 11:31:28 +08:00
Kunhui-Li cbce5c7775 config_tools: fix the board inspector exit issue
Fix the issue that board inspector exit after showing warning message.

Tracked-On: #6689
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-02-28 11:23:38 +08:00
Reyes, Amy 72a9b7bae3 doc: Style cleanup in usercrash, trusty, vuart docs
- Minor style changes per Acrolinx recommendations and for consistency

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-02-27 13:33:21 -08:00
Yang,Yu-chu eb78f1bb7c config-tools: add console=ttyS0 to bootargs
Add missing console=ttyS0 to service-VM's bootargs.

Tracked-On: #7127
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2022-02-25 09:31:17 +08:00
Yang,Yu-chu 2dd5bbd959 config-tools: remove SERIAL_CONSOLE extracion for bootargs of SOS
Remove the logic to parse SERIAL_CONSOLE and append to bootargs. Specify the console in bootargs directly.

Tracked-On: #7127
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2022-02-25 09:31:17 +08:00
hangliu1 9f8231e7ba config tool: xml change for vm_type and load_order
change vm_type and add load_order in all scenario xml

Tracked-On: #6690
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-02-22 16:25:27 +08:00
hangliu1 816a88f7f7 config tool: add load_order and redefine vm_type
This patch includes:
1.add load_order(PRE_LAUNCHED_VM/SERVICE_VM/POST_LAUNCHED_VM) parameter
2.change vm_type parameter to values as RTVM, STANDARD_VM, TEE, REE
  TEE and REE are hide in UI.
3.deduce vm severity in vm_configuration from vm_type and load_order

This patch not includes:
change for scenario_config and functions called by scenario_config about checking

v2->v3:
*Refine template load_order

v1->v2:
*Change variable name from vm_type to load_order
*Change LoadOptionType to LoadOrderType
*Change VMOptionsType to VMType
*Add TEE_VM/REE_VM description
*Refine acrn:is-pre-launched-vm

Tracked-On: #6690
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-02-22 16:25:27 +08:00
Kunhui-Li 55ced4e79f config_tools: remove PLATFORM_RAM_SIZE
Since PR #7113 has landed, we also remove PLATFORM_RAM_SIZE in the related
Python code, schema and all existing scenario XML files.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-02-22 08:36:11 +08:00
Junjie Mao 5b9c45da17 config-tools: remove obsolete files of launch configuration
With the launch script generation script rewritten, some other files under
launch_config are no longer used. This patch removes these obsoleted files.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-02-22 08:33:16 +08:00
Junjie Mao 2450b4c77f config-tools: rewrite the generator of launch scripts
The launch script generator today (and the scripts that it generates) is
fundamentally built on the concept of PCI device classes, with the
restriction that at most one PCI function per class can be passed through
to a post-launched VM. This has put inproper constraint on the scenarios
users can set up, especially on server platforms or those with SR-IOV
capable devices.

As it is too tedious to change such deep-rooted concept, this patch
rewrites the launch script generator and refines the structure of the
generated scripts so that PCI functions are identified only by their
BDF.

This change serves as a mandatory step to align the way how passthrough
devices are configured for pre-launched and post-launched VMs, which
eventually allows us to present a unified view in the configurator for
assigning passthrough device.

v2 -> v3:
 * Rename sos_id to service_vm_id and user_vmid to user_vm_id.
 * Refine a couple of info messages in the launch script template.

v1 -> v2:
 * Fix wording issues identified during review.
 * Exit when the out_dir is an existing regular file.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-02-22 08:33:16 +08:00
Yuanyuan Zhao 34037b88e0 config tool: modify ivshmem config for scenario.xml
Rewrite the configuration of ivshmem in scenario.xml according to
the format of new UI design.

Tracked-On: #6690
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-02-18 18:42:00 +08:00
Yuanyuan Zhao 9670caabf0 config tool: ivshmem: new design for ivshmem
According to the new design of DX, implement ivshmem configuration
and generate hv related files.

Tracked-On: #6690
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-02-18 18:42:00 +08:00
Xiangyang Wu 515bb22e06 Deb: install libcjson package in service VM automatically
Libcjson package is needed by command monitor of DM, so this
should be installed in the target platform.

Tracked-On: #5921

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2022-02-18 18:33:52 +08:00
Kunhui-Li 3594eb66e9 config_tools: add the '--rtvm" parameter for Hard RT in launch script
Since PR 7081 has updated the dm parameter`lapic_pt` usage,
according to the new design, we add the`--rtvm` parameter
for Hard RT in launch script generation logic.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-02-17 19:13:49 +08:00
jackwhich c4d0eb3395 config-tools: update board inspector to update pci.ids before fetching PCI information
Add lspci -q Query PCI ID database via DNS for unknown ID‘s

Tracked-On: #7086
Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2022-02-17 14:59:52 +08:00
Kunhui-Li 4bf53e4b83 config_tools: category based on different log levels
category based on different log levels:
1) If the board inspector show CRITICAL error messages, it means that the
board inspector tool exit instantly and generate no file.
2) If the board inspector show ERROR messages, it means that the board
inspector will generate the board XML file successfully, but several conditions
may result in ACRN build or boot failure cannot continue execution due to the error.
3) If the board inspector show WARNING messages, this means that the board inspector
generate the board XML file successfully, but this board XML file is lack of
some feature which could still boot ACRN but loss some features.
4) If the board inspector show INFO messages, this means that board inspector
printed out some normal information.
5) If the board inspector show DEBUG messages, this means that it is used to
debug board inspector workflow.

v1->v2
1. Keep the assertions or exceptions under the acpiparser, inspectorlib
and smbiosparser directory.
2. Exit after all check_deps() completes instead of any unsatisfied dep
is identified.
3. As Amy's advice, Replace the message "{board_xml} saved successfully" with
the message "SUCCESS: Board configuration file <file name> generated successfully
and saved to <path>."

To do:
Print all messages using the colored font.

Tracked-On: #6689
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-02-17 14:49:25 +08:00
Yang,Yu-chu 2e20494db1 config-tools: bring all cores online
Bring all the cores up in the beginning of the board_inspector.py
It is expected to run board_inspector in clean and native environment.
To resolve the issue that user may run other jobs which puts cores
offline, bringing up all cores online so tool can run cpuid to extract
all available cores information.

Tracked-On: #7119
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2022-02-17 14:11:49 +08:00
Reyes, Amy e09968e5e4 doc: Update Debian packaging readme
- Update doc for v2.8 release

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-02-10 12:43:59 -08:00
Yonghua Huang 9699353a08 tools: fix memory leakage issue in acrnlog.c
In function mk_dir(), handler 'dir' returned
 by opendir() is not released before function
 return and results in memory leakage.

Tracked-On: #7098
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2022-02-10 15:26:22 +08:00
Junjie Mao 845c7dfa0a config_tools: fix illegal access to the level_types dictionary
In 10-processors.py, level_types is an unordered dictionary from level type
encodings to human-readable terms, not a list. It is thus illegal to access the
highest level using the `[-1]` notation.

This patch fixes this by calculating the highest level in level_types and use
that level as the index instead.

Tracked-On: #6689
Fixes: b5b22bf98 ("board_inspector: avoid hard-coded topo level names")
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-02-09 10:59:46 +08:00
Yang,Yu-chu c4381b6d1c config-tool: append passthrough gpu bdf in hexadecimal format
Fix the format of passthrough gpu bdf of post-launched VM.

Tracked-On: #7084
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2022-02-07 09:50:57 +08:00
Junjie Mao cd4e7786e6 xforms: use values calculated from board XML as default values
Manually specifying MAX_IOAPIC_NUM and MAX_IOAPIC_LINES in a scenario XML
is still usable as a workaround on boards without IOAPIC (e.g. emulated
ones) or when the board inspector does not collect IOAPIC information
correctly.

This patch takes user-specified values of those items if
provided. Otherwise the automatically calculated values will be used
instead, as is done today.

Tracked-On: #6986
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-01-29 11:54:03 +08:00