Commit Graph

784 Commits

Author SHA1 Message Date
Fei Li 730a275ecc misc: acrn_trace: enlarge DEV_PATH_LEN
Now ACRN support platform which CPU numbers are large than 10. So the old value
for DEV_PATH_LEN is not enough (18 is not enough for /dev/acrn_trace_xx).

Tracked-On: #6572
Signed-off-by: Fei Li <fei1.li@intel.com>
2021-09-16 08:50:35 +08:00
Kunhui-Li e68d66341e config_tools: adjust the execution order of pci_stub command
The execution order of the "modprobe pci_stub" command is erroneous
in the launch script generation logic. The "modprobe pci_stub" command
should be executed before unbinding passthru devices, so we adjust the
command excution order.

Tracked-On: #6565
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-09-15 13:21:46 +08:00
Yang,Yu-chu 366ea37552 config-tools: assign a fixed address to log area start address
Reserve the log area in [VIRT_ACPI_NVS_ADDR + 0xB0000, 0x7FFF0000)

Tracked-On: #6320
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-09-14 14:57:50 +08:00
Junjie Mao 2bfaa34cf2 config_tools: populate default values in scenario XML
While we have default values of configuration entries stated in the schema
of scenario XMLs, today we still require user-given scenario XMLs to
contain literally ALL XML nodes. Missing of a single node will cause schema
validation errors even though we can use its default value defined in the
schema.

This patch allows user-given scenario XMLs to ignore nodes with default
values. It is done by adding the missing nodes, all containing the defined
default values, to the input scenario XML when copying it to the build
directory. This approach imposes no changes to either the schema or
subsequent scripts in the build system.

Tracked-On: #6292
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-09-13 09:05:52 +08:00
Yang,Yu-chu 955103f7ea config-tools: remove the misc_cfg.h.py
Remove the deprecated misc_cfg.h.py

Tracked-On: #6553
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-09-13 09:04:37 +08:00
Yang,Yu-chu 3a28938f25 config-tools: add ROOTFS to misc_cfg.h.xsl
Generate the ROOTFS_# macros to misc_cfg.h.xsl.

Tracked-On: #6553
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-09-13 09:04:37 +08:00
Yin Fengwei 2ce85a18a7 crashlog: fix build issue with e2fsprogs v1.46.2
In e2fsprogs v1.46.2, s_volume_name is defined with attribute
nonstring. According to gcc doc, nostring defined string may
not contain a terminating NULL. So array safed function should
be used.

We use strncmp instead of strcmp to do comparing here.

Tracked-On: #6494
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2021-09-09 09:53:58 +08:00
Kunhui-Li b70d132f0d config_tools: rename UI menu
1. For initial UI, rename "ACRN Config" to "ACRN Configurator",
rename "Scenario Setting" to "Scenario Settings", rename "Launch Setting"
to "Launch Settings", and rename "Import Board info" to "Import Board XML";
2. For UI scenario selection, change title "Load Scenario Setting" to
"Load Default Scenario Settings", Change title "Save as" to "Save Scenario XML",
and rename "XML Name" to "Scenario XML Name";
7. For UI launch selection, rename "Load Launch setting" to
"Load Default Launch Settings", change title "Save as" to "Save Launch XML",
change "XML Name" to "Launch XML Name" and Change "Source Path" to "Launch XML Path".

Tracked-On: #6417
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-09-09 09:21:51 +08:00
Kunhui-Li 93ea0075dd config_tools: update the regex pattern of offline cpu
The pattern matching logic (used by 'tr') is erroneous in the launch
script generation logic. While its purpose is to return the CPU number
from the 'cpuX' string (where 'X' is the CPU number),
it does it incorrectly for any multiple of 10. Examples:
- Processing 'cpu10' returns 1 (instead of 10)
- Processing 'cpu20' returns 2 (instead of 20)
This patch changes the [1-99] pattern matching to [0-9] which fixes it.

This error led to the incorrect CPU cores being used (and offlined)
for some VMs which could lead to confusing problems especially when
an exclusive use of that CPU core was assumed and expected (e.g. RTVM).

