Commit Graph

153 Commits

Author SHA1 Message Date
Yang,Yu-chu
1ca9061b6d config-tools: refine MAX_MSIX_TABLE_NUM
If the MAX_MSIX_TABLE_NUM is specified in scenario.xml. Return the
largest number from count of MSI, table_size of MSIX or
MAX_MSIX_TABLE_NUM of scenario.xml.

Tracked-On: #6235
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-11-15 13:40:34 +08:00
Minggui Cao
61074ce1ee hv: enable CAT for tgl-rvp
enable CAT for tgl-rvp on release-v2.5

Configure LLC CAT rt-core: 0xf00, others: 0x0ff

Tracked-On: #6547
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
2021-09-09 09:53:26 +08:00
Junjie Mao
55e8443571 board_inspector/cli: export PATH to the legacy board parser
Customized environment variables are not inherited to child processes
created by the subprocess module. As a result the legacy board parser may
not be able to locate the prerequisite utilities if they can be found only
with the customized PATH.

This patch passes the PATH of cli.py to the legacy parser so that both
scripts use the same PATH to search for utilities.

This patch is added in v2 of the series.

Tracked-On: #6287
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-09-04 18:55:48 +08:00
Junjie Mao
b3767a4a32 config_tools: rename two missed PSRAMs to SSRAMs
The term PSRAM is now obsoleted and should be replaced with SSRAM, as has been
done by commit 9facbb43b3 ("config-tool: rename PSRAM to SSRAM"). However,
there are two places in the configuration toolset that still uses PSRAM. This
patch updates these missed occurrences accordingly.

Tracked-On: #6012
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-08-20 11:09:36 +08:00
Yang,Yu-chu
fc60a200d0 config-tools: refine the MAX_MSIX_TABLE_NUM in config.h
Find the maximum of counts MSI and table_size of MSI-X based on
board.xml.

Tracked-On: #6235
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-08-12 10:53:33 +08:00
Yang,Yu-chu
2183f308b4 config-tools: add MSI-X capability
Add the MSI-X capability structure nodes under <capability
id="MSI-X"> in board.xml.
Example:
  <capability id="MSI-X">
    <table_size>16</table_size>
    <table_bir>1</table_bir>
    <table_offset>0x1000000</table_offset>
    <pba_bir>1</pba_bir>
    <pba_offset>0x0</pba_offset>
  </capability>

Fix the MSI <count> nodes when there is only one vector.

Tracked-On: #6235
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-08-12 10:53:33 +08:00
Kunhui-Li
5ce22d1649 config_tools: update board xml files for MAX_MSIX_TABLE_NUM fix
The PR 6236 has modified the board.xml format for MAX_MSIX_TABLE_NUM fix.
To compromise this PR, updates all the source file board.xmls.

Tracked-On: #6235
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-12 10:53:33 +08:00
Victor Sun
e5aa63b08e config_tools: update ehl-crb-b xml with new uart
The debug uart of mmio@0xfe042000 has been switched to pci uart at 0:19.2,
so change the board file accordingly.

Tracked-On: #6348

Signed-off-by: Victor Sun <victor.sun@intel.com>
2021-08-04 09:13:35 +08:00
Fei Li
9948dea338 hv: relocate ACPI DATA address to 0x7fe00000
Relocate ACPI address to 0x7fe00000 and ACPI NVS to 0x7ff00000 correspondingly.
In this case, we could include TPM event log region [0x7ffb0000, 0x80000000)
into ACPI NVS.

Tracked-On: #6320
Signed-off-by: Fei Li <fei1.li@intel.com>
2021-07-29 15:52:56 +08:00
Junjie Mao
48c070c88e config_tools: adjust the end of TPM log area
The log area of TPM is typically placed as part of the ACPI data region in
e820. This patch follows this convention by adjusting how the virtual TPM
log area base address is allocated.

Tracked-On: #6320
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-07-28 13:52:12 +08:00
Kunhui-Li
2db0b235b7 config_tools: enlarge max size to store RTCT table
Enlarge the max size to store the PTCT/RTCT table to 1k bytes
because the size of RTCT table exceeded the original max size
0x1100 - 0xF00 which makes RTCT table overlap other ACPI tables.

Tracked-On: #6303
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-07-28 13:50:16 +08:00
Yifan Liu
9fbef0df69 config-tools: Update tgl-rvp.xml
Update tgl-rvp.xml to latest version.

Tracked-On: #6320
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-07-26 16:51:30 +08:00
Yang,Yu-chu
dce3142cfc config-tools: refine bin_gen.py arguments and tpm2_acpi_gen
Refine the arguments of bin_gen.py. The --board and --scenario take the
path to the XMLs as the argument. The allocation.xml is needed for
bin_gen.py to generate tpm2 acpi table.

