Commit Graph

88 Commits

Author SHA1 Message Date
Yang,Yu-chu 2767eb0d29 acrn-config:refine the ivshmem for pre-launched vm
1. Discard the method to find unused vbar bases from system ram, find
unused mmio windows from 2G to 4G range.
2. Refine the ivshmem devices declaration.

Tracked-On: #5530
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2020-11-24 16:30:26 +08:00
Yang,Yu-chu 5bdc932d65 acrn-config: insert vbdf in hex format and vuart vbdf logic
Bug fix:
1. The bdf were inserted in decimal. Fix it with hexadecimal
format.
2. The vuart vbdf will only take the dev which no used bdf has
the same dev. For example: If 00:01.1 is in used but not 00:01.0,
vuart vbdf will skip 00:01.0 and look for 00:02.0, 00:03.0 and so on.

Tracked-On: #5482
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2020-11-09 08:54:01 +08:00
Yang,Yu-chu 3c86de8fb9 acrn-config: insert legacy vuart0 base by its enablement status
The legacy vuart0 of any VMs inserts its base address declaration
anyway without checking whether it's disabled or enabled, and the
com base is hardcoded no matter what is specified in xmls.

Pull the legacy vuart enablement status based on scenario xml.

This reverts commit a8fe9b906a

Tracked-On: #5470
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-09 08:53:36 +08:00
Shuang Zheng 0cd71f2cf2 acrn-config: remove PSRAM_PASSTHROUGH_PRE_RTVM and disable PSRAM config
remove PSRAM_PASSTHROUGH_PRE_RTVM config which is not used in
PSRAM config and disable psram config.

Tracked-On: #5418

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2020-11-04 10:34:59 +08:00
dongshen 9735718e1f acrn-config: specify kernel boot argument 'reboot=acpi' for pre-launched VMs
Add the 'reboot=acpi' kernel boot argument for pre-launched VMs

Add the code to sanity check if 'reboot=acpi' is specified in the
scenario files

If hardware reduced ACPI is detected, by default, Linux will set the reboot type to
use EFI for rebooting. "reboot=acpi" sets the reboot type to use ACPI for rebooting.

Tracked-On: #5411
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-11-04 10:33:31 +08:00
Yang,Yu-chu a8fe9b906a acrn-config: remove legacy vuart declaration
Improve the legacy vuart code. The legacy vuart insert the declaration
without checking if it's enabled. Refined the logic that if the legacy
is disabled, simply do not declare.

Tracked-On: #5425
Signed-off-by: Yang,Yu-chu <yu-chu,yang>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 4f79e691d0 acrn-config: pci vuart sanity check for scenario xmls
Check if the scenario xmls configure pci vuarts properly
Sanity check of scenario xml:
1. check the format of console and communication vuarts
2. legacy vuart0 and console vuart0 cannot be eabled at the same time
3. legacy vuart1 and communication vuart1 cannot be enabled at the
same time
4. Any vuart should not connect to any type of vuart0
5. Every vuart can only connect to enabled vuart<idx> (idx > 0)

Tracked-On: #5425
Signed-off-by: Yang,Yu-chu <yu-chu,yang>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 6b8ec62b52 acrn-config: insert vuart device information to pci_dev.c
- Find unused bdf for SOS and pre-launched VM's pci vuart if it's
enabled
- The vuart cannot detect the function difference, find the unused vbdf
based on "dev" increment

Tracked-On: #5425
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-02 08:52:52 +08:00
Yang,Yu-chu 2290396ef5 acrn-config: generate SOS ivshmem device information
Support enable ivshmem for SOS. Insert the ivshmem device information if
it is enabled.
1. get ivshmem vbar based:
  - vbar[0] is size 0x100
  - vbar[2] is specified MB size
2. get vbdf for ivshmem device

Tracked-On: #5426
Signed-off-by: Yang,Yu-chu <yu-chu,yang>
2020-10-30 20:24:28 +08:00
Yang, Yu-chu 0f16746c1e acrn-config: add sos pci_dev_num and pci_devs to vm_configurations.c
Add following to default output scenarios vm_configurations.c:
 - pci_dev_num
 - pci_devs = sos_pci_devs

