Commit Graph

39 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Kunhui-Li 49b7a65876 config_tools: update the usage of cpu affinity param in launch script
Update the usage of cpu affinity param in launch script generation logic,
use apic_id got from board XML file instead of pcpu id from scenario XML
file according to the refined usage '--cpu_affinity lapic_id'.

The generated script will look like this:
`--cpu_affinity 0,2 \`

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-01-28 14:21:22 +08:00
Kunhui-Li 8b7a041b51 config_tools: update the usage of virtio-net parameter in launch script
1. for the `virtio-net`, add type field to specify tap/macvtap type.
The generated script will look like this. (eg. -s 4,virtio-net,tap=Waag)
2. Change mac_seed as virtio-net subparameter.
(eg. -s 10,virtio-net,tap=YaaG3,mac_seed=XXXXXX)

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-01-25 11:51:47 +08:00
Kunhui-Li 02268941d8 config_tools: remove the parameters "pm_notify_channel" and "pm_by_vuart" of acrn-dm
Since PR #7002 has removed "pm_notify_channel" and "pm_by_vuart"
from acrn-dm usage, this patch also removes the two parameters
in the launch script generation logic.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-01-19 08:52:51 +08:00
Kunhui-Li 702f5d2586 config_tools: remove some dynamic parameters of acrn-dm
Since PR #7002 has removed some dynamic parameters from
acrn-dm usage, this patch also removes the following parameters
in launch script generation logic.

1. --vsbl <vsbl_file_path>
2. -s <slot>,npk
3. -i, --ioc_node <ioc_mediator_parameters>
4. -A, --acpi
5. virtio-ipu
6. virtio-audio

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-01-19 08:52:51 +08:00
Weiyi Feng d56e241228 config_tools: add cpu_affinity cmdline at scenario set "SCHED_NOOP"
add cpu_affinity cmdline at scenario set "SCHED_NOOP"

Tracked-On: #6961
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-12-23 16:40:42 +08:00
Weiyi Feng 93d4e92273 config_tool: load default cpu affinity config by vm_name
1. load default cpu affinity config from scenario file by vm_name.

Tracked-On: #6724
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-26 16:48:05 +08:00
Weiyi Feng 86f1477482 config_tool: add vm_name field for launch config
add vm_name field for launch config

Tracked-On: #6685
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-16 14:42:59 +08:00
Kunhui-Li ccbf6d4603 config_tools: remove KATA and replace UUID with vmname to identify a vm
1. remove CONFIG_KATA_VM, CONFIG_MAX_KATA_VM_NUM and KATA_VM
related code.
2. remove KATA_VM in scenario xml files.
3. remove KATA vm type in UI.
4. remove UUID DB.
5. remove uuid in the launch script generation logic.
6. use vmname to identify a vm. (eg: <name>ACRN_SOS_VM</name>)
add the check logic to ensure vm name is a must-set item, not duplicated,
and the string length is [1-15] and the whitespace is not allowed.
7. enlarge the max VM num to 32.

Tracked-On: #6685
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-16 14:42:59 +08:00
Weiyi Feng 1bbfbcc8b3 config_tool: add cpu affinity check
1. ensure cpu affinity in launch xml is subset of its scenario settings.
2. cpu_affinity is a must have parameter for acrn_dm, if the user did not provide cpu affinity in launch xml, load it from scenario settings.

Tracked-On: #6724
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-15 09:07:58 +08:00
Kunhui-Li c3c8679afe config_tools: fix the duplicate PT_SLOT value issue in UI
when we add two or more virtio block devices and rename them for a VM
in launch xml files, then generate launch scripts through the UI.
After ensuring the devices names are different, we repeat these operations
continuously. Finally we will get the duplicate PT_SLOT value for
different virtio block devices in a launch script. This is wrong.

After user click the "Generate Launch Script" button to generate the
launch scripts every time, we will reset PT_SLOT variate to fix the issue.

Tracked-On: #6767

Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-15 09:02:55 +08:00
Kunhui-Li 9306de95a7 config_tools: fix the duplicate PT_SLOT value issue
when we add two or more virtio block devices and rename them for a VM
in launch xml files, then generate launch scripts through the UI.
After ensuring the devices names are different, we repeat these operations
continuously. Finally we will get the duplicate PT_SLOT value 30 for
different virtio block devices in a launch script. This is wrong.

As a workaround, we reassign PT_SLOT variate to reset it after the launch
script is generated every time.

Tracked-On: #6767
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-04 09:43:00 +08:00
Liu Long 7f846b7ecf Rename the xml file and generate launch script from uos to user_vm.
Tracked-On: #6744
Signed-off-by: Liu Long long.liu@linux.intel.com

Signed-off-by: Liu Long <long.liu@linux.intel.com>
2021-11-03 12:02:30 +08:00
Weiyi Feng 20f1dfd9c3 config_tools: Update GPU passthrough support
1. Remove gvt_args field.
2. Add passthrough GPU devices support.
3. Add sriov device support.

Tracked-On: #6290
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-02 18:30:54 +08:00
Liu Long 3f4ea38158 ACRN: misc: Unify terminology for service vm/user vm
Rename SOS_VM type to SERVICE_VM
rename UOS to User VM in XML description
rename uos_thread_pid to user_vm_thread_pid
rename devname_uos to devname_user_vm
rename uosid to user_vmid
rename UOS_ACK to USER_VM_ACK
rename SOS_VM_CONFIG_CPU_AFFINITY to SERVICE_VM_CONFIG_CPU_AFFINITY
rename SOS_COM to SERVICE_VM_COM
rename SOS_UART1_VALID_NUM" to SERVICE_VM_UART1_VALID_NUM
rename SOS_BOOTARGS_DIFF to SERVICE_VM_BOOTARGS_DIFF
rename uos to user_vm in launch script and xml

Tracked-On: #6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-11-02 10:00:55 +08:00
Liu,Junming 97d4485455 config_tool: remove "gpu" parameter when pass-thru IGD
remove "gpu" parameter when pass-thru IGD

Tracked-On: #6357

Signed-off-by: Liu,Junming <junming.liu@intel.com>
2021-09-22 15:32:01 +08:00
Kunhui-Li e68d66341e config_tools: adjust the execution order of pci_stub command
The execution order of the "modprobe pci_stub" command is erroneous
in the launch script generation logic. The "modprobe pci_stub" command
should be executed before unbinding passthru devices, so we adjust the
command excution order.

Tracked-On: #6565
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-09-15 13:21:46 +08:00
Kunhui-Li 93ea0075dd config_tools: update the regex pattern of offline cpu
The pattern matching logic (used by 'tr') is erroneous in the launch
script generation logic. While its purpose is to return the CPU number
from the 'cpuX' string (where 'X' is the CPU number),
it does it incorrectly for any multiple of 10. Examples:
- Processing 'cpu10' returns 1 (instead of 10)
- Processing 'cpu20' returns 2 (instead of 20)
This patch changes the [1-99] pattern matching to [0-9] which fixes it.

This error led to the incorrect CPU cores being used (and offlined)
for some VMs which could lead to confusing problems especially when
an exclusive use of that CPU core was assumed and expected (e.g. RTVM).

when CONFIG_BOOTPARAM_HOTPLUG_CPU0 is turned on in the kernel,
there is a risk that we try to offline cpu0. So we also add extra check
for cpu0 to aviod the risk.

Tracked-On: #6482
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-09-09 09:17:14 +08:00
Kunhui-Li 7b19c8e878 config_tools: update the logic of getting gpu bdf
The bdf of gpu is not 00:02.0 for the new platform icx-rvp,
it is 05:00.0 now, so we remove the hardcode 00:02.0;
And change to get the gpu bdf from board.xml.

Tracked-On: #6357
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-26 20:08:38 +08:00
Kunhui-Li bbc92361bc config_tools: update lpc slot number in script
Update lpc slot to origin value 1 from 31 in the script too,
because GOP driver has assumption to config space layout of
the device on 00:1f.0.

Tracked-On: #6340
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-20 08:07:43 +08:00
Shuo A Liu 1bccfab3b6 config_tools: Use new HSM driver device node
Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Kunhui-Li a8ef428b4b config_tools: fix cpu offline issue in launch script
In launch script, update cpu offline method to fix the issue
that it isn't offline cpu on ADL-S board.

Tracked-On: #6266
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-07-02 13:56:37 +08:00
Yang,Yu-chu c0af988af5 config-tools: enable "allow_trigger_s5" through launch.xml
Add flag "allow_trigger_s5" to launch script xmls. If this flag sets to
'y' and the poweroff_channel sets to "vuart1(pty)" or "vuart1(tty)", the
"allow_trigger_s5" will appends to the end of "--pm_notify_channel
uart".

Tracked-On: #6138
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-06-04 13:54:26 +08:00
Kunhui Li 80a9b3bf1e Config_tools: Update get slot logic
Modify the initial value of PT_SLOT variable and
update the get slot logic that all device call the virtual_dev_slot function to get slot number directly.
Copy the launch_uos_id1.sh to launch_win.sh.

Tracked-On: #6072
Signed-off-by: Kunhui Li <kunhuix.li@intel.com>
2021-05-31 07:39:16 +08:00
Yang,Yu-chu 346490a7dc config-tools: enable PTM through config-tools
Configure PTM in post-launched VM using <PTM> element. If the //vm/PTM
sets to 'y', pci_dev.c.xsl appends the virtual root port to
corresponding struct acrn_vm_pci_dev_config of that VM. Currently it
supports only post-launched VMs.

Configure enable_ptm for dm argument. If a uos/enable_ptm with uos id
= 'vm_id 'sets to 'y' and the vm/PTM with the same vm_id sets to 'y',
append an "enable_ptm" flag to the end of passthrough ethernet devices.
Currently there is only ethernet card can support the "enable_ptm"flag.

For the schema validation, the <PTM> can only be ['y', 'n'].

For the launched script validation, the <enable_ptm> can only be ['y',
'n']. If the <enable_ptm> sets to 'y' but the corresponding <PTM> sets
to 'n', the launch script will fail to generate.

Tracked-On: #6054
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-05-25 11:32:11 +08:00
Yonghua Huang 9facbb43b3 config-tool: rename PSRARM to SSRAM
'psram' and 'PSRAM' are legacy names and replaced
  with 'ssram' and 'SSRAM' respectively.

Tracked-On: #6012
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Shuang Zheng <shuang.zheng@intel.com>
2021-05-17 14:31:42 +08:00
Shuang Zheng e3a8b09e62 config_tools: add psram config in launch config
add "--psram" in acrn dm arguments in launch scripts
when PSRAM_ENABLED=y and the VM is post-launched RTVM.

Tracked-On: #5649

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2021-03-03 16:15:52 +08:00
Xie, nanlin 97c9b24030 acrn-config: Reorg config tool folder
Remove vm_configs folder and move all the XML files and generic code example into config_tools/data

Tracked-On: #5644
Signed-off-by: Xie, nanlin <nanlin.xie@intel.com>
2021-01-27 11:08:28 +08:00