Commit Graph

437 Commits

Author SHA1 Message Date
jackwhich 845970b376 config-tools: update nuc11/whl/generic_board board files
Because Board Inspector modifies the SR-IOV function,
VF information is correctly captured when Board Inspector
collects Board information. So update the board xmls

Tracked-On: #7031
Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2022-04-20 10:55:00 +08:00
hangliu1 7bcc5b7383 config tool:add support for bootargs missing
Bugfix:bootargs is optional parameter, which may be not
present in xml as a node, asl_gen.py needs to process
that case.

Tracked-On: #7307
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-19 13:20:08 +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
Zhou, Wu 423312881d config-tools: extract the SSRAM area size
The GPA SSRAM area size in pre-launched VMs was hard-coded to 8MB.

Since this area is mapped from host SSRAM area, it will cause compile
problem when host's SSRAM area is larger than 8MB.

To solve this issue, we have to calculate SSRAM area's size in
gpa.py, and generate a macro PRE_RTVM_SW_SRAM_MAX_SIZE for HV
to use.

PRE_RTVM_SW_SRAM_START_GPA/END_GPA can be calculated by end/size
in HV, so they are removed.

When SSRAM is not configured in the system, PRE_RTVM_SW_SRAM_MAX_SIZE
is set to 0.

Crl_bin is not needed in guest. So it's size is removed in bin_gen.py.

Tracked-On: #7212

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
2022-04-18 16:47:23 +08:00
Junjie Mao 46fab9e8a0 board_inspector: extract PF and VF info
This patch adds logic to the extractors to fetch the following information.

  1. All the details of an SR-IOV capability, which are reported in the
     SR-IOV extended capability structure.

  2. Correctly report the vendor ID, device ID and BAR addresses of VFs.

  3. Refer each VF back to the corresponding PF. Use XPATH to search for
     all the VFs enabled by a PF.

Tracked-On: #7301
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-18 14:58:58 +08:00
Junjie Mao 93ccc0f473 board_inspector: parse SR-IOV capability structure properly
This patch adds the logic needed to fully parse an SR-IOV extended
capability structure. Such information will later be used to extract all
information about physical and virtual functions.

Tracked-On: #7301
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-18 14:58:58 +08:00
Junjie Mao 0a77891f1c board_inspector: maintain a mapping from cap names to cap struct
In order to ease the access of certain capability structure of a PCI config
space, this patch changes the class PCIConfigSpace to maintain a
_caps_as_dict dictionary that maps capability names (as specified in the
caps.py and extcaps.py) to the actual capability structures.

Tracked-On: #7301
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-04-18 14:58:58 +08:00
hangliu1 2d0089f06b config tool: update cpu affinity check algorithm
pcpu in pre-launched RTVM cannot share with other VM

Tracked-On: #7287
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-18 13:41:37 +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
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
Kunhui-Li 76dc2b3a5e config_tools: refine Virtio devices in the schema
We have redesigned Virtio and UI for user, so this patch updates the schema
for the new design.

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
hangliu1 5c3e7a29ee config tool/doc:update SCHED_IORR in schema
hide SCHED_IORR and KERNEL_RAWIMAGE in schema
and update SCHED_IORR in doc

Tracked-On: #7256
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-13 13:35:52 +08:00
hangliu1 1157d1d41c config tool: update virtio block setting
add support for more than one virtio block setting
for specific vm

Tracked-On: #7277
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-13 11:13:02 +08:00
hangliu1 0e4a94f9dd config tool: hide PTM in schema
change acrn:view attribute to ""

Tracked-On: #7261
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-12 13:55:20 +08:00
hangliu1 f656ef0abc config tool: Fix service vm cpu affinity issue
default value of minOccurs is "1", which will trigger problem
when user leave pcpu_id blank while preserve cpu_affinity in
service VM.

Tracked-On: #7267
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-12 11:34:56 +08:00
hangliu1 7bf96c5a97 config tool: Fix combined cpu_affinity warning
Service vm could have the combination of big and
little core cpu_affinity setting, fix the assert.

Tracked-On: #7270
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-12 10:05:27 +08:00
hangliu1 310120092e config tool: service vm parameter display
Fix it in schema by adding attribute acrn:applicable-vms

Tracked-On:#7262

Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-04-06 15:40:44 +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 ac9824cd54 configurator: fix can't load scenario without pci_devs issue
fix can't load scenario without pci_devs issue

Tracked-On: #7246
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-06 11:17:18 +08:00
Kunhui-Li 080335bbe7 config_tools: fix the issue that fail to read XSD file
fix the path issue that fail to read XSD file.

Tracked-On: #6689
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-06 10:31:55 +08:00
Weiyi Feng 3d8fa80949 configurator: update configurator version to 0.3.0
update configurator version to 0.3.0

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-01 12:19:40 +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
Weiyi Feng 3f1057b747 configurator: fix single vm scenario load issue
fix single vm scenario load issue

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-01 12:19:40 +08:00
Weiyi Feng 578a482626 configurator: fix displayed scenario path
fix displayed scenario path

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-01 12:19:40 +08:00
Reyes, Amy 9a4cb33f39 config_tools: Update Configurator UI XSD
- Update labels and descriptions

