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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
'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>
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>
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>