when CONFIG_BOOTPARAM_HOTPLUG_CPU0 is turned on in the kernel,
there is a risk that we try to offline cpu0. So we also add extra check
for cpu0 to aviod the risk.

Tracked-On: #6482
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-09-09 09:17:14 +08:00
Yang,Yu-chu 2abda0237c config-tools: refine misc_cfg.h.xsl and lib.xsl
The whitespaces between delimiter saperated elemnts of a list causes
acrn:get-common-clos-max and acrn:find-list-min returns unexpected
numbers.

Translate the whitespaces to nothing and rewrite acrn:find-list-min and
acrn:get-common-clos-max.

Tracked-On: #6515
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-09-09 09:15:18 +08:00
Kunhui-Li b5b109dc64 config_tools: rename scenario xml
rename the industry folder to shared folder ,and also rename the
logical_partition folder to partitioned under the generic_code directory.

Tracked-On: #6315
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-09-02 10:01:25 +08:00
Kunhui-Li eee6244225 config_tools: rename scenario xml
1. Rename industry.xml to shared.xml
2. Rename logical_partition.xml to partitioned.xml.
3. Update the name in view.py correspondingly.

Tracked-On: #6315
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-09-02 10:01:25 +08:00
Kunhui-Li 9f85c14594 config_tools: update scenario xml file on ehl-crb-b platform
for ehl-crb-b platform, update sos rootfs from "dev/sda3"
to "/dev/nvme0n1p3" in hybrid.xml file.

Tracked-On: #6530
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-09-02 09:16:44 +08:00
Kunhui-Li c456f41567 config_tools: update scenario xml files on tgl-rvp platform
For SMBIOS and TPM, enable SECURITY_VM_FIXUP and add GUEST_FLAG_SECURITY_VM
flag in TGL hybrid_rt.xml. Then disable SECURITY_VM_FIXUP in TGL hybrid.xml
because it’s previously enabled in hybrid.xml instead of hybrid_rt.xml by
mistake.

Tracked-On: #6320
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-31 13:38:08 +08:00
Kunhui-Li 7b19c8e878 config_tools: update the logic of getting gpu bdf
The bdf of gpu is not 00:02.0 for the new platform icx-rvp,
it is 05:00.0 now, so we remove the hardcode 00:02.0;
And change to get the gpu bdf from board.xml.

Tracked-On: #6357
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-26 20:08:38 +08:00
Yifan Liu 975ff33e01 hv: Move uuid_is_equal to util.h
This patch moves uuid_is_equal from vm_config.c to util.h as inline API.

Tracked-On: #6320
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2021-08-26 09:24:50 +08:00
Yifan Liu 32d6ead8de hv && config-tool: Rename GUEST_FLAG_TPM2_FIXUP
This patch renames the GUEST_FLAG_TPM2_FIXUP to
GUEST_FLAG_SECURITY_VM.

v2 -> v3:
The "FIXUP" suffix is removed.

Tracked-On: #6320
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2021-08-26 09:24:50 +08:00
Kunhui-Li 30dd62e5d1 config_tools: update xml files
1. set the content of the bootargs tag to empty for KERNEL_ELF type
in hybrid xml files.
2. update generic_board.xml with the latest nuc11tnbi5.xml to fix
compile fail issue.

Tracked-On: #6461
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-26 08:52:07 +08:00
Yang,Yu-chu 2cc85f3d63 config-tools: Kernel load and entry address accept empty string
Allow the kern_load_addr and kern_entry_addr take empty string.

Tracked-On: #6461
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-08-25 10:43:19 +08:00
Yang,Yu-chu a141bfdf55 config-tools: refine log area start address allocation
Allocates the log area start address using the same size as native environment.

Tracked-On: #6320
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-08-23 14:55:11 +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
Kunhui-Li adcf51e5f5 config_tools: fix UI issue of creating new settings
1. as a workaround, comment the code to check MBA_DELAY tag when
creating a new scenario xml setting because of this tag are retrived
from scenario xml files in generic_board folder where it is removed
now.
2. update the template launch xml file names according the recent
update for launch xml files in generic folder.

