add customized parameters in the launch script generation logic.
If user specify customized parameters in configurator, we will
append them to the dm parameters for launching VMs.
Tracked-On: #8408
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
generate one line of parameter in launch scipt for
multiple xchi configs in scenario.xml.
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Tracked-On: #6690
Fix the following issues:
1. <gpu> and <displays> elements are added to scenario XML when they are not configured.
2. Virtio GPU components disappears after switching to another tab and switching back to
previous tab.
3. Wrong error message of vertical offset checking.
Improve the error check in virtio_devices.xsd:
1. Every window virtual display need to configure window resolution, horizontal offset
and vertical offset.
2. Any display's elements need to be configured. The existing code
only check the first window resolution, horizontal offset, vertical
offset and monitor id.
Tracked-On: #8292
Signed-off-by: yuchuyang <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
When launch a User VM own pCPUs, offline Service VM vCPUs which use
the same pCPUs by launch script.
Tracked-On: #8253
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
If display type is "Windows", the generated launch script will follow
the below rule.
"virtio-gpu,geometry=<width>x<height>+<x_off>+<y_off>,geometry=<width>x<height>+<x_off>+<y_off>"
If display type is "Full screen", the generated launch script look like
this. For example:
"virtio-gpu,geometry=fullscreen:0,geometry=fullscreen:1"
Tracked-On: #7970
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Change ">>/dev/stderr" to ">&2"
Although it seems that the two have the same effects, the way they work is different.
The ">/dev/stderr" does an open(), it goes to the filesystem look for that file, opens and write to it. The second way, ">&2",just uses file descriptor 2.
The acrnd deamon outputs the stdin and stderr messages to journal through socket. And the socket cannot be manipulated with open methods.So acrnd cannot open the "/dev/stderr" which has redirected to a socket.
For successfully excuting the create_tap function in acrnd deamon, We change ">> /dev/stderr" to ">&2".
For the remain ">> /dev/stderr", they all follow the echo command and will not harm the launchscript functionality.
Tracked-On: #8066
Signed-off-by: Zhang Wei <wei6.zhang@intel.com>
The parameter for cpu_affinity is apicid of processor now.
Update the comment.
Tracked-On: #8050
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
The current code use cpu_id in scenario xml and use apic_id of the pCPU
in the launched script, this confuses the user, especially the same name
"cpu_affinity" is used for these script.
So this patch add some comment to launched script to explain the
relationship between cpu_id and apic_id.
Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
The current launch script allocate bdf for ivshmem by itself and have
not get bdf from scenario.
This patch refine the above logic and generate slot by user settings.
Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
The current code can't config PCI vUART by a unified HV Config and there
is a conflict between the HV vUART Config and PCI vUART Config.
This patch use PCI vUART Config to replace the HV vUART Config when the
vUART connection type is PCI and modify the launch scenario to make sure
the BDF is correct when user launch post launched VMs.
Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
"enable_ptm" and "d3hot_reset" failed to pass to acrn-dm because of
shell syntax error (arguments are separated by space, not comma).
Remove "igd-vf" as it's no longer needed.
Tracked-On: #7623
Signed-off-by: Calvin Zhang <calvinzhang.cool@gmail.com>
bugfix for the generated launch script without uart parameters
after VUART is configured to "pci"
Tracked-On: #7556
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>