Commit Graph

225 Commits

Author SHA1 Message Date
Wei Liu 197e4a0620 acrn-config: add support to parse 'severity' item tag
Add support to parse 'severity' item tag from webUI and set them into
scenario configurations.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-23 15:15:09 +08:00
Wei Liu ca2855f230 acrn-config: add severity setting to scenario config xml
To keep align hypervisor source code for scenario config, need add
the 'severity' item tag into scenario config files.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-23 15:15:09 +08:00
Wei Liu fcb85a806d acrn-config: remove pcpu3 from vm1 in SDC scenario
Currently kata vm is supported in SDC scenario by default, both vm1
and kata vm would share pcpu id 3 for vcpu affinity even when cpu
sharing is not enabled.
Remove pcpu id 3 from vm1 in SDC scenario config xmls.

Tracked-On: #4286
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-23 10:15:06 +08:00
Deb Taylor ba5099e69f Doc: Content edits to the acrntrace README file.
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-12-16 16:25:15 -05:00
Wei Liu 98b3dd9426 acrn-config: set HV_RAM_START above 256M for new board
Hv could be failed when hv ram start address when around 16, beacause when
booting from grub mode, hv and sos ram address would be overlaped.
This patch set the HV_RAM_START address above 256M for new board.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 13:48:14 +08:00
Wei Liu 464639e8d3 acrn-config: add 'ramdisk_mod' item tag for tgl-rvp
Add missing 'ramdisk_mod' item tag of industry config xml for tgl-rvp.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 13:48:14 +08:00
Wei Liu 13d6b69d65 acrn-config: set DRHDx_IGNORE while no DEV_SCOPE in DRHD
Set the DRHDx_IGNORE to false even there is no DEV_SCOPE under this
DRHD.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 13:48:14 +08:00
Wei Liu 12a9bc29df acrn-config: add CONFIG_SERIAL_x for new board
Add CONFIG_SERIAL_x in $(borad).config, this will help to output
console log and help new board debug.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 13:48:14 +08:00
Wei Liu d699347e7b acrn-config: change gvt_args from selectbox to editbox
1. Some VMs don't need pci-gvt args or or need specific configuration
for 'gvt_args' item tag, this patch changes from selectable behavior to
editable for 'gvt_args' item from webUI.

2. Modify the description for gvt_args item tag from launch config xmls.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 13:48:14 +08:00
Vijay Dhanraj 1636ac0416 acrn-config: Add non-contiguous HPA to currently supported hardware.
For currently supported hardware such as KNL NUC, the scenario xml
file is not generated and the newly added non-contiguous variables
will not be present. This can lead to build issues. This patch adds
the second non-contiguous HPA variable to all supported hardware
for both logical_partition and hybrid modes. It also adds checks
to ensure that HPA2 is valid before using it while creating the
guest VM ve820.

Tracked-On: #4242
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 10:13:27 +08:00
Victor Sun 0ba8434838 acrn-config: rename CONFIG_MAX_PCPU_NUM to MAX_PCPU_NUM
The macro definition is changed in hypervisor code, so modify acrn-config
side accordingly.

Tracked-On: #4230

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-12-12 13:49:28 +08:00
Wei Liu 67b416d523 acrn-config: hide non-legacy serial port as SOS console
SOS vm only support legacy serial port emulation, so we need to
hide non-legacy serial ports from webUI when user want to select
serial port as SOS console.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 10:46:02 +08:00
Wei Liu deb5ed1f76 acrn-config: unify get_vuart_info_id api in config tool
1. unify get_vuart_info_id/get_vuart_id api in board/scenario/launch
config tool.
2. if vm use 'vuart1(tty)' method to power off, make sure this vm have
select the vuart1 'SOS_COM2_BASE'.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 10:46:02 +08:00
Wei Liu 212d030b9a acrn-config: add 'poweroff_channel' support for launch config
Add pm_channel support to parse and get 'poweroff_channel' item value
from launch config files, these values are selectable by user.

Tracked-On: #4212
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 10:46:02 +08:00
Wei Liu 7446d41f20 acrn-config: modify 'poweroff_channel' info in launch xmls
Some vm need power off method, so modify 'poweroff_channel'
item in the launch config files that user could select them from webUI.