Refine the condition of tpm2_acpi_gen. The tpm2 device "MSFT0101" can be
present in device id or compatible_id(CID). Check both attributes and
child node of tpm2 device.

Tracked-On: #6320
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-07-26 16:51:30 +08:00
Junjie Mao
7439ac1a92 board_inspector: extract Compatible IDs of devices
In addition to the mandatory _HID (Hardware ID), the ACPI spec also defines
an optional _CID (Compatible ID) object for device identification.

This patch enhances the ACPI extractor by parsing the _CID objects of devices as
well.

Tracked-On: #6320
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-07-26 16:51:30 +08:00
Yang,Yu-chu
796f11a064 config-tools: create virtual acpi of passthrough tpm2
Create virtual acpi table of tpm2 based on the raw data if the tpm2
device is presented and the passthrough tpm2 is enabled.

Tracked-On: #6320
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-07-26 16:51:30 +08:00
Yang,Yu-chu
2940b8a31e config-tools: generate the log area data of tpm2
Insert the passthrough tpm2 datas to mmiodevs of vm_configurations.c

Tracked-On: #6320
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-07-26 16:51:30 +08:00
Yang,Yu-chu
15fa9f95ca config-tools: allocae log area start address
If passthrugh TPM2 is enabled and the log area is present, allocates
the log_area_start_address with the size log_area_minimum_length(256K).

Tracked-On: #6320
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-07-26 16:51:30 +08:00
Yang,Yu-chu
40eaff9569 config-tools: add tpm2 acpi parser to board_inspector
Create python script tpm2 which parse the tpm2 acpi table datas. Add
this parsed data to the <device id="MSFT0101" description="TPM 2.0 Device"> of board.xml.

Tracked-On: #6320
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-07-26 16:51:30 +08:00
Junjie Mao
3c707408ec board_inspector: check if BAR base is 0
It is seen occasionally that a memory/port BAR of a PCI device is
programmed with the address 0 which is clearly invalid. This patch
gracefully handles this case by printing an error to warn the users that
this device cannot be passed through to any VM.

Tracked-On: #6298
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-07-26 16:51:30 +08:00
Junjie Mao
7f3016e678 board_inspector: fix scope opening in the AML parser
According to section 19 of ACPI spec 6.4, the following clauses open name
scopes (in addition to the Scope clauses).

  - Function
  - Device
  - Method
  - Power Resource
  - Thermal Zone

The current AML parser only opens a scope when parsing DefMethod and
DefDevice, however. This patch fixes the AML parsing by opening a scope on
visiting a DefPowerRes or DefThermalZone clause.

Note: Functions in ASL are equivalent to Methods at AML level.

Tracked-On: #6298
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-07-26 16:51:30 +08:00
Junjie Mao
a65d162b15 board_inspector: fix unregisteration of conditionally disabled objects
The current ConditionallyUnregisterSymbolVisitor has the following two
issues.

  1. The visitor will crash when a DefIfElse node is not fully parsed due
     to failed deferred expansion.
  2. Nested DefIfElse of disabled blocks are still checked and one of its
     branch may still take effect.

This patch fixes those issues by checking the predicates of a DefIfElse
block only when conditionally_hidden is False and check existence of
TermList and DefElse clauses.

Tracked-On: #6298
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-07-26 16:51:30 +08:00
Junjie Mao
631d628178 board_inspector: fix an opcode peek issue
When parsing a sequence of clauses, it is not necessary to peek an opcode
from the current stream unless that sequence starts with one. Peeking an
opcode is even an error when the actual clause is empty (e.g. as a
TermList).

This patch makes the SequenceFactory only peeking at the next opcode when
the grammar expects one.

Tracked-On: #6298
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-07-26 16:51:30 +08:00
Junjie Mao
60da7d6bfd board_inspector: improve readability and performance of AML parser
This patch refines the AML parser to improve its readability and
performance in the following ways.

  1. A Tree object now has the parts of the corresponding object being
     member fields. As an example, a Tree with label `DefMethod` now has
     members `NameString`, `MethodFlags` and `TermList`.
  2. It is now possible to assign names each part of an object. The grammar
     is updated to assign different names to the parts with the same type
     in the same object.

Tracked-On: #6298
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-07-26 16:51:30 +08:00
Junjie Mao
6e79479a0a board_inspector: always defer parsing of method bodies
The current ACPI AML parser can generate incorrect AST if a DSDT/SSDT
satisfies the following:

  1. The body of a method invokes a NameString that is defined later.
  2. Before the method that NameString is also defined but in an outer
     scope and with a different number of parameter.

Since method bodies hardly define any further symbol that is referenced
outside the method itself, this patch forces the parsing of method bodies
to be deferred to the second pass when all symbols have been declared.