Tracked-On: #6315
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-20 11:08:19 +08:00
Liang Yi 499f62e8bd hv: use per platform maximum physical address width
MAXIMUM_PA_WIDTH will be calculated from board information.

Tracked-On: #6357
Signed-off-by: Liang Yi <yi.liang@intel.com>
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-08-20 11:02:21 +08:00
Shiqing Gao 91777a83b5 config_tools: add a new entry MAX_EFI_MMAP_ENTRIES
It is used to specify the maximum number of EFI memmap entries.

On some platforms, like Tiger Lake, the number of EFI memmap entries
becomes 268 when the BIOS settings are changed.
The current value of MAX_EFI_MMAP_ENTRIES (256) defined in hypervisor
is not big enough to cover such cases.

As the number of EFI memmap entries depends on the platforms and the
BIOS settings, this patch introduces a new entry MAX_EFI_MMAP_ENTRIES
in configurations so that it can be adjusted for different cases.

Tracked-On: #6442

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2021-08-20 09:50:39 +08:00
Kunhui-Li bbc92361bc config_tools: update lpc slot number in script
Update lpc slot to origin value 1 from 31 in the script too,
because GOP driver has assumption to config space layout of
the device on 00:1f.0.

Tracked-On: #6340
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-20 08:07:43 +08:00
Kunhui-Li a860af24ba config_tools: rename python script
1. rename “cli.py” to “board_inspector.py”,
   and update the script name in README file.
2. rename “app.py” to “acrn_configurator.py”.

Tracked-On: #6417
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-20 07:58:23 +08:00
Kunhui-Li a73dd7b5f7 config_tools: disable TPM2 passthrough on other platforms
Disables TPM2 passthrough on other platforms except TGL
follow the 6410 PR.

Tracked-On: #6288
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-20 07:53:30 +08:00
Kunhui-Li f0a38692cf config_tools: fix the issue that fail to generate launch script
fix the issue that fail to generate launch script when to disable
CPU sharing.

Tracked-On: #6428
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-19 20:09:58 +08:00
Zhou, Wu 2e2730137f HV: Change hybrid.xml default zephyr config to KERNEL_ELF
In the default config file for hybrid scenario, zephyr image was
configured as KERNEL_RAWIMAGE. Now we change them to KERNEL_ELF
for all the platforms. And also kernel mods are changed from
Zephyr_RawImage to Zephyr_ElfImage

Tracked-On: #6323

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2021-08-19 20:00:45 +08:00
Yang,Yu-chu 73dc610d90 config-tool: refine guest kernel types
Rename KERNEL_ZEPHYR to KERNEL_RAWIMAGE. Added new type "KERNEL_ELF".

Add CONFIG_GUEST_KERNEL_RAWIMAGE, CONFIG_GUEST_KERNEL_ELF and/or
CONFIG_GUEST_KERNEL_BZIMAGE to config.h if it's configured.

Tracked-On: #6323

Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2021-08-19 20:00:45 +08:00
Kunhui-Li cf1f3ac51d config_tools: remove some tags check for scenario.xml in generic_board folder
remove some tags check for scenario xml files in generic_board folder when
importing a new type of board in UI, and minor fix for the warning of config
editor.

Tracked-On: #6315
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-19 15:41:34 +08:00
Junjie Mao 1dca1da96d 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-19 10:48:15 +08:00
Junjie Mao cd31310f65 FIXME: temporarily disable TPM2 passthrough
On some boards it is seen that the log area of the physical TPM2 is
programmed to be 0. If TPM2 is passed through to a pre-launched VM in such
cases, a piece of memory starting from GPA 0 will be unmapped from the
Service VM, leading to Service VM crash due to early BIOS corruption
checks.

This patch temporarily disables TPM2 passthrough on such platforms. A
thorough fix should be proposed later to gracefully handle such cases.

Tracked-On: #6288
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-08-18 13:08:29 +08:00
Yang,Yu-chu 668ae81048 config-tools: replace xml.etree.ElementTree with defusedxml.ElementTree
Using xml.etree.ElementTree to parse the untrusted data is known to
raise security issue. Replaced it using defusedxml.

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 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
Kunhui-Li 1d952cfba1 config_tools: update the board xml files
update the board xml and related scenario xml files because the
PR 6352 update the board inspector code to get more board info.

