Commit Graph

19 Commits

Author SHA1 Message Date
Zhou, Wu 4b81a2d89a config-tools: remove 'nomwait' from board_inspector's requirement
This patch is about the bug that VMs can't idle.

ACRN enables VM's C-state by extracting host's C-state table.
The C-state table has two types of interfaces: system-IO and mwait. VMs
just need one of them. ACRN can support both.

Currently we are telling users to use the system-IO type. That is, by
adding 'nomwait intel_idle.max_cstate=0' to host Linux's CMD line when
using board_inspector. (The reaseon we were using system-IO is that
mwait was buggy on Apollo Lake.)

But recent tests show that system-IO is somehow buggy. Linux c-state
driver(no matter intel_cstate or acpi_cstate) fails to enter idle state
with system-IO. This can always be reproduced on native environments.
MPERF counters show CPU cores are not in real idle state as expected.

To enable C-state in VMs, we have to switch to mwait.
As ACRN has already supported both system-IO and mwait, we don't have
to modify any code. We just need to tell user to use mwait instead of
system-IO.
That is, don't add 'nomwait intel_idle.max_cstate=0' to host Linux's
CMD line when using board_inspector. Just add 'intel_idle.max_cstate=0'

Due to the Apollo Lake's mwait bug, 'nomwait' is still needed for
Apollo Lake as an exception.

Tracked-On: #7371

Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
2022-04-30 17:06:23 +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
jackwhich c4d0eb3395 config-tools: update board inspector to update pci.ids before fetching PCI information
Add lspci -q Query PCI ID database via DNS for unknown ID‘s

Tracked-On: #7086
Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2022-02-17 14:59:52 +08:00
Kunhui-Li 4bf53e4b83 config_tools: category based on different log levels
category based on different log levels:
1) If the board inspector show CRITICAL error messages, it means that the
board inspector tool exit instantly and generate no file.
2) If the board inspector show ERROR messages, it means that the board
inspector will generate the board XML file successfully, but several conditions
may result in ACRN build or boot failure cannot continue execution due to the error.
3) If the board inspector show WARNING messages, this means that the board inspector
generate the board XML file successfully, but this board XML file is lack of
some feature which could still boot ACRN but loss some features.
4) If the board inspector show INFO messages, this means that board inspector
printed out some normal information.
5) If the board inspector show DEBUG messages, this means that it is used to
debug board inspector workflow.

v1->v2
1. Keep the assertions or exceptions under the acpiparser, inspectorlib
and smbiosparser directory.
2. Exit after all check_deps() completes instead of any unsatisfied dep
is identified.
3. As Amy's advice, Replace the message "{board_xml} saved successfully" with
the message "SUCCESS: Board configuration file <file name> generated successfully
and saved to <path>."

To do:
Print all messages using the colored font.

Tracked-On: #6689
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-02-17 14:49:25 +08:00
Yang,Yu-chu 30951f7a83 hv: rename CONFIG_GPU_SBDF to CONFIG_IGD_SBDF
The name CONFIG_IGD_SBDF indicates the bdf of an integrated GPU on platform.

Tracked-On: #6855
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-11-28 14:23:29 +08:00
Hu Fenglin e6de236caa deb-pkg: load msr driver in board_parse.py
Tracked-On: #6688
Signed-off-by: Hu Fenglin <fenglin.hu@intel.com>
2021-10-29 14:50:48 +08:00
Geoffroy Van Cutsem 9bae63b941 config_tools: improve logging readability for the board inspector
Improve the logging readibility for the Board Inspector tool by adding
a space after "Error:" and "Warning:" instead of have the text directly
attached to it.

