Commit Graph

592 Commits

Author SHA1 Message Date
Yang,Yu-chu f3305b6373 config-tools: update the generic_code with xform output
Replace folllowing python generated files with xslt transform outputs
which are formatted using clang-format:

misc/config_tools/data/generic_board/generic_code/
├── hybrid
│   ├── ivshmem_cfg.h
│   ├── misc_cfg.h
│   ├── pt_intx.c
│   ├── vm_configurations.c
│   └── vm_configurations.h
├── hybrid_rt
│   ├── ivshmem_cfg.h
│   ├── misc_cfg.h
│   ├── pt_intx.c
│   ├── vm_configurations.c
│   └── vm_configurations.h
├── industry
│   ├── ivshmem_cfg.h
│   ├── misc_cfg.h
│   ├── pt_intx.c
│   ├── vm_configurations.c
│   └── vm_configurations.h
└── logical_partition
    ├── ivshmem_cfg.h
    ├── misc_cfg.h
    ├── pt_intx.c
    ├── vm_configurations.c
    └── vm_configurations.h

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 6d81112428 config-tools: refine ivshmem devices in pci_dev_c.py
Add comma to the last member of ivshmem pci devices.

If the last element ends without comma, the clang-format would attach
the brackets to the first and last lines.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 982b4c1e0e config-tools: add the misc_cfg.h.xsl
Add a xslt file "misc_cfg.h.xsl". This file is used to
generate misc_cfg.h which is used by hypervisor.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 4111ebb46a config-tools: add the ivshmem_cfg.h.xsl
Add a xslt file "ivshemem_cfg.h.xsl". This file is used to
generate ivshemem_cfg.h which is used by hypervisor.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu ec11789894 config-tools: add the pt_intx.c.xsl
Add a xslt file "pt_intx.c.xsl". This file is used to
generate pt_intx.c which is used by hypervisor.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu f8e1b1cd94 config-tools: add the vm_configurations.h.xsl
Add a xslt file "vm_configurations.h.xsl". This file is used to
generate vm_configurations.h which is used by hypervisor.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 615552fadf config-tools: add the vm_configurations.c.xsl
Add a xslt file "vm_configurations.c.xsl". This file is used to
generate vm_configurations.c which is used by hypervisor.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 1c84d88b4a config-tools: add pio static allocator
This file allocates the resource of pio base.
The available pio base is in ['0x3F8', '0x2F8', '0x3E8', '0x2E8'] and it
cannot be used by native device.

When any of sos legacy vuarts are enabled, assign a pio base to legancy
vuarts' base.

The allocator follows rules:
1. An SOS legacy vuart only support PIO vuart.
2. To assign a pio base for sos legacy vuart 0:
   - If the hv/DEBUG_OPTIONS/SERIAL_CONSOLE is one of
     [ttys0, ttys1, ttys2, ttys3] and it's a pio vuart in the native
     environment, the pio base of SOS legacy vuart 0 would be the same as
     native one.
   - If the hv/DEBUG_OPTIONS/SERIAL_CONSOLE is not one of
     [ttys0, ttys1, ttys2, ttys3], assigns a pio base to SOS legacy vuart 0
     from avilable pio base.
   - If the hv/DEBUG_OPTIONS/SERIAL_CONSOLE is not one of
     [ttys0, ttys1, ttys2, ttys3] but a pio vuart, will assigns a pio
     base to SOS legacy vuart 0 from avilable pio base and raise a
     warning to user.
3. To assign a pio base for sos legacy vuart 1:
   - Assigns a pio base to SOS legacy vuart 1 from avilable pio base.
   - If all the available pio bases list is empty (which means all are
     in used by native), it assigns one of the pio base to SOS legacy
     vuart 1 anyway, but raise a warning to user.
4. Assigned pio bases must be unique.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 26a2aed19d config-tools: add intx static allocator
Create an intx.py which is a static allocator to allocate the irq
resources. The available irq list is based on the native irqs which
are in range [0, 15] and are not used by native os.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 9c85d70057 config-tools: add cpu affinity static allocator
If a cpu_affinity node of SOS is not present in the scenario.xml,
assign the native cpus which are not assigned to pre-launched vm to
SOS vm.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 3ed36ff02a config-tools: refine append_node and add get_node
Refine the "append_node" which can add new node with an attribute and
return the appended node.

