Commit Graph

90 Commits

Author SHA1 Message Date
Kunhui-Li 48f97dbbda config_tools: tiny fix for config_summary.py
An error will be raised if no cache level 3 information in board xml
file. this patch skips getting cache level 3 information when no l3 cache info
in config_summary.py.

Tracked-On: #8438
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2023-07-10 17:26:34 +08:00
Kunhui-Li ac29ec2c6b config_tools: fix the issue that fail to generate config_summary.rst if enable CAT
currently, configurator will fail to generate config_summary.rst file if
user enable the "Cache Allocation Technology" because note function in rstcloth
is replaced by self.doc.note.

So this patch updates function and usage to fix this issue.

fixs: 9c2d0f8 ("config_tools: replace RstCloth library with class.")
Tracked-On: #8422
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2023-06-09 18:24:35 +08:00
Kunhui-Li 9c2d0f8858 config_tools: replace RstCloth library with class.
Currently, Configurator load fail because it needs to download
RstCloth related packages. This patch defines Doc class to replace
RstCloth library to fix this issue.

Tracked-On: #8395
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2023-05-11 15:25:44 +08:00
Chenli Wei c9e5fd1469 misc: fix the summary issue after update board xml
The new board xml have add a "module" node under the "processors/die"
which has cause an issue when we run the summary, this patch  use "//"
to select all "cpu_id" under the "processors".

Tracked-On: #8385
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2023-04-24 15:43:09 +08:00
Junjie Mao de0a765010 config_tools: adapt to elementpath >= 4.0.0
Starting from elementpath 4.0.0, the XPath2Parser class no longer has a
SYMBOLS member and completeness checking based on that are removed as
well. This patch updates the elementpath_overlay in the config tools to fix
the compilation issue when using recent elementpath versions.

Tracked-On: #8368
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2023-04-24 11:46:56 +08:00
Chenli Wei 6d57f8254b misc: rename common.py to avoid private library conflict
The offline tool use a utility libary and use "common" to named it, this
name conflict with some customer's local library, so we rename it to a
better and clear name.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-11-14 12:03:51 +08:00
Chenli Wei 25445eefe7 misc: fix the vCPU number issue of document
Current code use a invalid parameter to print the vCPU number, this
patch use the length of vCPU list to fix the above issue.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-11-14 11:34:15 +08:00
yuchuyang 504e49a567 config-tools: generate config_summary.rst
Generate config_summary.rst when saving scneario XML and launch scripts.

Tracked-On: #8300
Signed-off-by: yuchuyang <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-11-14 09:53:53 +08:00
Kunhui-Li f165ff3b5a config_tools: update the upgrader.py script for virtio gpu
this patch updates the upgrader.py script for virtio gpu.

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>
2022-10-26 08:15:17 +08:00
Junjie Mao 7ce49f8c3c config_tools: determine SSRAM_ENABLED automatically
Today users are able to tweak whether the hypervisor includes support to
software SRAM (SSRAM). This, however, gives rise to potential functional
incorrectness when the hypervisor is not built with such support but a
service VM attempts to assign SSRAM to a post-launched VM (which is
possible as the service VM can still see the SSRAM-related ACPI tables). In
such cases the SSRAM assigned to a post-launched VM is not properly
initialized and thus not locked in cache.

As makes little sense for a user to configure the SSRAM support in the
hypervisor in a different way as the presence of SSRAM on hardware, this
patch removes the "SSRAM support" option from the configurator. The config
tools will now automatically enable the SSRAM support if the hardware
supports the feature and disable that otherwise.

Tracked-On: #8231
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-10-14 15:20:48 +08:00
Junjie Mao 3a4b84e078 config_tools: handle multiple xs:documentation properly
With multiple xs:documentation nodes under the same xs:annotation, xs2js
will convert the XML into a dict where the key `xs:documentation` maps to a
list rather than a string. This patch enhances the converter.py to handle
such case properly.

Tracked-On: #8098
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-09-21 15:15:38 +08:00
Chenli Wei 7a99e1b1d8 misc: refine upgrade script
There is some issue when use upgrade to update some old xml version to
release_3.1, this patch modify the upgrade script to fix these issue.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-09-08 18:10:56 +08:00
zihengL1 4f1e4eefc5 config-tools: generate config_summary.rst
Generate config_summary.py script in misc/config-tools/scenario_config
directory. This script can extract important information from scenario
and board xml to summary it into RST format text.

Tracked-On: #8063
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-09-01 12:18:58 +08:00
Junjie Mao f78c8f4660 config_tools: support dynamic enum names in XML schema
The dynamic enum mechanism today only allows specifying the enum values
using XPATH. While this is sufficient from functionality point of view, it
may not provide the best experience as users have to understand the raw
data used internally. The typical way to present more informational labels
of enum values to users is enum names which cannot be supported by the
current XML schema to JSONSchema converter.

This patch allows the XML schema to specify dynamic enum names by adding an
`acrn:option-names` attribute to an element. The attribute is interpreted
as an XPATH which evaluates to a sequence of the same length of
`acrn-options`. The element at index i in that sequence is considered the
enum name of the enum value at index i of the results of `acrn:options`.

This mechanism is first applied to the `pcpu_id` element to indicate
whether a physical CPU is P-core or E-core.

Tracked-On: #8050
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-08-29 17:48:12 +08:00
Junjie Mao 065bcaa2ce config_tools/upgrader: keep cache allocation policies properly
The current generic data moving policy in the upgrader do not work well
with complex nodes having multiple-occurred descendants. That causes the
lost of cache allocation policies in scenario XMLs when upgrading a v3.0
scenario XML to the coming v3.1.

This patch adds another generic-purpose mover that simply copies a whole
subtree unchanged.