Both was defineded in CONFIG_SOS_VM.

Tracked-On: #5426
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-10-30 20:24:28 +08:00
Yang, Yu-chu 8c78590da7 acrn-config: refactor pci_dev_c.py and insert vuart device information
- Refactor pci_dev_c.py to insert devices information per VMs
- Add function to get unused vbdf form bus:dev.func 00:00.0 to 00:1F.7

Add pci devices variables to vm_configurations.c
- To pass the pci vuart information form tool, add pci_dev_num and
pci_devs initialization by tool
- Change CONFIG_SOS_VM in hypervisor/include/arch/x86/vm_config.h to
compromise vm_configurations.c

Tracked-On: #5426
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-10-30 20:24:28 +08:00
Shuang Zheng faeef67c20 acrn-config: add PSRAM config in scenario setting
add CONFIG_PSRAM_ENABLED and CONFIG_PSRAM_PRE_RT_ENABLED config in
scenario setting and update Kconfig.

Tracked-On: #5418

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2020-10-30 18:39:59 +08:00
Shuang Zheng 788f28035d acrn-config: add PCI VUART config in scenario config UI
Add PCI VUART dynamic config for VMs in scenario config UI, keep legacy
VUART config. PCI vuart base can be set to INVALID_PCI_BASE and PCI_VUART;
users will configure the target_vm_id and target_vuart_id when PCI vuart
base is set to PCI_VUART; users can dynamically add or delete PCI vuart
for VMs.

Tracked-On: #5394

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2020-10-30 18:25:57 +08:00
Yang, Yu-chu d743aa9b42 acrn-config: Get vbar base and index for vmsix supported devices
Add functionality to get free vbar base for the vmsix devices.

- The devices size is 4k.
- The mmio range for non SOS VM is 2G to 4G
- The mmio range for SOS is depended on the range which is assigned to
PCI bus hostbridge
- The next vbar index is based on last device vbar index vbar_i

Tracked-On: #5422
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-10-29 09:45:30 +08:00
Shuang Zheng 9e39dac665 acrn-config: make ivshmem size configured in decimal and MB
make ivshmem size configured in decimal and MB in config tool
UI and XMLs to simplify input from users.

Tracked-On: #4853

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-09-24 18:38:51 +08:00
Shuang Zheng 4617762419 acrn-config: move the MACRO of IVSHMEM shared region name to ivshmem_cfg.h
The MACRO of IVSHMEM shared region name is relevant to scenario, move
the MACRO from pci_devices.h which should be consistent for different
scenarios to ivshmem_cfg.h which is the configuration for IVSHMEM and
could vary in sceanrios.

Tracked-On: #4853

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-09-22 09:28:24 +08:00
dongshen ef9a961523 acrn-config/hv: create new file pt_intx_c.py to generate the pt_intx.c file
Move struct pt_intx_config vm0_pt_intx[] defintion to pt_intx.c
so that vm_configurations.h/vm_configurations.c are consistent for different boards

Tracked-On: #5229
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-09-16 10:37:09 +08:00
dongshen 0f0d0c0d18 acrn-config: always generate P2SB_BAR_ADDR related boilerplate code in vm_configurations.c
so that vm_configurations.h/vm_configurations.c are consistent for different boards

The boilerplate code is protected by #ifdef P2SB_BAR_ADDR/#endif, so it will
not hurt if we always produce related code.

Define new macros P2SB_BAR_ADDR_GPA and P2SB_BAR_SIZE to make the code more flexible.

Tracked-On: #5229
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-09-16 10:37:09 +08:00
dongshen 14a3abcce0 acrn-config: always generate pt_tpm2 boilerplate code in vm_configurations.c
so that vm_configurations.h/vm_configurations.c are consistent for different boards