Tracked-On: #6298
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-07-26 16:51:30 +08:00
Junjie Mao
0395a8adf9 board_inspector: Access I/O registers on-demand and properly
The current implementation of I/O buffers have the following issues.

  1. I/O buffers are filled with values on creation. This may be fine for
     memory-mapped I/O regions, but could be a problem to port I/O regions
     and indexed I/O regions.

  2. While not commonly seen, it IS witnessed that some devices only allow
     its MMIO registers to be accessed with certain width. Accessing such
     registers with a larger width will not be handled by the device,
     causing SW to get all 1's rather than the actual values in these
     registers.

This patch resolves the issues above as follows. I/O buffers now do not
access any register on creation. Instead, the register is accessed only
upon requests. Also the access width of these registers are followed to
ensure that the registers are accessed properly.

Tracked-On: #6298
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-07-26 16:51:30 +08:00
Junjie Mao
6f3bfa80b1 board_inspector: interpret DefDivide in DSDT/SSDT
DefDevide is now enountered when interpreting host DSDT/SSDT. This patch
implements the interpretation.

Tracked-On: #6298
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-07-26 16:51:30 +08:00
Junjie Mao
d333ae50d7 board_inspector: return from method call invocation on DefReturn
The current implementation of the AML interpreter continues interpreting a
method after meeting a DefReturn object, which is incorrect. This patch
fixes this issue.

Tracked-On: #6298
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-07-26 16:51:30 +08:00
Tao Yuhong
e3a55de27b HV: add mmiodev resource in acrn_mmiodev data structure
mmiodev can have more than one mmio resource, so mmiores[3] is embedded
into mmiodev

Tracked-On: #6320
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2021-07-26 16:51:30 +08:00
David B. Kinder
cd4dc73ca5 doc: push doc updates for v2.5 release
Cumulative changes to docs since the release_2.5 branch was made

Tracked-On: #5692

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-06-24 21:19:05 -07:00
Kunhui-Li
7e9d625425 config_tools: remove nuc11tnbi5 scenario xml except industry.xml
Remove hybrid.xml, hybrid_rt.xml, logical_partition.xml and
industry_launch_2uos.xml files because validation team found
that these scenario files not working. And these documents will be
resubmitted after them are verified successfully.

Tracked-On: #6244

Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-06-24 14:43:08 +08:00
Kunhui-Li
25fa3466c5 config_tools: modify README file
1. Update python script name that is executed to generate board xml file
from run.py to cli.py in README file.
2. Update the OS requirement under native Linux in
misc/config_tools/board_inspector/README file.

Tracked-On: #6134
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-06-17 10:31:11 +08:00
Victor Sun
9aff6b1fbd config_tools: Revert "update scenario xml" for MAX_MSIX_TABLE_NUM
This reverts commit 24af7f8f9d which leaves
MAX_MSIX_TABLE_NUM item as empty for most of platforms except ehl-crb-b and
expect config tool to calculate a correct MAX_MSIX_TABLE_NUM for hypervisor
use. Unfortunately current config tool just calculate maximum native MSIX
number without evaluating the maximum MSI vectors that ACRN needed for vMSIX
emulation, thus introduce big risk on the device vMSIX table initialization.

If customer has special device that need larger MAX_MSIX_TABLE_NUM to enable
ACRN, he can input the number in his own scenario file.

Tracked-On: #6186

Signed-off-by: Victor Sun <victor.sun@intel.com>
2021-06-17 10:23:32 +08:00
Kunhui-Li
24af7f8f9d config_tools: update scenario xml
1. Update the value of the tag MAX_MSIX_TABLE_NUM from 64 to empty
for all scenario xml except ehl-crb-b board.
2. Update the value of the tag MAX_MSIX_TABLE_NUM to 96 for the
scenario xml on the ehl-crb-b board.

Tracked-On: #6186

Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-06-11 14:30:52 +08:00
Kunhui-Li
d63083a285 config_tools: update scenario xml
Update the value of the tag MAX_PT_IRQ_ENTRIES from 64 to 128
in TGL-RVP scenario xml.

Tracked-On: #6185

Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-06-11 14:30:52 +08:00
Yang,Yu-chu
5bec1e8b1d config-tools: allocate the first unused bar for vmsix
A vmsix supported passthrough device expects the first unused bar region
for vmsix. Pop the first unused_bar_index in gpa.py instead.

Reference code: init_vmsix_on_msi of hypervisor\dm\vpci\vmsix_on_msi.c

Tracked-On: #6192
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-06-11 10:31:38 +08:00
Shuang Zheng
1e478fc6a9 config_tools: add hybrid, hybrid_rt, logical partition scenario on adl board
add hybrid, hybrid_rt, logical_partition scenario and add launch
config xml on adl-s-crb board, add launch config xml on adl-rvp board.