Tracked-On: #4212
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 10:46:02 +08:00
Wei Liu 0f19f87891 acrn-config: add 'virtio-console' info in launch xmls
1. Some vm need mediator of 'virtio-console', so add 'console' item
into 'virtio_devices' leaf that user could edit them from webUI.

2. Add 'vuart0' item to enable/disable serial console emulation by
device model.

Tracked-On: #4186
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 10:46:02 +08:00
Wei Liu bad3c53c1e acrn-config: add 'virtio-console' mediator support for launch config
Add virtio-console mediator support to parse and get 'virtio-console' item value
from launch config files, these values are editable by user.

Tracked-On: #4186
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 10:46:02 +08:00
Vijay Dhanraj 68ea2cc62e acrn-config: Fix ve820 table generation when guest memory size is >512MB
This patch fixes an issue with generation of guest ve820 when the size
of the memory is >512MB. The issue is primarily with respect to converting
between hex and int.

Tracked-On: #4219
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 09:10:30 +08:00
Vijay Dhanraj 9729fe07fd acrn-config: support non-contiguous HPA for hybrid scenario
The patch adds acrn-config tool support for adding
non-continguous HPA allocations for pre-launched VMs
in hybrid scenario.

Tracked-On: #4217
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-11 10:12:46 +08:00
Kaige Fu 0bf03b411e acrntrace: Set FLAG_CLEAR_BUF by default
Normally, we care more about the current trace data than
buffered old data. So, this patch set FLAG_CLEAR_BUF by
default and adds one new option '-r' to unset the FLAG_CLEAR_BUF
if we want to capture the buffered old data.

---
  v1 -> v2:
  Add 'deprecated' mark to '-c' option

Tracked-On: #4175
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-10 15:11:12 +08:00
Kaige Fu 9e9e1f61ad acrntrace: Add opt to specify the cpus where we should capture the data
This patch adds one new option '-a' to specify the cpus where we should
capture the trace data. If the this option is not set or set with wrong
optarg, we will capture the trace data of all possible cpus.

The set of the cpus can be specified as A,B,C, or A-C, or A,D-F, and so on.

Tracked-On: #4175
Acked-by: Yan, Like <like.yan@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-10 15:11:12 +08:00
Kaige Fu 366f4be454 acrntrace: Use correct format for total run time
It is better to output it using float instead of int. Otherwise, we will
get '0 sec' for total run time if it is less than one second.

Tracked-On: #4175
Acked-by: Yan, Like <like.yan@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-10 15:11:12 +08:00
Kaige Fu 1e192f05d7 acrntrace: break when finding the matching key
The key in the list is unique. So, it is better to break the loop
when find the matching key instead of traversing the whole list.

Tracked-On: #4175
Acked-by: Yan, Like <like.yan@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-10 15:11:12 +08:00
Kaige Fu 9655b9de15 acrntrace: Fix the incorrect total vmexit cnt issue
Originally, we assume that the vmenter will sit at the first line
of the trace file. But if the vmexit comes earlier than vmenter.
The total vmexit cnt will be set as 0 by the first vmenter.

This patch fixes the issue by:
   - Search the trace file to find the first vmexit entry and start to analyze here
     and mark the TSC_BEGIN as the tsc of this vmexit.
   - Inc the total vmexit cnt by 1 when meet the vmexit entry.
   - Calc the vmexit duration when meet the vmenter in pair with the last vmexit.

Tracked-On: #4175
Acked-by: Yan, Like <like.yan@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-10 15:11:12 +08:00
Shuang Zheng 1115c0c6af acrn-config: UI supports to edit multiple virtio input devices.
This is to make acrn config UI supports to edit more than one virtio
input devices in multi-lines.

Tracked-On: #4163
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2019-12-10 13:45:22 +08:00
Conghui Chen 557e7f19f7 Makefile: add gcc flags to prevent some optimization
Add the below flags, they are needed in -O2:

-fno-delete-null-pointer-checks:
    * tells the compiler NOT to assume that null pointer deference does
    not exist.

    * Without this flag, below case cannot be detected:
    a pointer might point to nullsometime during run-time and if there
    is no validation for that pointer, it will cause the program to crash.
    Since we don’t receive an error message saying that a pointer is
    pointing to null, we will have a hard time trying to find the problem.

-fwrapv:
    * tells the compiler that signed overflow always wraps.

    * Without this flag, x + 10 > x will always be true for signed x.
     With the flag, x + 10 > x is not always be true, as the overflow is
     defined for x, and it could wrap.

Tracked-On: #4194
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
2019-12-10 10:02:15 +08:00
Vijay Dhanraj 706dbc0e00 acrn-config: support non-contiguous HPA for pre-launched VM
This patch modifies the python scripts in scenario,
board and vm-configuration to support,
	1. Generation of seperate ve820 for each VM.
	2. Ability to configure each VM's HPA from
	   acrn-config UI tool.
	3. Non-contiguous HPAs for pre-launched VMs.

Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Tracked-On: #4195
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-12-09 11:28:38 +08:00
Vijay Dhanraj 9b44e57d27 acrn-config: Fix target xml generation issue when no
P-state scaling driver is present

There seems to be a corner case where target xml file
fails to get generated if there was no P-state scaling driver
or C-state idle driver present. This patch addresses it by
handling the file not present exception and setting a warning
as well a "not available" string to successfully generate
target xml file.

Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Tracked-On: #4199
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-09 11:28:11 +08:00
Minggui Cao 65a553205a acrn-config: add xml to support TGL RVP board
1. Use acrn-configure tool to generate xml files to support TGL
RVP board. You need make menuconfig as guide in github, and then
comiple as following:
  make hypervisor BOARD_FILE=path/xxx.xml SCENARIO_FILE=path/yyy.xml

2. Also uos launch script can be generated by acrn-configure tool with the
uos luanch xml file

Tracked-On: #4181
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-09 11:25:51 +08:00
Sainath Grandhi 1fe1afd4c6 acrn-config: Add ramdisk tag parsing support
Pre-launched or SOS VMs could use ramdisks to boot. This
patch adds acrn-config tool support to parse such use-case
scenario xmls.

Tracked-On: #4197
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-06 14:02:03 +08:00
Sainath Grandhi 2b9fa85647 acrn-config: Add ramdisk tag to supported board/scenario xmls
This patch adds ramdisk_mod tag to all supported boards and
logical partition, hybrid, industry and sdc xmls

Tracked-On: #4197
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-06 14:02:03 +08:00
Shuang Zheng 5eb8040284 acrn-config: update UI to support virtio devices
Add multi device editing UI for Virtio-net and virtio-blk devices.

Tracked-On: #4185
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2019-12-04 16:52:40 +08:00
Wei Liu 5309e41528 acrn-config: modify the description of usb xhci
modify the description of usb xhci about the input format.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-04 16:52:40 +08:00
Wei Liu 7838b53763 acrn-config: add virtio-net mediator support for launch config
Add virtio-net mediator support to parse and get 'virtio-network' item value
from launch config files, these values are editable by user.

Tracked-On: #4185
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-04 16:52:40 +08:00
Wei Liu 25b2a26e34 acrn-config: add 'virtio-network' info in launch xmls
Some vm need mediator of 'virtio-net', so add 'virtio-network'
item into the launch config files that user could edit them from webUI.

Tracked-On: #4185
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-04 16:52:40 +08:00
Wei Liu 8464419af3 acrn-config: add virtio-block support for launch config
Add virtio-block support to parse and get 'block' item value
from launch config files, these values are editable by user.

Tracked-On: #4172
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-04 16:52:40 +08:00
Wei Liu 40140281ae acrn-config: add rootfs_dev/rootfs_img with virtio-blk item
remov rootfs_dev and rootfs_img item and replace them with vritio-blk
item.

The format for virtio-blk:
[blk partition:][img path] e.g.: /dev/sda3:./a/b.img

For vbootloader of ovmf: [img path] e.g.:./a/b.img

Tracked-On: #4172
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-04 16:52:40 +08:00
Kaige Fu aedd2c70e7 acrntrace: parse leaf and subleaf of cpuid
We have changed the cpuid trace-entry in HV to trace
the leaf and subleaf of cpuid. This patch modifies the
format accordingly.