Most nodes of this kind are handled by special movers as their formats
changed dramatically in v3.0, which is why that issue is not identified
earlier.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-08-26 21:46:56 +08:00
Wu Zhou 21d10af9d5 config-tools: change 'DISABLED' settings to 'ENABLED'
Some configurator settings are defined as 'feature DISABLED' style, which
could cause confusion to developers. This patch is to change them into
straightforward 'ENABLED' style.

Including:
  - MCE_ON_PSC_DISABLED -> MCE_ON_PSC_ENABLED
  - ENFORCE_TURNOFF_AC -> SPLIT_LOCK_DETECTION_ENABLED
  - ENFORCE_TURNOFF_GP -> UC_LOCK_DETECTION_ENABLED

Tracked-On: #7661

Signed-off-by: Wu Zhou <wu.zhou@intel.com>
2022-08-17 09:23:33 +08:00
Ziheng Li eb8bcb06b3 Update copyright year range in code headers
Modified the copyright year range in code, and corrected "int32_tel"
into "Intel" in two "hypervisor/include/debug/profiling.h" and
"hypervisor/include/debug/profiling_internal.h".

Tracked-On: #7559
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-07-15 11:48:35 +08:00
Junjie Mao df41ce807f config_tools: resolve incompatibility with elementpath 2.5.3
This patch adds to the customized function `number-of-clos-id-needed` more
robust checks, which ensures that a given node is a concrete element,
before that function passes the node to `get_policy_list`. This resolves
the incompatibility issue with elementpath 2.5.3 which is reported in v3.0.

Tracked-On: #7893
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-07-15 10:56:50 +08:00
Kunhui-Li 80766124a9 config_tools: fix the issue Service VM type is updated by UI automatically
Currently, if I update Pre-Launched VM type to real-time, select PCPU ID and
enable Real-time vCPU, then we update the name of sevice VM, finally, click the save button.
we will see the type of service vm is updated to RTVM. It is unexpected.

So this patch removes the logic of hiding service VM type, and only allows user
selecting Standard VM type to fix the issue that the service vm type is updated
by UI automatically.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-06-29 13:53:42 +08:00
Ziheng Li 3b5fbade33 config_tools: refine vm_type in upgrader
Rename "vm_type" from "SOS_VM" to "STANDARD_VM".

Tracked-On: #6690
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-06-29 13:53:42 +08:00
Junjie Mao 256dd158c3 config_tools: fix a module resolving issue in elementpath overlay
The library module introduced by commit 2cd13026e ("misc: move the RDT
interface to common library") was put under the library/ directory which is
not by default searchable from elementpath_overlay. This patch works around
the issue by adding that path to sys.path.

Also fix a typo in the RDT checking assertion.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-06-29 13:53:42 +08:00
Chenli Wei 72c406c2b7 misc: move the RDT interface to common library
The current RDT class and interface was define by the clos.py which is
mix get and merge RDT policy, create clos nodes.

Now we need call these interface to check the CLOS IDs number after
merged RDT policy, so this patch abstract the RDT interface to common
and add an assert to check the CLOS IDs number.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-06-29 13:53:42 +08:00
Ziheng Li c24515cb7c config_tools: refine some issues in upgrader
1.refine IVSHMEM_REGION node. Now if "IVSHMEM_REGION" node is empty,
the method "add_ivshmem_region" won't show an error.
2.refine vm_type node. Add try expect into method "move_vm_type", and
now if there is no "vm_type" node, the .pop() operation won't lead
to an IndexError.
3.refine move_memory method. Add handling process of "size" node,
if it's text is a hex number.

Tracked-On: #6690
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-06-29 13:53:42 +08:00
Ziheng Li 05fd75eeda config_tools: refine issues in the upgrader
When run the upgrader.py to merge scenario XML and launch XML files,
deleted "desc" text in "usb_xhci" node, and added the "vbootloader"
text from "Enable" to "y", from "Disable" to "n".

Tracked-On: #7660
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-06-29 13:53:42 +08:00
Ziheng Li d5c36632f1 config_tools: refine issues in the upgrader
Now in scenario XML file:
1.The vm memory node info has been transformed into a new form(
e.g. hpa_region, start_hpa, size_hpa, and size).
2.The clos node info will be dropped during the upgrade process,
and users can see the discard waring info.
3.During the upgrade process, the node "RELOC" will be renamed
to "RELOC_ENABLED", the node "MULTIBOOT2" will be renamed to
"MULTIBOOT2_ENABLED".

Tracked-On: #7660
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-06-29 13:53:42 +08:00
Junjie Mao e42d323459 config_tools: pretty-print JSON schema violations
The default error messages provided by the ajv validation library read like
this:

    * must have required property MEMORY.STACK_SIZE

    * must match pattern "<a regular expression>"

Such messages may look confusing as users are not supposed to understand
the internal naming of the config items or the regular expressions used to
validate strings.

This patch enables the XML schema to include 'acrn:errormsg' annotations
which is a dictionary from error types to customized error messages. This
mechanism is used to show more user-friendly messages upon common errors
such as missing or invalid data in required config item.

Tracked-On: #6691
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-06-29 13:53:42 +08:00
Junjie Mao ba2ea5503f config_tools: fix move_enablement in the upgrader
The EnablementType is now obsolete and config items having this type have
been updated to use the Boolean type. However, the upgrader is not changed
accordingly and it still converts "y" or "n" of certain config items to
"Enable" or "Disable".

This patch drops the EnablementType in the schema and updates the upgrader
to respect the latest definitions.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-05-27 00:00:30 +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
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
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
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
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
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
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
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
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
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 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 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
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
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
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 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
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 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 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
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
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