Commit Graph

7272 Commits

Author SHA1 Message Date
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
Zhao Yakui 373dac68ef ACRN:VGPU: Virtio_gpu_init calls the vdpy_init before vdpy_get_display_info
Now vdpy_get_display_info/get_edid is called before vdpy_init.
This is incorrect. They should be called after setting up the
connection with vdisplay.

Tracked-On: #7376
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2022-04-28 09:41:06 +08:00
Zhao Yakui e3b7f736d7 ACRN:VGPU: Add the missing initialization of vdisplay info
Now some fileds are not initialized, which causes that ACRN-DM doesn't
handle the request of VIRTIO_GPU_CMD_GET_DISPLAY_INFO and
VIRTIO_GPU_CMD_GET_EDID.

Tracked-On: #7376
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2022-04-28 09:41:06 +08:00
Zhao Yakui 402565f222 ACRN:VGPU: Fix the incorrect logic of fetching EDID
The virtio_gpu in guest_vm will try to fetch the EDID to query
the supported resolution. Guest vm will send the cmd of
VIRTIO_GPU_CMD_GET_EDID and receive the response of VIRTIO_GPU_RESP_OK_EDID.
Now acrn-dm has some issues in course of handlding EDID request: Incorrect
resp type, the incorrect response. This will cause that the guest_vm fails
to fetch the EDID.

Tracked-On: #7376
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2022-04-28 09:41:06 +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
Fei Li 5130dfe08b hv: vSRIOV: add VF BARs mapping for PF
When enabling SRIOV capability for a PF in Service VM, ACRN Hypervisor
should add VF BARs mapping for PF since PF's firmware would access these
BARs to do initialization for VFs when it's first created.

Tracked-On: #4433
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-04-26 15:07:25 +08:00
Fei Li 13e99bc0b9 hv: vPCI: passthrough MSI-X Control Register to guest.
In spite of Table Size in MSI-X Message Control Register [Bits 10:0] masks as
RO (Register bits are read-only and cannot be altered by software), In Spec
PCIe 6.0, Chap 6.1.4.2 MSI-X Configuration "Depending upon system software
policy, system software, device driver software, or each at different times or
environments may configure a Function’s MSI-X Capability and table structures
with suitable vectors."

This patch just pass through MSI-X Control Register field to guest.

Tracked-On: #7275
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-04-26 15:07:25 +08:00
Tw e2f7b1fc51 hv: remove obsolete declarations related to RDT
Since CAT support for hybrid platform is landed, let's remove some old declarations
which are no longer used.

Tracked-On: #6690
Signed-off-by: Tw <wei.tan@intel.com>
2022-04-26 14:27:01 +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 a2e2640507 config-tools: ignore the scenario and board field
Ignore the "scenario" and "board" field in <scenario>.xml:
    <acrn-config board="whl-ipc-i5" scenario="shared">

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
Conghui 593414e9c2 config-tools: support absolute path
1. Support absolute path for scenario file.
2. Use the scenario xml file name as scenario name, but if it is
'scenario.xml', use the upper level directory name.
e.g.
	SCENARIO=<pathxxx>/shared/scenario.xml
Then scenario name would be 'shared'.

3. Change 'realpath' to 'abspath' as we should keep the original path
for scenario file even it is a link file. This will make sure the
scenario name is always consistent with file set in 'SCENARIO='.

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
Chenli Wei a0678c82bb dm: optimize the parameter compatibility
This patch checks the obsoleted parameters and print some warnings
instead of exiting the acrn-dm directly. The following obsoleted
parameters are covered:

-i, --ioc_node
-G, --gvtargs
-Y, --mptgen
--vsbl
--part_info
--pm_by_vuart
--pm_notify_channel

Tracked-On: #6690
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-04-24 10:25:09 +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
Chenli Wei ed1c638c87 hv: refine for HPAn setting
The current code only supports 2 HPA regions per VM.

This patch extended ACRN to support 2+ HPA regions per VM, to use host
memory better if it is scatted among multiple regions.

This patch uses an array to describe the hpa region for the VM, and
change the logic of ve820 to support multiple regions.

This patch dependent on the config tool and GPA SSRAM change

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Reviewed-by: Fei Li <fei1.li@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
Zhao Yakui 599962fe71 ACRN:DM:VGPU: Rename thread_name for dedicated rendering thread
Otherwise it will use the "acrn_dm" as the thread_name, which is not
convenient to check the cpu_usage of rendering_thread.

Tracked-On: #7337
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2022-04-21 16:35:15 +08:00
Zhao Yakui 0873575a03 ACRN:DM:VGPU: Free the memory after creating udmabuf
In course of creating the udmabuf, udmabuf_create_list is allocated and
passed to kernel. After the dmabuf is returned, it is not used
any more. Need to free it otherwises it will cause the memory leak.

Tracked-On: #7337
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2022-04-21 16:35:15 +08:00
Zhao Yakui 8b7767e643 ACRN:DM:VGPU: Fix the incorrect use after free
It still tries to access the gpu->vdpy_handel after the gpu
is free. This is incorrect.

Tracked-On: #7337
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2022-04-21 16:35:15 +08:00
Zhao Yakui 2a7a269313 ACRN:DM:VDISPLAY:Fix the possible access after free
When virtio-gpu tries to submit the framebuffer based on
VIRTIO_GPU_CMD_2D, one pixman_image will be created. When the
sdl rendering_thread is terminated, the pixman_image will be 
released. But its pointer is set to NULL. In the next reboot,
its access in vdpy_surface_set is incorrect.  

Tracked-On: #7337
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2022-04-21 16:35:15 +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