The boilerplate code is protected by #ifdef VM0_PASSTHROUGH_TPM/#endif, so it will
not hurt if we always produce related code.

Define a new macro VM0_TPM_BUFFER_BASE_ADDR_GPA to define the allocated gpa for VM0_TPM_BUFFER_BASE_ADDR
to make the code more flexible.

Tracked-On: #5229
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-09-16 10:37:09 +08:00
dongshen f438ab5a04 acrn-config: always generate .clos boilerplate code in vm_configurations.c
so that vm_configurations.h/vm_configurations.c are consistent for different boards

The boilerplate code is protected by #ifdef CONFIG_RDT_ENABLED/#endif, so it will
not hurt if we always produce the .clos code.

Tracked-On: #5229
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-09-16 10:37:09 +08:00
dongshen 9f43d200d6 acrn-config: define VMx_BOOT_ARGS macros in misc_cfg_h.py
so that vm_configurations.h/vm_configurations.c are consistent for different boards

Debugged and refactored the split_cmdline() function

Tracked-On: #5229
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-09-16 10:37:09 +08:00
dongshen 0e92ecf35d acrn-config: move VMx_CONFIG_PCI_DEV_NUM macro to misc_cfg_h.py
so that vm_configurations.h/vm_configurations.c are consistent for different boards

Tracked-On: #5229
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-09-16 10:37:09 +08:00
dongshen ba0e466618 acrn-config: move cpu affinity macro to misc_cfg_h.py
so that vm_configurations.h/vm_configurations.c are consistent for different boards

Tracked-On: #5229
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-09-16 10:37:09 +08:00
Shuang Zheng 70861b35b9 acrn-config: fix issue of acrn build failed on industry scenario when ivshmem configured
add extern acrn_vm_pci_dev_config variables in vm_configuration.c
when ivshmem configured on scenarios with ivshmem configured.

Tracked-On: #5298

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-09-14 15:26:06 +08:00
Shuang Zheng feb0772a53 acrn-config: enable TPM2 config on ehl-crb-b board
enable TPM2 config on ehl-crb-b board and update TPM2 configs on
legacy boards.

Tracked-On: #5266

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2020-09-09 09:52:21 +08:00
Shuang Zheng 061091a489 acrn-config: offline tool to generate ACPI tables for pre-launched VMs
use offline tool to generate one binary of ACPI tables for pre-launched
VMs, then load the ACPI binary into guest physical memory as grub module.
Users can configure the resources or devices like TPM2 for the
pre-launched VM from sceanrio XMLs or UI, and the offline tool will
generate ASL code of the ACPI tables with the configured resources or
devices, then compile the ASL code to one binary when building ACRN.

Tracked-On: #5266

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-09-08 19:52:25 +08:00
Shuang Zheng 28ba2c8940 acrn-config: update the size range of ivshmem memory region
update the size of ivshmem memory region to [2MB, 512MB].

Tracked-On: #4853

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Yuan Liu <yuan1.liu@intel.com>
2020-09-07 14:55:49 +08:00
dongshen 5c32fa610d acrn-config: expose GPIO chassis interrupt to safety VM as INTx
This patch is to expose GPIO chassis interrupts as INTx to safety VM for
EHL. User can configure this per-VM attribute in scenario xml using the
following format:
<pt_intx desc="pt intx mapping.">
  	(phys_gsi0, virt_gsi0), (phys_gsi1, virt_gsi1), (phys_gsiN, virt_gsiN)
 </pt_intx>

The physical and virtual interrupt gsi in each pair are separated by a
comma and enclosed in parentheses. If an integer begins with 0x or 0X,
it is hexadecimal, otherwise, it is assumed to be decimal. Example:
  <pt_intx desc="pt intx mapping.">
  	(1, 0), (0x3, 1), (0x4, 2), (5, 6), (89, 0x12)
  </pt_intx>