Tracked-On: #4175
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-03 16:34:14 +08:00
Sainath Grandhi 77039f2911 acrn-config: Extend ve820 generation script for sizes gt 512 MB
Current ve820 generation script assumes the size of pre-launched
VM memory is less than or equal to 512 MB (Must be the assumption
of logical partition scenario as such).
This patch extends the script to handle pre-launched VM memory
sizes greater than 512 MB.

Tracked-On: #4182
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-03 14:42:55 +08:00
Wei Liu 80a7281f1e acrn-config: add MMCFG_BASE_INFO item in board config
Parse MMCFG base address value and store it to board config xml
as DEFAULT_PCI_MMCFG_BASE macro.

Tracked-On: #4173
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-02 16:19:55 +08:00
Wei Liu 0e273e996c acrn-config: get default pci mmcfg base address
parse default pci mmcfg base address from target board.

Tracked-On: #4173
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-02 16:19:55 +08:00
Wei Liu 12a3ec8aa1 acrn-config: remove redundant get_leaf_tag_map in launch config lib
The function of get_leaf_tag_map(info_file, prime_item, item='') in
launch_config_lib.py is redundant and it will be called incorrectly
when generating the launch script. This patch remove the function.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2019-11-29 16:28:27 +08:00
Wei Liu 2c2ccfc52c acrn-config: support OVMF vbootloader only
In current implementation, we only support OVMF as vbootloader, so
set vbootloader attributes to readonly in related XMLs to avoid issues.

Tracked-On: #3854

Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 13:36:27 +08:00
Wei Liu 38a647c8a5 acrn-config: correct epc_section base/size value
Current epc_section base/size vaule missed vm id so the configure item is not
working, the patch will fix this issue.

Tracked-On: #4165
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 13:36:27 +08:00
Wei Liu 91330eaa72 acrn-config: add usb xhci mediator support for
launch config

Add USB xHCI mediator support to parse and get 'usb_xhci' item value
from launch config files, these values are editable by user.

Tracked-On: #4164
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 13:36:27 +08:00
Wei Liu 420b65a61e acrn-config: add 'usb_xhci' info to launch xmls
Some vm need USB xHCI mediator support, this patch add 'usb_xhci' item
to the launch config files that user can edit it from webUI.

Tracked-On: #4164
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 13:36:27 +08:00
Wei Liu bc9b6d1b0c acrn-config: add virtio-input support for launch
config

Add support to parse and get 'virtio-input' item value from launch config
files, these values are editable by user.

Tracked-On: #4163
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 13:36:27 +08:00
Wei Liu 9fc32043aa acrn-config: add 'virtio-input' info in launch xmls
Some vm need mediator of 'virtio-input', so add 'virtio-input' item
into the launch config files that user could edit them from webUI.

Tracked-On: #4163
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 13:36:27 +08:00
Wei Liu 71c51a8f6f acrn-config: refinement for library config
Some API calls have the same function in library config,
the patch refines the API calls.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 13:36:27 +08:00
Wei Liu 1e2333647e acrn-config: skip the DRHDn_IGNORE when no device scope
Skip to generate DRHDn_IGNORE to board.c, when there is no device scope
type on target platform DRHD definition.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu 40929efe4b acrn-config: walk secondary PCI Bus for target board
There may be more than one PCI segment in target board, and DRHD info
should be parsed correctly base on secondary PCI bus. currently
board_parser.py tool did not handle such case.
Add this patch for walking secondary PCI Bus.

Tracked-On: #4143
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu 5e9234203a acrn-config: refinement for DmarDevScope struct
Refine the DmarDevScope struct and some class names.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu f6e6ec4ca2 acrn-config: modify SDC config xml to support kata vm config in webUI
Support to config kata vm in webUI, this need to modify 'configurable' attribute
to '1' in vm item.

Tracked-On: 4145
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Shuang Zheng bb2218effc acrn-config: add UI to add or remove Kata VM for sdc scenario
add UI to add or remove Kata VM for sdc scenario, the added Kata VM
is based on the generic config xml.