Tracked-On: #6736
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-10-29 12:17:49 +08:00
Junjie Mao f64f253562 config_tools: always initialize hw_ignore when parsing DMAR
Commit 4a04fcc ("config_tools: skip remapping HW units with no devices under
scope") skips hardware remapping units without any device under its scope in the
config tools, which turns out to only work if the HV is not parsing the DMAR at
runtime.

This patch reverts the previous workaround and fixes the previous issue by
always initializing `dmar_hw_list.hw_ignore` when parsing DMAR. This ensures
that the DRHDx_IGNORE macro will always be emitted while DRHD_COUNT is not
impacted.

Fixes: 4a04fcc ("config_tools: skip remapping HW units with no devices under scope")
Tracked-On: #6709
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-10-28 19:36:41 +08:00
Geoffroy Van Cutsem 6ad9dcb262 config_tools: fix crash in board_inspector if cpuid is missing
Fix a crash in the 'board_inspector.py' tool in case 'cpuid' is not
installed on the system.

The tools crashes because 'cpuid' is used before the check for
dependencies is done in the code. That check for dependencies is
done in the 'legacy/board_parser.py' file. But the native_check()
function that is called before it also expects the cpuid tool to
be installed.

The fix is to move the check for dependencies in the main
'board_inspector.py' file, before any other operation is done.

Tracked-On: #6719
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-10-27 10:17:31 +08:00
Junjie Mao 4a04fcc48f config_tools: skip remapping HW units with no devices under scope
It is seen on some platforms that the ACPI DMAR tables will report
remapping hardware units that does not have any device under its scope,
which is not expected by the board inspector previously and thus causes the
tool to generate inconsistent configuration data.

This patch makes the board inspector skip such remapping hardware units. It
does not impact the functionality of the hypervisor as no device is managed
by those skipped remapping units.

Tracked-On: #6709
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-10-25 15:31:54 +08:00
Kunhui-Li b420b3b52f config_tools: remove the log of sucessfully generating board XML
remove the log "<board>.xml has been generated successfully!" in
board_parser.py, because it only mean that the board xml file have
been created sucessfully here, not the all data have been appended
successfully and pretty formatted.

Tracked-On: #6315
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-23 14:50:23 +08:00
Yang,Yu-chu c10ac227cc config-tools: remove unused package and add nosec to subprocess
The subprocess module is needed for calling package from python script.
Add #nosec for subprocess module importing.

Tracked-On: #6342
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-08-13 16:11:42 +08:00
Yang,Yu-chu fec1f87adc config-tools: do not exit when the board inspector runs in hypervisor
While running in a nested environment, such as qemu, parse the board
information should be allowed even it is not in a native environment.

Replace the error with warning message and does not exit the program.

Tracked-On: #6208
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-07-19 10:13:28 +08:00
Kunhui-Li e6d447e462 config_tools: update board_inspector to copy RTCT file
1. Remove acpi_template/ehl-crb-b/PTCT and acpi_template/tgl-rvp/PTCT files.
2. Update board_inspector/legacy/acpi.py script to copy RTCT file.

Tracked-On: #6238
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-07-02 13:42:06 +08:00
Kunhui Li ff2102a5c1 config_tools: replace illegal character with escaped character
For illegal characters, replace original characters with escaped characters in board.xml.

Tracked-On: #6113
Signed-off-by: Kunhui Li <kunhuix.li@intel.com>
2021-06-01 11:28:52 +08:00
Junjie Mao 99f15a27c2 board_inspector/acpiparser: enable parsing RTCT v2
This patch adds support to parse RTCT v2 using the refined board XML
schema. The major changes include:

 - Add the RTCT v2 parser in the acpiparser module. The version of an RTCT
   is detected automatically to choose the right parser.
 - Extract software SRAM capabilities of caches into the board XML.
 - Move the logic that determines the software SRAM base address for the
   pre-launched VM to the static allocator of GPAs.
 - Generate software SRAM related macros into misc_cfg.h when necessary.

Tracked-On: #6020
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-05-19 08:53:38 +08:00
Yonghua Huang 9facbb43b3 config-tool: rename PSRARM to SSRAM
'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>
2021-05-17 14:31:42 +08:00
Junjie Mao e6e61a4979 board_inspector/legacy: fix a copy destination error
Tracked-On: #5922
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-05-16 19:02:00 +08:00
Junjie Mao bd4ddbd31d board-inspector: reorganize the scripts
This patch reorganize the files of the board inspector as follows.

1. Rename the directory name from `target` to `board_inspector`, in order to
   align with the name used in ACRN documentation.
2. Move the scripts that generate the current board XML into the `legacy`
   sub-directory. The legacy nodes will be removed after transitioning to the
   new board XML schema completely,
3. Add the main script `cli.py` which is the command line interface of the board
   inspector.

v1 -> v2:
 - Rename `run.py` to `cli.py`.

Tracked-On: #5922
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-05-16 19:02:00 +08:00