Tracked-On: #5241
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-09-01 09:35:50 +08:00
dongshen 01c66eb4b3 acrn-config: add support for P2SB bridge passthrough
This patch is to support direct assignment of P2SB bridge to one pre-launched
VM for EHL. User can configure this per-VM attribute in scenario xml:
    <mmio_resources desc="MMIO resources.">
         <p2sb>y</p2sb>
    </mmio_resources>

Set p2sb to y to passthru P2SB bridge to VM, and n otherwise.

Tracked-On: #5221
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-09-01 09:35:50 +08:00
dongshen 678d8c1665 acrn-config: fix build issue for mrb board
Add missing IVSHMEM tag in mrb board xml file to fix build issue

Correct misspelled function name

Use better error messages

Tracked-On: #5221
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-09-01 09:35:50 +08:00
Wei Liu 7eb103478a acrn-config: add MAX_CACHE_CLOS_NUM_ENTRIES/MAX_MBA_CLOS_NUM_ENTRIES macros
1.Add macro MAX_CACHE_CLOS_NUM_ENTRIES for CAT, and MAX_MBA_CLOS_NUM_ENTRIES for MBA.

 MAX_MBA_CLOS_NUM_ENTRIES:
  Max number of Cache Mask entries corresponding to each CLOS.
  This can vary if CDP is enabled vs disabled, as each CLOS entry will have corresponding
  cache mask values for Data and Code when CDP is enabled.

 MAX_CACHE_CLOS_NUM_ENTRIES:
  Max number of MBA delay entries corresponding to each CLOS.

2.Move VMx_VCPU_CLOS macro to misc_cfg.h head file.

Tracked-On: #5229
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-08-28 16:44:06 +08:00
Shuang Zheng e46c5ac350 acrn-config: support configuration for Inter-VM communication
This patch is to support the Inter-VM communication by IVSHMEM
in config tool.
Users can configure IVSHMEM_ENABLE to enable or disable Inter-VM
communication by IVSHMEM; users can configure the name, size,
communication VM IDs of the IVSHMEM devices in the VM settings of
scenario xmls, then config tool will generate the related IVSHMEM
configurations for Inter-VM communication.
The config tool will do sanity check including when saving the xmls:
the format of shared memory region configuration is
[name],[size],[VM ID]:[VM ID](:[VM ID]...);
the max size of the name is 32 bytes;
the names should not be duplicated;
the mininum value of shared memory region size is 2M;
the value of shared memory region is a power of 2;
the size of share memory region should not extended the size of
available ram.

Tracked-On: #4853

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-08-24 13:58:38 +08:00
Victor Sun 05a083c944 HV: comment SOS_VM as VMx in vm_configurations.h
Add a comment for SOS_VM to indicate its VM ID for better understanding;

Tracked-On: #5077

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-13 13:48:17 +08:00
Victor Sun 3cd5abe5ac acrn-config: add cpu_affinity for SOS VM
Add cpu_affinity setup for SOS VM. Cpu affinity must be set in
scenario XML, except if no pre-launched VM on the scenario and
all pCPUs will be assigned to SOS VM in that case;

Tracked-On: #5077
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2020-08-04 09:05:29 +08:00
Wei Liu cbb5dde7b3 acrn-config: add passthru TPM for whl-ipc-i5/i7
Add support to generate passthru TPM information for whl-ipc-i5/i7.

Tracked-On: #5077
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-07-28 10:46:27 +08:00
Wei Liu 74e51046f7 acrn-config: fix build issue for TGL/EHL
There is some macro defined in misc_cfg.h while CAT/MBA enabled.
include the missing header to solve build issue.

Tracked-On: #5092
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-07-28 10:46:27 +08:00
Wei Liu 6cafb9cf01 acrn-config: configuration source refactor for new layout
Now the hypervisor configuration source code layout is changed, so acrn-config
need to change accordingly to make sure XML based configuration build success;

Tracked-On: #5077
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-07-24 16:16:06 +08:00
Wei Liu 175b20770a acrn-config: add support Pre-launhced RT for acrn-config
1.Add UUID for Pre-launched RT VM.
2.Add hybrid_rt.xml for whl-ipc-i7/i5 and also add template Pre-Launched
RT sample xml.
3.Refine sanity check for load_kern_addr/entry.