The method "get_node" finds the xpath value and return it if there is an
unique node exists, otherwise it returns None.
It is used to get an xpath element node or can determine the xpath existence.

The "get_text" is replaced with "get_node". The only get_text in
hv_ram.py is modified accordingly.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 81a867bc57 config-tools: add lib.xsl to config_tools/xforms
Add lib.xsl under config_tools/xforms.

This lib.xsl contains the variables and customized functions for
xslt transformation.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 3b9426e1e6 config-tools: add lib.py to static_allocators/lib
Create lib.py which contains the common methods that are shared by static
allocators under misc/config_tools/static_allocators.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 160431096f config-tools: add user-defined errors
Create a file which contains user-defined errors for config-tools.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 4d0880ebec config-tools: replace <guest_flag/> with <guest_flag>
<guest_flag/> may be treated as either empty string or null in xslt
transformation and xsd schema validation. Replace it with:

<guest_flag></guest_flag>

to avoid the undefined behavior.

The duplicate guest_flag are removed.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Shuang Zheng b96d23a68f config_tools: update IVSHMEM_SHM_SIZE part for HV_RAM_SIZE calculation
add 2 * max (IVSHMEM_SHM_SIZE, 2M) in HV_RAM_SIZE calculation to
avoid ram overflow caused by additional memory usage for shared
memory alignment.

Tracked-On: #5955

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2021-04-23 11:23:55 +08:00
Jiang, Yanting afd0b7e8db acrn-config: add adl-rvp xml
Add board xml and industry config xml for ADL-P.

Tracked-On: #5941
Signed-off-by: Jiang, Yanting <yanting.jiang@intel.com>
2021-04-23 09:08:06 +08:00
lirui34 702158dfad config-tools: change default industry kata vm id to 7
fail to create kata vm type in industry scenario due to
the default vm id value is 1. Meanwhile set the max user
vm to 7 in tgl-rvp industry xml.

Tracked-On: #5932
Signed-off-by: lirui34 <ruix.li@intel.com>
2021-04-20 10:28:11 +08:00
Shuang Zheng 4f4fd65a64 config_tools: remove audio passthru in launch xmls on ehl-crb-b
There is no audio device in the default ehl-crb-b.xml, so remove
passthru audio devices from launch xmls on ehl-crb-b.

Tracked-On: #5925

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2021-04-19 15:44:01 +08:00
Shuang Zheng b953a33bd8 config_tools: remove UOS_RAM_SIZE and SOS_RAM_SIZE in scenario config
remove UOS_RAM_SIZE and SOS_RAM_SIZE in scenario config since these
two config elements are useless.

Tracked-On: #5927
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2021-04-19 14:45:10 +08:00
Shuang Zheng fee0025db8 config_tools: update HV_RAM_SIZE calculation algorithm
update HV_RAM_SIZE calculation algorithm to 20MB + VM number*
16MB, which consists of text segment rodata(2MB), bss data(about
1MB), bss.ppt_pages(2.4MB), bss.ctx_tables(6MB), bss.vm_array(
3.2MB), bss.ivshmem_base(2MB+1.8MB for alignment) and
bss.post_uos_sworld_memory(16MB*post-launched VM number).

Tracked-On: #5927
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2021-04-19 14:45:10 +08:00
Yang,Yu-chu 0305640a5b config-tools: find the unused bdf based on first unused "dev"
Refine the logic of finding unused bdf for SOS ivshmem devices. First,
find the unused bdf based on if the "dev" is unused. Increase the "func"
for the next same type of emulated devices if the last assigned bdf
exists. Otherwise, start over looking for unused bdf based on "dev"
repeatedly.

Tracked-On: #5869
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-04-09 15:11:51 +08:00
li shuang be487c23a2 config-tools: modify sample launch scripts
delete pm para in sample launch scripts and update the comments

Tracked-On: #5736
Signed-off-by: li shuang <shuangx.li@intel.com>
2021-03-30 09:21:57 +08:00
Geoffroy Van Cutsem f007fc501a tools: do not build life_mngr by default
Do not build (or install) the ACRN life_mngr by default as this is
a User VM tool, not one to be used and run in the Service VM.