Tracked-On: 4145
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu 31d023e8f9 acrn-config: launch refinement on vcpu affinity and uos image
1. The vcpus of UOS are configured in vm configuration, they should be offlined from
sos before vm start.
2. retry offline cpu for all UOS type.
3. uos image name will be based on vm name instead of input parameter.
4. correct the unexpected token ';;' in launch config.

Tracked-On: #4145
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu d581473c82 acrn-config: refine vcpu affinity/number for SDC scenario
For SDC scenario, support kata vm would be triggered from webUI, and
will store the kata vm information to the scenario config file.
Then, vcpu affinity/number should be refined for vm1 and kata vm.

Note: with this patch, user should add/remove the kata vm in SDC
scenario webUI and its number should match MAX_KATA_VM_NUM in
hypervisor/arch/x86/Kconfig.

Tracked-On: #4145
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu d44440f734 acrn-config: print warning if MMIO BAR size above 4G
Currently MMIO BAR size not support size above 4G,
print warning to user to set the MMIO size in 4G region from BIOS.

Target-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu dc2d6b6656 acrn-config: modify the git commit message for gen_patch
Minor changes on git commit message of config patch:
For board config patch, specify with "config patch for board xxx";
For scenario config patch, specify with "config patch for scenario yyy".

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Geoffroy Van Cutsem 51a43dab79 hv: add Kconfig parameter to define the Service VM EFI bootloader
Add a Kconfig parameter called UEFI_OS_LOADER_NAME to hold the Service VM EFI
bootloader to be run by the ACRN hypervisor. A new string manipulation function
to convert from (char *) to (CHAR16 *) has been added to facilitate the
implementation.

The default value is set to systemd-boot (bootloaderx64.efi)

Tracked-On: #2793
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-11-27 10:38:49 +08:00
Wei Liu b332bf84b8 acrn-config: enhance the board config that has no serial port
There may be no physical serial port in the target board, and it will
stop generating board file, the patch add support to handle such case.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-20 10:01:24 +08:00
Wei Liu 658dccfbe3 acrn-config: set S3/S5 to default value while BIOS not support them
If S3/S5 are not support by BIOS in some platform, will set them to 0
as default.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-20 10:01:24 +08:00
Wei Liu 037e7a4a2c acrn-config: modify the key of vuart base
Return correct key of vuart base to webUI for parsing.

Tracked-On: #4128
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-20 10:01:24 +08:00
Victor Sun 0d52f933da Makefile: move .mk file to hv scripts folder
The *.mk files under misc/acrn-config/library are all rules for hypervisor
makefiles only, so move these files to hypervisor/scripts/makefile/ folder.

The folder of acrn-config/library/ will be used to store python script lib only.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Terry Zou <terry.zou@intel.com>
2019-11-13 16:05:30 +08:00
Wei Liu cdd086a81d acrn-config: by-pass acpi_idle/acpi_cpufreq for parsing target board
Current board parse logic would be broken if acpi_idle/acpi-cpufreq
driver is not loaded by native kernel.
This patch would just leave a warning to user and continue to parse
other information in this case.

Tracked-On: #4082
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-12 22:03:50 +08:00
Wei Liu 631c461314 acrn-config: Cx desc parsing enhancement
Previous code parse the Cx value by hardcoded position in sysfs desc
node, but this might be changed in different kernel.

This patch will parse the Cx value position by index key word like
MWAIT/IOPORT.

Tracked-On: #4074
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-12 22:03:50 +08:00
Wei Liu d9cb750ed9 acrn-config: alloc vuart1 irq when pttyS1 not exist only
If pttyS1 do not exist, we can alloc irq for vuart1, but if pttyS1
exist, we should reuse the irq of pttyS1 to keep compliance.

Tracked-On: #4073
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-12 22:03:50 +08:00
Victor Sun 0011607a16 Makefile: refine include path for efi_stub
Move hypervisor related include path from CFLAGS to INCLUDE_PATH to make
structure more clean.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-12 10:51:04 +08:00
Victor Sun 9a3cc8f748 makefile: cover menuconfig way to configure board/scenario
We now have four methods to configure board and scenario when
build acrn (sorted with priority):
1. Change them with "make menuconfig" in hypervisor directory
2. Give baord_file/scenario_file as make command parameters
3. Give BOARD/SCENARIO as make command parameters
4. Use BOARD/SCENARIO default value defined in Makefile file