Tracked-On: #5929
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2021-06-10 11:00:32 +08:00
Kunhui-Li
d4b5db93e4 config_tools: clean up the board folders
1. Remove apl-up2, apl-up2-n3350, apl-mrb, nuc6cayh board
   folders from the latest code base.
2. Copy tgl-rvp.xml to generic_board.xml.

Tracked-On: #6175

Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-06-10 09:54:25 +08:00
Yang,Yu-chu
559d40a939 config-tools: refine get_pt_intx_table and check_pt_intx
Refine get_pt_intx_table. The method parse the <pt_inx> of scenario and
append the pair of phys_gsi and virt_gsi if there is any.

Refine check_pt_intx. Add a condition that the method returns if the
phys_gsi and virt_gsi are empty dictionary.

Tracked-On: #6178
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-06-09 10:17:46 +08:00
Yang,Yu-chu
86565ebaf4 config-tools: enable "allow_trigger_s5" through launch.xml
Add flag "allow_trigger_s5" to launch script xmls. If this flag sets to
'y' and the poweroff_channel sets to "vuart1(pty)" or "vuart1(tty)", the
"allow_trigger_s5" will appends to the end of "--pm_notify_channel
uart".

Tracked-On: #6138
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-06-04 10:00:53 +08:00
Kunhui Li
b96fdb0ea6 Revert "config_tools: save board xml when loading from config tool UI"
This reverts commit 033f458d85.
Remove the code change that save the board xml into misc/config_tools/data/[board]/ when loading a new board from config tool UI.

Tracked-On: #6104
Signed-off-by: Kunhui Li <kunhuix.li@intel.com>
2021-06-03 15:31:59 +08:00
Yang,Yu-chu
4d52f50552 config-tools: update qemu.xml
Make up qemu.xml to compromise the static allocators which use the
new xpath based on board inspector.

Tracked-On: #6102
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-06-03 14:43:30 +08:00
Kunhui Li
d573e958e4 Config_tools: Update Hybrid Cores
Update the severity from "warning" to "error" for hybrid cores check.

Tracked-On: #5918
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Kunhui Li <kunhuix.li@intel.com>
2021-06-03 14:42:58 +08:00
Kunhui Li
21915dfd52 Config_tools: Update tgl-rvp scenario xml
Add CLOS_MASK elements into tgl scenario files as default configuration.

Tracked-On: #6120
Signed-off-by: Kunhui Li <kunhuix.li@intel.com>
2021-06-03 11:52:02 +08:00
Kunhui Li
279c171a7c Config_tools: Update get slot logic
Modify the initial value of PT_SLOT variable and
update the get slot logic that all device call the virtual_dev_slot function to get slot number directly.
Copy the launch_uos_id1.sh to launch_win.sh.

Tracked-On: #6072
Signed-off-by: Kunhui Li <kunhuix.li@intel.com>
2021-06-01 11:30:02 +08:00
Kunhui Li
976d4790a2 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 08:45:54 +08:00
Kunhui Li
ec60d919cd Config_tools: Update XML
1. For nuc11tnbi5 board,
   1) Add hybrid.xml, industry.xml, hybrid_rt.xml, logical_partition.xml and industry_launch_2uos.xml.
   2) Update nuc11tnbi5.xml for GSG.
2. Update tgl-rvp board xml.

Tracked-On: #6104
Signed-off-by: Kunhui Li <kunhuix.li@intel.com>
2021-06-01 08:45:01 +08:00
Kunhui Li
033f458d85 config_tools: save board xml when loading from config tool UI
save the board xml into misc/config_tools/data/[board]/ when
loading a new board from config tool UI.

Tracked-On: #6104
Signed-off-by: Kunhui Li <kunhuix.li@intel.com>
2021-06-01 08:45:01 +08:00
Shuang Zheng
f6a3f5b0d0 config_tools: add adl-s-crb board and industry scenario
add adl-s-crb board xml and industry scenario for adl-s-crb.

Tracked-On: #5929
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2021-05-31 18:30:02 +08:00
Shuang Zheng
3d73452493 config_tools: add RTCT table support in pre-launched VMs
add RTCT table integrated with ACPI binary for pre-launched
VMs.

Tracked-On: #6015

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2021-05-27 20:45:01 +08:00
Jiang, Yanting
d81898f4eb config-tools: fix guest_flag issue in config xml for adl
commit 873ed75 ("misc: sanity check VM config for nested virtualization")
requires that the guest_flag tag can't be empty, or it will fail to build.

This patch changes adl instances of "<guest_flag></guest_flag>" to
"<guest_flag>0</guest_flag>".

Tracked-On: #5923
Signed-off-by: Jiang, Yanting <yanting.jiang@intel.com>
2021-05-26 15:37:27 +08:00