The component can still be built independantly by invoking
'make -C misc life_mngr' (components will be built and placed in
'misc/build/services/' by default).

Tracked-On: #5660
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-03-29 15:38:29 +08:00
Yang,Yu-chu 1d1a434a64 config-tools: loosen IVSHMEM_REGION restriction in schema
A scenario can enable multiple IVSHMEM_REGIONs, loosen the restriction
to extend multiple regions support.

Tracked-On: #5863
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-03-29 13:26:52 +08:00
Geoffroy Van Cutsem ac091bacba acrn_manager: create acrnctl configuration folder when starting
The creation of the acrn_manager ('acrnctl') configuration folder
is currently done when adding a new VM to the system. This leads to
an error (non-fatal) thrown on the terminal is calling, say 'list'
first without having added a VM yet. This patch moves the creation
of such folder as part of main() thereby ensuring it is created as
soon as the program starts.

Tracked-On: #4898
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-03-25 14:37:21 +08:00
Liang Yi 33ef656462 hv/mod-irq: use arch specific header files
Requires explicit arch path name in the include directive.

The config scripts was also updated to reflect this change.

Tracked-On: #5825
Signed-off-by: Peter Fang <peter.fang@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2021-03-24 11:38:14 +08:00
Shuang Zheng fceeb0b511 doc: update path for config editor and desc for some config items
update the path for config editor; update description of vm.name.

Tracked-On: #5644
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2021-03-23 13:52:49 -07:00
Shuang Zheng ae659e58ac config_tools: add passthru devices for logical partition scenario on ehl
add passthru devices for logical partition scenario on ehl.

Tracked-On: #5665

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2021-03-18 13:28:26 +08:00
Yang,Yu-chu fb4f8e4e56 config-tools: fix "is_tpm_passthru" always return "False"
"is_tpm_passthru" would always return "False" with the existing logic.

1. Replace "get_leaf_tag_map_bool" with "get_leaf_tag_map". Instead returning a dictrionary with boolean diction values, just get the string value.
2. Return "True" if any vm has enabled the passtrhough tpm with option "y".

Tracked-On: #5710
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-03-12 16:14:46 +08:00
Yang,Yu-chu 6880ca51e4 config-tools: replace "PTDEV_HI_MMIO_START" with "HI_MMIO_START"
"PTDEV_HI_MMIO_START" is removed by the commit
8d9f12f3b7.

Replace "PTDEV_HI_MMIO_START" with "HI_MMIO_START".