With this patch, we make sure we follow priority exactly.

Tracked-On: #4067

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-11 15:01:50 +08:00
Victor Sun ed8fb94778 Makefile: support make from XML for new board
Currently make hypervisor will depend on a $(BOARD).config file to load
board defconfig which triggered by oldconfig process, this will block
make from XMLs for a new board because $(BOARD).config never exist.
This requires us to patch configuration for new board earlier than make
oldconfig.

Tracked-On: #4067
Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-11 15:01:50 +08:00
Wei Liu 05bb56291b acrn-config: include msr.h in board.c
without the msr.h file the build will be failed when CAT is enabled.

Tracked-On: #4066
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:44:03 +08:00
Wei Liu 5cc2c0dca5 acrn-config: chose ttyS1 for vuart1
For vuart1, if it's mapped to a real native serial port, we must
re-use the native serial port io base and irq number. If no native
serial port is mapped to vuart1, non-exist io base and irq should
be used.

Please note: UOS launch script may need be updated according to
which serial port index is used by vuart1.

Now, we are using ttyS1 of SOS for vuart1 in our release. User may
need to remap vuart to different ttySx by following above rule if
ttyS1 in user platform is used by other devices like Bluetooth/Wifi.

Tracked-On: #4016
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-On: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 485529415e acrn-config: add 'xhci' usb mediator for laag and waag
Enable xhci usb mediator for whl-ipc-i5/whl-ipc-7 and KBL NUC for LaaG
and WaaG.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 572abc70d7 acrn-config: add serial config in new $(board).config
Enhance the $(board).config for new board.
Serial config should be set in $(board).config for new board.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu c3495c6839 acrn-config: refine mem_size_set function
mem_size should be set from xml, it should not be overrided dynamically.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 61926d2b11 acrn-config: refine interrupt_storm function
interrupt_storm should be enabled while passthrough device was set.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 83797610da acrn-config: add support to generate launch script
Add support to generate launch script for whl-ipc-i5/whl-ipc-i7.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 9c8059499a acrn-config: remove runC script from unnecessary launch script
1. run_cotainer is linux type uos, remove related runC script from
unnercessary luanch script.

Tracked-On: #3930
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 2fcbd5c3f5 acrn-config: add config files for whl-ipc-i7 board
Add board/scenario/launch config files for whl-ipc-i7.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 28c1d001b5 acrn-config: add config files for whl-ipc-i5 board
Add board/scenario/launch config files for whl-ipc-i5.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu b9c77e008d acrn-config: 'keep_gsi' flag set for Android vm
keep_gsi is needed as a workaround for the device that support both
MSI and legacy interrupt, so keep the flag for Android only because
it is not sure for some wifi/audio device on other Linux guest.

Tracked-On: #3956
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 11:08:21 +08:00
Wei Liu 7b0cafa84f acrn-config: generate dmar info for board.c
1. Parse DRHD_INFO section from board config xml, and generate dmar
structure information to board.c
2. Copy macro of DRHD_INFO from board config xml to $(board)_acpi_platform.h

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu ad9f424ce5 acrn-config: generate proper msr_index value for CLOS
Since msr_index relys on the MSR_IA32_L2_QOS_MASKn(n:max to 3)
macro which defined in hv source code, generate array that CLOS number
more than 4 means need define more than 4 macro.
This patch solve such issue by using MSR_IA32_L2/L3_MASK_BASE with the
msr index offset.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu 6d9ff40183 acrn-config: update DRHD_INFO section for board xml
The DRHD_INFO section should be updated with the refinement patches for
parsing DMAR table.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu 4658259be7 acrn-config: refine DRHD structure initialization
1. Initialize DRHDn_DEVSCOPEn_TYPE/DRHDn_DEVSCOPEn_ID for each devscope;
2. Remove DRHDn_IOAPIC_ID macro;
2. Refine the value format from base 10 to 16.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu 8fcfea1386 acrn-config: refinement for parsing DMAR table
Previous DRHD and device scope number are hard coded to 4, this patch removes
the limitation and parse the real drhd count/devscope count dynamically.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu f10c937b40 acrn-config: correct value of DRHDx_IGNORE macro
The DRHDx_IGNORE should be defined to true when DRHD device BDF equal to
the given CONFIG_GPU_SBDF.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Li Fei1 af886fee8c efi-stub: reserve unconfigure high memory
Now ACRN support more and more platforms. However, the default configuration only
support board which memory is less than 16 GB. If a board memory is large than
16 GB, the developer needs to configure the memory configuration according to his
board. Otherwise, the boot will fail. This's because UEFI BIOS will use the high
memory as possible.
This patch try to allocate the memory as eraly as possible. So that the BIOS will
not access this region.

