Commit Graph

193 Commits

Author SHA1 Message Date
Wei Liu 170aa935bd acrn-config: add P2SB device to whitelist for apl-mrb
apl-mrb need to access P2SB device, so add 00:0d.0 P2SB device to
whitelist for platform pci hidden device.

Tracked-On: #3475
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-02-24 12:21:29 +08:00
Zide Chen 50f284528e acrn-config: a few changes on vm_config[] clos generation
- python script crashes if the desired 'clos' tag doesn't exist in the
  scenario xml file. In the following example, tag '0' doesn't exist:
      clos_set: {1: '0', 2: '0'}
  referring to tag 0 directly ("vm_info.clos_set[0] == None") causes crash.

  To fix it, this patch uses "if i in vm_info.clos_set:" where 'i' is the
  VM id and serves as the tag in the clos_set dictionary, to sanity
  check the dictionary.

- if the hardware doesn't support CAT, don't need to generate clos entry
  in the vm_config[], which could be confusing.

- to reduce redundant code, wrap the clos generation code as a function.

Tracked-On: #2462
Signed-off-by: Zide Chen <zide.chen@intel.com>
2020-02-13 10:39:58 +08:00
Alexander Merritt 2e10930d12 Python scripts discovering CPU IDs are off by 1
Tracked-On: #4387
Signed-off-by: Alexander Merritt <alex.merritt@intel.com>
2020-02-10 11:47:53 +08:00
Alexander Merritt ef1c92e841 fix typos in script
Tracked-On: #4388
Signed-off-by: Alexander Merritt <alex.merritt@intel.com>
2020-02-10 11:47:26 +08:00
Wei Liu 57a362061f acrn-config: set up whitelist for board containing hide pci device
Currently, config tool will maintain a whitelist for the board which
need to hide some pci devices. For the board out of whitelist, we set
MAX_HIDE_PDEVS_NUM to 0.

Tracked-On: #3475
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-01-07 16:05:30 +08:00
Zide Chen 5f2c303a7e acrn-config: dump CPU info from /sys/devices/system/cpu/possible
/proc/cpuinfo represents online CPUs only, and the number of CPUs is
limited by the 'maxcpus' option.

/sys/devices/system/cpu/possible is a better option for our purpose
since it represents the possible CPUs that can ever be available in the
system, including the offline CPUs. And it's not limited by 'maxcpus'.

Though the Linux command line parameter nr_cpus and possible_cpus still
have impact on /sys/devices/system/cpu/possible.

Tracked-On: #3854
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-31 08:47:08 +08:00
Wei Liu 77c3ce06e1 acrn-config: remove uncessary split for 'virtio-net'
Split the input message for 'virtio-net' would discard extra
message from user input, this is not expected for 'virtio-net' setting.

Tracked-On: #4298
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-25 14:28:07 +08:00
Wei Liu ce35a00518 acrn-config: add 'cpu_sharing' support for launch config
Add support to parse and get 'cpu_sharing' item value
from launch config files, these values are editable by user.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-25 14:28:07 +08:00
Wei Liu 3544f7c87e acrn-config: add 'cpu_sharing' info in launch xmls
Launch script should be set to 'Disabled'/'Enabled' from webUI while
hv enabled/disabled the cpu sharing.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-25 14:28:07 +08:00
Zide Chen fc78013fba acrn-config: some cleanup for logical partition mode Linux bootargs
- commit 69152647 ("hv: Use virtual APIC IDs for Pre-launched VMs")
  enables virtual APIC IDs for pre-launched VMs thus xapic_phys is no
  longer needed to force guest xAPIC to work in physical destination mode.

- HVC is not available in logical partition mode and "console=hvc0" should
  be removed from guest Linux bootargs.

Tracked-On: #3854
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-25 13:46:37 +08:00
Wei Liu 651510a8d1 acrn-config: add 'logger_setting' into launch script
Add missed definition of 'logger_setting' into launch script.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:56:22 +08:00
Wei Liu 7f74e6e9a9 acrn-config: refine mount device for virtio-blk
Previous launch config tool doesn't handle the situation that
'virtio-blk' is set with rootfs partition with rootfs image,
in such scenario, VM would be failed to start when launching
This patch refine the mount device while use rootfs partiton and image
from vritio block device.

Tracked-On: #4248
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:56:22 +08:00
Wei Liu fc357a7782 acrn-config: add 'tap_' perfix for virtio-net
UOS would be failed to get ip address, add 'tap_' perfix for virtio-net
name setting.

Tracked-On: #4255
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:56:22 +08:00
Wei Liu 5b6a33bb34 acrn-config: enable log_setting in all VMs
enable log_setting for all VMs.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:56:22 +08:00
Wei Liu bb6e28e183 acrn-config: check pass-thruogh device for audio/audio_codec
Add this check while validating audio/audio_codec for pass-through
device setting.

Tracked-On: #4249
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:56:22 +08:00
Wei Liu 4234d2e4d3 acrn-config: correct vuart1 setting in scenario config
The 'vuart1' item is selectable from webUI, but in some case user
might select vuart1 in industry scenario by mistake. If config tool
set them in vm configurations directly without checking, the
hypervisor might be failed to boot.
This patch will check such case and set the correct vuart1 in vm
configurations.

Tracked-On: #4247
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:56:22 +08:00
Chen, Zide d80a0dcea0 acrn-config: fix a few formatting issues
scenario_cfg_lib.py:
  - removed extra white space before ','

pci_dev_c.py:
  - follow style in other files, added two empty lines
  - removed extra line at the end of the .c file

vm_configurations_c.py
  - alignment

vm_configurations_h.py
  - alignment

Tracked-On: #3602
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:53:32 +08:00
Wei Liu 051f277cba acrn-config: modify hpa start size value for logical_partition scenario
Modify the hpa start size value for logical_partition scenario to avoid
build issue, and make the memory size of pre-launched VM configurable.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-23 16:55:32 +08:00
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