Tracked-On: #6298
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-13 11:14:54 +08:00
Yang,Yu-chu a4be0aa57b config-tools: add native log area address
Extract the log area address from TPM2 acpi table and add node
log_area_start_address to board.xml. This emelment is used by host_pa of
mmiodevs.

Tracked-On: #6320
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-08-13 11:09:01 +08:00
Junjie Mao 4c04857681 config_tools: fix formatting of configured INTx allocation
There could be multiple ways in the scenario configuration to specify that
no INTx allocation is explicitly allocation to a prelaunched VM:

  * Do not have a `pt_intx` node at all.

  * Have a `pt_intx` node with no text.

  * Have a `pt_intx` node with a text that has nothing but whitespaces,
    tabs and newlines.

The current implementation only supports the first way, and will cause
build-time failures when a scenario configuration uses the latter two. The
following changes are introduced by this patch to fix such errors.

  * The INTx static allocator queries the text() of `pt_intx` nodes
    directly to gracefully handle `pt_intx` nodes with no text.

  * The XSLT of pt_intx.c clears all kinds of white spaces from the text of
    `pt_intx` nodes before calculating the set of allocated INTx mappings.

Tracked-On: #6287
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-08-12 08:56:56 +08:00
David B. Kinder 2216134cf4 doc: update config data descriptions
Fix some formatting issues in PR #6378

Tracked-On: #6377

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-08-11 13:56:04 -07:00
Shiqing Gao de19301a5a config_tools: refine the configuration data description
This patch refines the configuration data description so that it is
consistent with the current implementation of the configuration tools.

Tracked-On: #6377

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2021-08-11 16:38:35 +08:00
Fei Li 3df703a64e config-tools: add SECURITY_VM_FIXUP config
Add SECURITY_VM_FIXUP config for Security VM whether it needs to do fixup
for TPM2 and SMBIOS

Tracked-On: #6320
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
2021-08-11 14:45:55 +08:00
Yang,Yu-chu d997f4bbc1 config-tools: refine bin_gen.py and create virtual TPM2 acpi table
Create virtual acpi table of tpm2 based on the raw data if the TPM2
device is presented and the passthrough tpm2 is enabled.

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-08-11 14:45:55 +08:00
Yang,Yu-chu 53d99d2a68 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-08-11 14:45:55 +08:00
Yang,Yu-chu cb736e4cc1 config-tools: allocate log area start address
If passthrough 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-08-11 14:45:55 +08:00
Yang,Yu-chu f3125e58ed 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-08-11 14:45:55 +08:00
Fei Li a705ff2dac 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-08-11 14:45:55 +08:00
Fei Li 74e68e39d1 hv: tpm2: do tpm2 fixup for security vm
ACRN used to prepare the vTPM2 ACPI Table for pre-launched VM at the build stage
using config tools. This is OK if the TPM2 ACPI Table never changes. However,
TPM2 ACPI Table may be changed in some conditions: change BIOS configuration or
update BIOS.

This patch do TPM2 fixup to update the vTPM2 ACPI Table and TPM2 MMIO resource
configuration according to the physical TPM2 ACPI Table.

Tracked-On: #6366
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
2021-08-11 14:45:55 +08:00
Fei Li f81b39225c HV: refine acrn_mmiodev data structure
1. add a name field to indicate what the MMIO Device is.
2. add two more MMIO resource to the acrn_mmiodev data structure.

Tracked-On: #6366
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
2021-08-11 14:45:55 +08:00
Kunhui-Li 54fe6f900b config_tools: update launch xml for only one NVME
Update launch xml to use image to launch hard rt vm since
we changed the platforms from two disk to only one NVME disk.

Tracked-On: #6315
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-11 11:49:17 +08:00
Kunhui-Li 158eb38280 config_tools: update lpc slot number
Update lpc slot to origin value 1 from 31 because GOP driver has assumption
to config space layout of the device on 00:1f.0.

Tracked-On: #6340
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-11 08:57:37 +08:00