Tracked-On: #5693
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-03-12 09:49:07 +08:00
Geoffroy Van Cutsem ddc017a691 Makefile: enhance misc/Makefile for more intuitive usage
Enhance the 'misc/Makefile' to improve readability by grouping the
tools based on whether these are `services` or `debug_tools`
(following the folders they're in) and also create separate build
folders instead of putting *both* services and debug_tools in the
build/misc/debug_tools folder (default value).

Tracked-On: #5793
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-03-11 10:50:28 +08:00
Shuang Zheng 23a8c3b802 config_tools: disable AC
disable AC from scenario config to avoid WaaG boot hang stability
issue.

Tracked-On: #5818

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2021-03-11 09:45:36 +08:00
Shuang Zheng 84c3e76b83 config_tools: update sbl version of ehl-crb-b.xml
update sbl version of ehl-crb-b.xml.

Tracked-On: #5778

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2021-03-10 09:37:12 +08:00
Yang,Yu-chu c843d2bbc5 config-tools: Add "ENFORCE_TURNOFF_AC" capability to xml
Add the capability to disable or enable #AC for Split-locked Access
through <scenario>.xmls. This was implemented through Kconfig. Move this
configuration from Kconfig to xmls.

Tracked-On: #5798
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-03-05 11:54:37 +08:00
Shuang Zheng e3a8b09e62 config_tools: add psram config in launch config
add "--psram" in acrn dm arguments in launch scripts
when PSRAM_ENABLED=y and the VM is post-launched RTVM.

Tracked-On: #5649

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2021-03-03 16:15:52 +08:00
Junjie Mao 0edaaa880f Makefile: prefer RELEASE=y|n over RELEASE=0|1
For clarity, we now prefer y|n over 0|1 as the values of boolean options on
make command lines. This patch applies this preference to the Makefile of
the device model and tools, while RELEASE=0|1 is still supported for
backward compatibility.

Tracked-On: #5772
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-03-03 09:13:44 +08:00
Peter Fang d17fdb020a misc: life_mngr: allow only one active socket connection in SOS mode
Monitor the listening socket in SOS mode and close any additional
connections after a socket connection is established. This ensures no
more than one post-launched VM can establish a pm_vuart channel.

Tracked-On: #5736
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2021-03-01 14:21:43 +08:00
Yang,Yu-chu d4bf922bda config-tools: remove "vuart" poweroff channel from default xml
Remove the the vuart1(tty) and vuart1(pty) poweroff channel from default
non-windows uos launch script xmls.

Tracked-On: #5736
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-02-26 16:54:23 +08:00
Shuang Zheng 87013b70df config_tools: add sanity check for PSRAM and RDT
RDT_ENABLED and PSRAM_ENABLED should not by y simultaneously.

Tracked-On: #5649

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2021-02-26 16:48:18 +08:00
Yang,Yu-chu 50f135343a config-tools: ivshmem support to be shared by multiple vms
Loosen the restriction of IVSHMEM_REGION of xsd validation. An ivshmem
region can be shared by more than two vms.

Tracked-On: #5672
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-02-25 13:22:46 +08:00
Geoffroy Van Cutsem 03466c22f3 acrn-config: remove obsolete kernel parameters from APL configurations
Remove obsolete kernel (i915) parameters from the Apollo Lake (APL)
board configurations.

Tracked-On: #5236
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-02-25 13:22:25 +08:00
Yonghua Huang a747e04dab config-tool: refine software SRAM config of pre-RTVM
- Define 'PRE_RTVM_SW_SRAM_ENABLED' only if both
     prelaunch RTVM and Software SRAM are configured in
     current scenario.

   - Define 'PRE_RTVM_SW_SRAM_BASE_GPA' and
     'PRE_RTVM_SW_SRAM_END_GPA' only if
     'PRE_RTVM_SW_SRAM_ENABLED' is defined.

Tracked-On: #5649
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2021-02-25 09:35:31 +08:00
Shuang Zheng e14387bebf config_tools: update fusa_partition scenario
update fusa_partition scenario following requirements.

Tracked-On: #5665

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2021-02-24 14:28:23 +08:00
li shuang 7dd3c4eb3e config_tools: add PTCT configs
add PTCT table template on ehl-crb-b, update PTCT table template
on tgl-rvp, add SofwareSRAM in ehl-crb-b.xml

Tracked-On: #5649

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2021-02-24 09:27:42 +08:00
David B. Kinder ea9c713f28 doc: fix misspellings in config option doc
Some terms in the config option docs (Integer, Boolean) are being
flagged by one of our spell checking tools.  Let's make it happy.

Tracked-On: #5692

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-02-15 12:14:32 -08:00
David B. Kinder 0bd384d41b doc: fix all headings to use title case
While we hoped to make the headings consistent over time while doing
other edits, we should instead just make the squirrels happy and do them
all at once or they'll likely never be made consistent.

A python script was used to find the headings, and then a call to
https://pypi.org/project/titlecase to transform the title.  A visual
inspection was used to tweak a few unexpected resulting titles.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-02-13 12:37:49 -08:00
David B. Kinder 85f4d79883 doc: test for simple xsd edit
CI test for simple xsd edit

Tracked-On: #5692

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-02-09 08:07:10 -08:00
Shuang Zheng 50463d1b3f config_tools: change generic folder to generic_board folder in config
app

change generic folder to generic_board folder in config app according
to the reorg data folders and update the method to save xmls.

Tracked-On: #5723

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2021-02-09 13:26:51 +08:00
Shuang Zheng 300be9df8c config_tools: update zephyr entry point address on ehl-crb-b
update entry point address for pre-launched zephyr on ehl-crb-b;
update serial console to /dev/ttyS3 on ehl-crb-b.

Tracked-On: #5689

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2021-02-09 09:00:46 +08:00