Tracked-On: #5692
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-04-01 10:04:57 +08:00
Weiyi Feng a79d2ded7e configurator: update configurator dependencies to latest version
update configurator dependencies to latest version

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-04-01 09:14:43 +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 260718d544 configurator: autoload board and scenario xml when exist
autoload board and scenario xml when exist

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-03-31 19:26:33 +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 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
jackwhich 4169bfc21c config-tools: updated nuc11/whl board files
Because the board inspector update uses XPATH
to extract available PCI devices or serial ports,
So the board xmls need to be updated for all boards.

Tracked-On: #6690
Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2022-03-30 11:42:25 +08:00
Kunhui-Li c9de9b61a3 config_tools: add BIOS invalid setting check
1. check if VMX feature is enabled in the BIOS setting.
If disabled, board inspector will show error message.
2. check if Hyper-Threading is enabled in the BIOS setting.
If enabled, board inspector will show warning message.
3. check if VT-d is enabled in the BIOS setting.
If disabled, board inspector will show error message.

v2-->v3:
Use the class names instead of addresses, and invoke the rdmsr method
of each class.

v1-->v2:
1. For the Hyper-Threading BIOS check, update the log level to the warning.
2. For VMX invalid BIOS check, the XDS does the actual check,
the board inspector only collects information.

Tracked-On: #6689
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-30 09:43:31 +08:00
Kunhui-Li 7dfc3c683c config_tools: add CPU capability checks
Add CPU capability checks.
If a feature is not supported on this processor, the board inspector
will show error message because it would impact ACRN’s ability
to function properly.

v3-->v4:
Update the error messages.

v2-->v3:
1. For VMX features, split each feature as a separate property, capability
checks in XML schema will then check all those features.
2. Use the class names instead of addresses, and invoke the rdmsr method
of each class.

v1-->v2:
1. Define each register as a class inheriting the `MSR` class defined
in platformbase.py, and define each bit as fields of that class.
2. The board inspector simply collects the CPU capability and attribute,
and the XSD does the actual check

Tracked-On: #6689
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-30 09:43:31 +08:00
Junjie Mao 29e3dd7163 board_inspector: add schema-based board checks
This patch adds schema-based board checks mechanism.
This provides integrators with a mechanism that XSD does
the actual board data check.

Tracked-On: #6689
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-30 09:43:31 +08:00
Minggui Cao d2a8e20117 misc: set PMU_PT flag for pre-launched RTVM
For post-launched RTVM, the acrn-dm can own PMU_PASSTHROUGH flag; for
pre-launched RTVM, need set it in configuration file by default.

Tracked-On: #6966
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
2022-03-29 09:34:17 +08:00
Junjie Mao 9be4a282c4 config_tools: extract serial ttys in board XML
This patch extracts all serial ttys in the native environment and updates
the XML schema to specify the XPATH that evaluates to the available ttys
for users to choose as the hypervisor console port.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-28 09:43:38 +08:00
Kunhui-Li e47765d8e5 config_tools: extract virtio device input basic information
Add a new extractor 70-device-classes.py which extracts virtio device
input basic information such as: name and phys.

An example:
<device_classes>
  <inputs>
    <input>
      <name>Power Button</name>
      <phys>LNXPWRBN/button/input0</phys>
    </input>
  <inputs>
</device_classes>

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-03-28 09:43:38 +08:00
Junjie Mao 8c46c2306f config_tools: format BDF in descriptions of PCI devices
This patch adds the BDF (in the format BBBB:DD.F) of each PCI device into
its description, which helps the configurator to fetch all available PCI
devices via XPATH rather than text manipulating functions.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-28 09:43:38 +08:00
Reyes, Amy 95c2849cee config_tools: Update Configurator UI XSD
- Update XSD files to match field names and tooltips in parameter spreadsheet

Tracked-On: #5692
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-03-25 15:06:24 +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
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
jackwhich f8763cc953 config-tools: remove WHL sdc scenario/launch file
Because there is no SDC scenario in the generic template,
We remove the SDC specific scenario

Tracked-On: #6701
Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2022-03-21 15:04:38 +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
Chenli Wei 8e7a1ac7a0 misc: refine the non-stand vUART config
The Service VM needs a 'serial.conf' file to recognize and use
non-standard vUART with the 'setserial' package.

The logic of create serial.conf should update after we move vUART
connection to global and use endpoint to replace the target VM id.

This patch select the new vUART connection and check whether one of the
endpoint is Service VM, if yes, then check the io_port and record it
when the vUART is non-standard.

All these non-standard vUART will be written to the serial.conf.

Tracked-On: #6690
Reviewed-by: Junjie Mao junjie.mao@intel.com
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-03-17 18:33:15 +08:00
Junjie Mao cfcea64976 config_tools: add schema of checker schemas
This patch adds a (meta) XML schema of those XML schema files specifying
the validation rules (using xs:assert constructs). This provide integrators
with a mechanism to confirm the well-formedness of those rules, especially
the customized annotations for advanced error reporting.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-16 10:44:16 +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
Junjie Mao d781b7bf17 config_tools: implement existing scenario checks in XSD
Now we have transitioned to use XML schema to record all data validation
rules against board and scenario XMLs. While most checks originally in the
Python scripts are about the syntax of the XML files and thus naturally
covered by the XML schemas, there are still a few that conduct cross-check
on data consistency.

This patch migrates those checks into XML schema as assertions.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-16 10:44:16 +08:00