Tracked-On: #4007
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-11-07 08:47:02 +08:00
wenlingz c8fa8e15f8 Modify KBL-NUC/SDC for default build
Tracked-On: #3968
Signed-off-by: wenlingz <wenling.zhang@intel.com>
2019-11-01 09:06:45 +08:00
Wei Liu 85b362fbeb acrn-config: modify vxworks uos id for industry launch config
As vm3 for industry scenario was removed from scenario config, so
modify the uos id to proper id.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-29 08:38:25 +08:00
Wei Liu 941d5ad308 acrn-config: parse rootfs_img and refine virtio-blk
1. Parse item of 'rootfs_img' from launch config xml.
2. Refine virtio-blk device for launch config.

Tracked-On: #3931
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2019-10-29 08:38:25 +08:00
Wei Liu 8cd7c34580 acrn-config: modify board name to uos name
We should use launch_$(uos type) for launch function name instead of using
launch_$(board name).

Tracked-On: #3931
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-29 08:38:25 +08:00
Wei Liu 812d8af65a acrn-config: add mem_size for launch vm
add mem_size parameter for acrn-dm while generating launch script.

Traked-On: #3932
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-29 08:38:25 +08:00
Wei Liu f46d8a9669 acrn-config: add the '"' character for launch script
1. Add the character of quotation marks for launch vm script.
2. Audio codec should put together with audio devcie and pass to
 vm , otherwise report an error message to webUI.

Tracked-On: #3937
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-29 08:38:25 +08:00
Victor Sun 6f7081f620 acrn-config: remove vm3 for industry scenario
The VM2 of INDUSTRY scenario need 2 vCPUs for performance, so there would
be no available pCPU for VM3, need to remove VM3 for this scenario.

Tracked-On: #3925

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-10-25 15:17:40 +08:00
Wei Liu feba836944 acrn-config: refine ttyS info of board file
The previous method to handle ttyS info has an assumption that PCI
serial devices are all mmio type, this caused incorrect BDF info in
board XML file.
This patch fix this issue by dropping serial device BDF info and
replace it with IO type.

Tracked-On: #3900
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-25 10:56:23 +08:00
Wei Liu b6a8052045 acrn-config: filter out the proper wifi/ethernet device
Filter out the wifi/ethernet device from webUI with below PCI device class coding rule:
ethernet: 0200/0280;
wifi: 0280/0d20/0d21/0d80;

Tracked-On: #3917
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-25 09:02:23 +08:00
Shuang Zheng defeb851bc acrn-config: fix the issue no error message in launch setting
fix the issue that there is no error message displayed in launch setting of WebUI.

Tracked-On: #3913
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2019-10-25 09:02:23 +08:00
Wei Liu d9f0d8dcf0 acrn-config: fix the wrong 'key' type returned to webUI
Fix the wrong 'key' type of error list returned to webUI for parsing.

 Tracked-On: #3913
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-25 09:02:23 +08:00
Wei Liu 9ea7a85ca5 acrn-config: set default package value for _S3 and _S5
Some BIOS does not support s3/s5, so there might be no _S3 or _S5
package in host ACPI table, previous code did not handle this, so
the build would be failed with the generated board file.
Set default s3/s5 package value to 0 for such case.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 15:13:51 +08:00
Wei Liu 24d3eaba27 acrn-config: skip git environment check when not do git commit
Check git environment only when '--enable_commit' option was set.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 15:13:51 +08:00