Tracked-On: #5081
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-07-23 21:58:32 +08:00
Wei Liu 6e2f8e2a03 acrn-config: refine sanity check for RDT/MBA
Refine sanity check for RDT CLOS and MBA Delay.

Tracked-On: #4943
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
2020-07-06 13:48:12 +08:00
Vijay Dhanraj da2200167b acrn-config: Add missing MBA_delay configuration in scenario xml
This patch adds support to configure MBA delay values from
scenario xml files just as it is done for CAT mask. This will
improve user experience when configuring RDT resource mask
values.

Tracked-On: #4943
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-06-24 09:54:00 +08:00
Wei Liu 6ed2b855bf acrn-config: support to parse RDT information
1.Add parser and sanity check for RDT_ENABLED/CDP_ENABLED/CLOS_MASK.
2.Skip to generate RDT inforamtion when HW not support RDT or usr
select 'n' to disable RDT feature.
3.Add contiguous bit 1 check for CLOS_MASK.

Tracked-On: #4860
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-06-01 14:32:57 +08:00
Wei Liu fca8750ba6 acrn-config: generate console=ttyS0 for PRE Launched VM
Remove pre-launched VM console setting in scenario xml and leave it
configured in bootargs directly.

Tracked-On: #4808
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-05-20 13:51:31 +08:00
Wei Liu 65c0cc7362 acrn-config: remove rootfs item from PRE Launched VM
The bootarg of rootfs for pre-launched VM is for Linux only and it
should not limited to physical block device which is selectable from
native rootfs list, it might be a USB or RAM device that "X" is variable
in root=/dev/sdX or /dev/ramX. So remove the rootfs setting in XML and
leave it configured in kernel bootargs directly.
Given the SOS must be Linux and its rootfs must be a physical block
device, rootfs item tag is still reserved in xml for SOS VM section.

Tracked-On: #4808
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-05-20 13:51:31 +08:00
Wei Liu 39ab45f06b acrn-config: generate pci_dev.c file for logical partition
With current acrn-config code, there would be no pci_dev.c generated
if no PCI devices were selected. This would cause a bug for logical_partition
scenario because of an old pci_dev.c is already in the folder and involved
for compiling. The configure tool should override the pci_dev.c, in this case,
to avoid building error.

Tracked-On: #4813
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-05-20 13:36:03 +08:00
Wei Liu 8b736cc131 acrn-config: generate correct IRQ for VUART1
As VUART is not supported PCI VUART, use native PCI ttySn's IRQ for
VUART1 would cause communication failed, allocate a free IRQ for it.

Tracked-On: #4798
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-05-15 13:25:09 +08:00
Wei Liu 843579adf1 acrn-config: remove 'idle=halt' from sos bootargs
Remove "idle=halt" from SOS boot args since the param could be handled
automatically by acrn-config according to CPU scheduler setting.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-05-15 13:25:09 +08:00
Zide Chen 0629c5c8c2 hv/acrn-config: changed name from cpu_affinity_bitmap to cpu_affinity
Tracked-On: #4616
Signed-off-by: Zide Chen <zide.chen@intel.com>
2020-05-08 11:04:31 +08:00
Wei Liu db14c2f89f acrn-config: parse KATA VM count number with vm_type 'KATA_VM'
Parse KATA VM count number from scenario config with vm_type 'KATA_VM'
and Remove MAX_KATA_VM_NUM from scenario config xmls.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-05-06 11:25:57 +08:00
Wei Liu c8eda07323 acrn-config: refinement for CPU affinity check
Refine CPU affinity sanity check for both scenario and launch config
xmls.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-04-29 09:52:37 +08:00
Wei Liu a43b42b2a0 acrn-config: parse cpu_affinity from launch config xmls
Parse cpu_affinity from launch config xmls and generate '--cpu_affinity' as
acrn-dm args.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2020-04-24 16:19:55 +08:00